@nukleus-sports/ui-patterns 0.4.0 → 0.5.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.js ADDED
@@ -0,0 +1,1445 @@
1
+ import {
2
+ EntityAvatar
3
+ } from "./chunk-4N2GUEA7.js";
4
+
5
+ // src/team/team-info-card.tsx
6
+ import {
7
+ Card,
8
+ CardContent,
9
+ Tabs,
10
+ TabsContent,
11
+ TabsList,
12
+ TabsTrigger,
13
+ cn
14
+ } from "@nukleus-sports/ui-web";
15
+ import { formatTeamName, getTeamPlaceSummaries } from "@nukleus-sports/core";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ var TAB_TRIGGER_CLASS = "flex-1 bg-card text-[13px] text-text-primary data-[state=active]:bg-card data-[state=active]:text-primary-color-nuk-text data-[state=active]:shadow-none border-b border-greys-grey-strokes-tables data-[state=active]:border-primary-color-nuk-ui-elem rounded-none px-0 pb-2 mb-[-1px] relative after:absolute after:left-0 after:-bottom-[1px] after:w-full after:h-[2px] after:content-[''] after:bg-transparent data-[state=active]:after:bg-primary-color-nuk-ui-elem";
18
+ function TeamInfoCard({ team, resolveImageUrl, className }) {
19
+ const teamDisplayName = formatTeamName(team.team, team.nickname) || "Team not found";
20
+ const conferenceInfo = team.specificData?.conference || team.specificData?.division ? `${team.specificData.conference || ""} ${team.specificData.division || ""}`.trim() : "";
21
+ const { venue: venueInfo, facility: facilityInfo } = getTeamPlaceSummaries(
22
+ team.specificData,
23
+ team.leagueAbbreviation
24
+ );
25
+ const socials = team.specificData?.socials ?? [];
26
+ return /* @__PURE__ */ jsx(
27
+ Card,
28
+ {
29
+ className: cn(
30
+ "p-4 sm:py-4 sm:px-9 w-full xl:w-[420px] flex flex-col overflow-hidden border-none h-full md:min-h-[612px]",
31
+ className
32
+ ),
33
+ children: /* @__PURE__ */ jsxs(CardContent, { className: "flex flex-col gap-4 items-center p-0", children: [
34
+ /* @__PURE__ */ jsxs("div", { className: "flex sm:flex-col sm:items-center sm:gap-4", children: [
35
+ /* @__PURE__ */ jsx(
36
+ EntityAvatar,
37
+ {
38
+ entityType: "team",
39
+ entityData: {
40
+ team: team.team,
41
+ nickname: team.nickname,
42
+ team_logo_url: team.teamLogoUrl
43
+ },
44
+ resolveImageUrl,
45
+ size: "3xl",
46
+ className: "rounded-none",
47
+ fallbackClassName: "text-2xl font-bold"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 justify-center px-4 sm:items-center", children: [
51
+ /* @__PURE__ */ jsx("div", { className: "text-text-primary text-[24px] font-black sm:player-card-name", children: teamDisplayName }),
52
+ conferenceInfo && /* @__PURE__ */ jsx("p", { className: "text-sm text-text-primary", children: conferenceInfo })
53
+ ] })
54
+ ] }),
55
+ /* @__PURE__ */ jsxs(Tabs, { defaultValue: "info", className: "w-full", children: [
56
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid w-full grid-cols-2 bg-transparent border-b rounded-none h-auto p-0 text-text-primary", children: [
57
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "info", className: TAB_TRIGGER_CLASS, children: "Info" }),
58
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "social", className: TAB_TRIGGER_CLASS, children: "Social" })
59
+ ] }),
60
+ /* @__PURE__ */ jsx(TabsContent, { value: "info", className: "mt-3", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[auto_1fr] gap-4", children: [
61
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs("p", { className: "text-text-primary body-text", children: [
62
+ venueInfo.label,
63
+ ":"
64
+ ] }) }),
65
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col text-right", children: venueInfo.name ? /* @__PURE__ */ jsxs("div", { className: "text-text-primary body-text", children: [
66
+ /* @__PURE__ */ jsx("p", { children: venueInfo.name }),
67
+ venueInfo.address && /* @__PURE__ */ jsx("p", { children: venueInfo.address })
68
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-text-primary body-text", children: "No address available" }) }),
69
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs("p", { className: "text-text-primary body-text", children: [
70
+ facilityInfo.label,
71
+ ":"
72
+ ] }) }),
73
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col text-right", children: facilityInfo.name ? /* @__PURE__ */ jsxs("div", { className: "text-text-primary body-text", children: [
74
+ /* @__PURE__ */ jsx("p", { children: facilityInfo.name }),
75
+ facilityInfo.address && /* @__PURE__ */ jsx("p", { children: facilityInfo.address })
76
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-text-primary body-text", children: "No address available" }) }),
77
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx("p", { className: "text-text-primary body-text", children: "Website:" }) }),
78
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col text-right", children: team.officialWebsite ? /* @__PURE__ */ jsxs(
79
+ "a",
80
+ {
81
+ href: /^https?:\/\//.test(team.officialWebsite) ? team.officialWebsite : `http://${team.officialWebsite}`,
82
+ target: "_blank",
83
+ rel: "noopener noreferrer",
84
+ className: "text-primary-color-nuk-text body-text inline-flex items-center justify-end gap-1",
85
+ children: [
86
+ team.officialWebsite.replace(/^https?:\/\//, ""),
87
+ /* @__PURE__ */ jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
88
+ "path",
89
+ {
90
+ strokeLinecap: "round",
91
+ strokeLinejoin: "round",
92
+ strokeWidth: 2,
93
+ d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
94
+ }
95
+ ) })
96
+ ]
97
+ }
98
+ ) : /* @__PURE__ */ jsx("p", { className: "text-text-primary body-text", children: "No website available" }) })
99
+ ] }) }),
100
+ /* @__PURE__ */ jsx(TabsContent, { value: "social", className: "mt-3", children: socials.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-text-primary body-text", children: "No social networks yet." }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: socials.map((social) => {
101
+ const handle = social.handle || social.url?.split("/").pop() || "";
102
+ const url = social.url || `https://${social.platform.toLowerCase()}.com/${handle}`;
103
+ const displayHandle = handle.startsWith("@") ? handle : `@${handle}`;
104
+ return /* @__PURE__ */ jsxs(
105
+ "div",
106
+ {
107
+ className: "flex items-center justify-between gap-2",
108
+ children: [
109
+ /* @__PURE__ */ jsx("span", { className: "text-text-primary body-text", children: social.platform }),
110
+ /* @__PURE__ */ jsx(
111
+ "a",
112
+ {
113
+ href: url,
114
+ target: "_blank",
115
+ rel: "noopener noreferrer",
116
+ className: "text-primary-color-nuk-text body-text hover:underline line-clamp-2 break-words",
117
+ children: displayHandle
118
+ }
119
+ )
120
+ ]
121
+ },
122
+ `${social.platform}:${social.handle ?? ""}:${social.url ?? ""}`
123
+ );
124
+ }) }) })
125
+ ] })
126
+ ] })
127
+ }
128
+ );
129
+ }
130
+
131
+ // src/team/team-staff-table.tsx
132
+ import { useMemo, useState } from "react";
133
+ import {
134
+ BaseTable,
135
+ createClickableSortableHeader,
136
+ useInfiniteList,
137
+ cn as cn2
138
+ } from "@nukleus-sports/ui-web";
139
+ import { sortTeamStaff } from "@nukleus-sports/core";
140
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
141
+ var CATEGORY_ORDER = [
142
+ "Head Coaches",
143
+ "Assistant Coaches",
144
+ "Offensive Coaches",
145
+ "Defensive Coaches",
146
+ "Special Teams Coaches"
147
+ ];
148
+ var UNCATEGORIZED_LABEL = "Other Coaches";
149
+ var DEFAULT_SORT = [{ id: "display_order", desc: false }];
150
+ function TeamStaffTable({
151
+ staff,
152
+ loading,
153
+ isError,
154
+ interactive = false,
155
+ onStaffClick,
156
+ sortable = false,
157
+ sorting,
158
+ onSortingChange,
159
+ virtualized = false,
160
+ isSplitLayout = false,
161
+ isCompact = false,
162
+ resolveImageUrl,
163
+ className
164
+ }) {
165
+ const [internalSorting, setInternalSorting] = useState(DEFAULT_SORT);
166
+ const activeSorting = sorting ?? internalSorting;
167
+ const handleSortingChange = onSortingChange ?? setInternalSorting;
168
+ const effectiveVirtualized = virtualized && !isSplitLayout;
169
+ const rows = useMemo(() => {
170
+ if (staff.length === 0) return [];
171
+ const grouped = /* @__PURE__ */ new Map();
172
+ for (const member of staff) {
173
+ const key = member.position_group || UNCATEGORIZED_LABEL;
174
+ if (!grouped.has(key)) grouped.set(key, []);
175
+ grouped.get(key).push(member);
176
+ }
177
+ grouped.forEach((list, key) => {
178
+ grouped.set(key, sortTeamStaff(list, activeSorting));
179
+ });
180
+ const orderedKeys = [
181
+ ...CATEGORY_ORDER.filter((k) => grouped.has(k)),
182
+ ...Array.from(grouped.keys()).filter((k) => !CATEGORY_ORDER.includes(k))
183
+ ];
184
+ const result = [];
185
+ for (const key of orderedKeys) {
186
+ result.push({
187
+ id: -1 * (result.length + 1),
188
+ first_name: "",
189
+ last_name: "",
190
+ position: null,
191
+ position_group: key,
192
+ coach_image_url: null,
193
+ display_order: 0,
194
+ __isCategoryRow: true,
195
+ __categoryLabel: key
196
+ });
197
+ result.push(...grouped.get(key));
198
+ }
199
+ return result;
200
+ }, [staff, activeSorting]);
201
+ const { visibleItems, sentinelRef, hasMore } = useInfiniteList(rows, {
202
+ resetKey: `${staff.length}|${JSON.stringify(activeSorting)}`
203
+ });
204
+ const displayedRows = effectiveVirtualized ? visibleItems : rows;
205
+ const columns = useMemo(() => {
206
+ const activate = (id) => onStaffClick?.(id);
207
+ const interactionProps = (id, ariaLabel) => interactive ? {
208
+ onClick: () => activate(id),
209
+ onKeyDown: (e) => {
210
+ if (e.key === "Enter" || e.key === " ") {
211
+ e.preventDefault();
212
+ activate(id);
213
+ }
214
+ },
215
+ tabIndex: 0,
216
+ role: "button",
217
+ "aria-label": ariaLabel
218
+ } : {};
219
+ const nameHeader = sortable ? createClickableSortableHeader("Name") : "Name";
220
+ const positionHeader = sortable ? createClickableSortableHeader("Position") : "Position";
221
+ return [
222
+ {
223
+ id: "name",
224
+ header: nameHeader,
225
+ accessorFn: (row) => `${row.first_name} ${row.last_name}`,
226
+ cell: ({ row }) => {
227
+ const member = row.original;
228
+ const fullName = `${member.first_name} ${member.last_name}`.trim();
229
+ const labelText = `View ${fullName}'s profile`;
230
+ return /* @__PURE__ */ jsxs2("div", { className: "flex gap-2 items-center w-full line-clamp-2", children: [
231
+ /* @__PURE__ */ jsx2(
232
+ "div",
233
+ {
234
+ className: cn2("flex items-center justify-center", interactive && "cursor-pointer"),
235
+ ...interactionProps(member.id, labelText),
236
+ children: /* @__PURE__ */ jsx2(
237
+ EntityAvatar,
238
+ {
239
+ entityType: "coach",
240
+ entityData: {
241
+ first_name: member.first_name,
242
+ last_name: member.last_name,
243
+ coach_image_url: member.coach_image_url
244
+ },
245
+ resolveImageUrl,
246
+ size: isCompact ? "xs" : "lg"
247
+ }
248
+ )
249
+ }
250
+ ),
251
+ /* @__PURE__ */ jsx2(
252
+ "div",
253
+ {
254
+ className: cn2("line-clamp-2", interactive && "cursor-pointer"),
255
+ ...interactionProps(member.id, labelText),
256
+ children: fullName
257
+ }
258
+ )
259
+ ] });
260
+ },
261
+ meta: { cellSize: isCompact ? "teamMobile" : "xl" }
262
+ },
263
+ {
264
+ id: "position",
265
+ header: positionHeader,
266
+ accessorFn: (row) => row.position || "-",
267
+ cell: ({ row }) => /* @__PURE__ */ jsx2("div", { className: "flex items-center h-full min-h-[46px]", children: /* @__PURE__ */ jsx2(
268
+ "span",
269
+ {
270
+ className: cn2("line-clamp-2 break-words", interactive && "cursor-pointer"),
271
+ ...interactionProps(
272
+ row.original.id,
273
+ `View ${row.original.first_name} ${row.original.last_name}'s position`
274
+ ),
275
+ children: row.original.position || "-"
276
+ }
277
+ ) }),
278
+ meta: { cellSize: "l" }
279
+ }
280
+ ];
281
+ }, [interactive, onStaffClick, sortable, isCompact, resolveImageUrl]);
282
+ return /* @__PURE__ */ jsx2("div", { className: "w-full xl:flex xl:h-full xl:flex-1 xl:min-h-0 xl:flex-col xl:overflow-hidden", children: /* @__PURE__ */ jsx2(
283
+ BaseTable,
284
+ {
285
+ columns,
286
+ data: displayedRows,
287
+ sorting: sortable ? activeSorting : void 0,
288
+ onSortingChange: sortable ? ((updater) => {
289
+ const next = typeof updater === "function" ? updater(activeSorting) : updater;
290
+ handleSortingChange(next);
291
+ }) : void 0,
292
+ manualSorting: sortable,
293
+ loading,
294
+ emptyMessage: isError ? "Failed to load coaching staff. Please try again." : "No coaches found.",
295
+ pageSize: Math.max(displayedRows.length, 25),
296
+ hidePagination: effectiveVirtualized,
297
+ stickyHeader: true,
298
+ splitLayout: isSplitLayout,
299
+ numberOfColumns: 1,
300
+ splitLayoutGridCols: isCompact ? "!grid-cols-[minmax(120px,120px)_1fr]" : isSplitLayout ? "sm:!grid-cols-[minmax(220px,220px)_1fr]" : "",
301
+ containerClassName: cn2("border-0 rounded-none", effectiveVirtualized && "h-full"),
302
+ className: cn2(
303
+ "border-none",
304
+ effectiveVirtualized && "h-full min-h-0 w-full xl:flex-1 xl:overflow-hidden",
305
+ className
306
+ ),
307
+ bottomContent: effectiveVirtualized && hasMore ? /* @__PURE__ */ jsx2("div", { ref: sentinelRef, className: "h-px w-full" }) : null,
308
+ getRowBanner: (row) => row.__isCategoryRow ? row.__categoryLabel : null,
309
+ bannerRowClassName: "bg-greys-background-hover hover:bg-greys-background-hover",
310
+ getRowClassName: (row) => row.__isCategoryRow ? "hidden" : ""
311
+ }
312
+ ) });
313
+ }
314
+
315
+ // src/team/stat-column.tsx
316
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
317
+ function StatColumn({ label, value, suffix, rankBadge }) {
318
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center h-full justify-center flex-1 gap-1 sm:gap-3 w-full", children: [
319
+ /* @__PURE__ */ jsx3("span", { className: "label-xs-medium text-text-secondary leading-normal opacity-[0.8] ss05", children: label }),
320
+ /* @__PURE__ */ jsxs3("span", { className: "text-[19px] font-semibold sm:text-[32px] sm:font-bold text-text-primary leading-normal title-text opacity-[0.8]", children: [
321
+ value,
322
+ suffix || ""
323
+ ] }),
324
+ rankBadge
325
+ ] });
326
+ }
327
+
328
+ // src/team/team-season-stats-summary-panel.tsx
329
+ import { Card as Card2, CardContent as CardContent2, CardHeader, CardTitle, Skeleton, cn as cn3 } from "@nukleus-sports/ui-web";
330
+ import {
331
+ getTeamStatColumns,
332
+ isSupportedTeamStatsSport
333
+ } from "@nukleus-sports/core";
334
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
335
+ function getStatusMessage({
336
+ isSupportedSport,
337
+ selectedYear,
338
+ selectedType,
339
+ isError,
340
+ stats
341
+ }) {
342
+ if (!isSupportedSport) return "Team season stats coming soon.";
343
+ if (!selectedYear || selectedType === null) return "Select a season to view stats.";
344
+ if (isError && !stats) return "Couldn't load season stats. Please try again.";
345
+ if (!stats) return "No season stats for the current season.";
346
+ return null;
347
+ }
348
+ function TeamSeasonStatsSummaryPanel({
349
+ sportId,
350
+ selectedYear,
351
+ selectedType,
352
+ stats,
353
+ loading,
354
+ isError,
355
+ className
356
+ }) {
357
+ const columns = getTeamStatColumns(sportId);
358
+ const statusMessage = loading ? null : getStatusMessage({
359
+ isSupportedSport: isSupportedTeamStatsSport(sportId),
360
+ selectedYear,
361
+ selectedType,
362
+ isError,
363
+ stats
364
+ });
365
+ return /* @__PURE__ */ jsxs4(Card2, { className: cn3("border-0 p-4 flex flex-col gap-4", className), children: [
366
+ /* @__PURE__ */ jsx4(CardHeader, { className: "p-0", children: /* @__PURE__ */ jsx4(CardTitle, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Stats" }) }),
367
+ /* @__PURE__ */ jsx4(CardContent2, { className: "p-0 flex-1 flex justify-center items-center", children: loading ? /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx4(Skeleton, { className: "h-4 w-3/4" }) }) : statusMessage ? /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: statusMessage }) : stats && /* @__PURE__ */ jsx4("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__ */ jsx4(
368
+ StatColumn,
369
+ {
370
+ label: col.label,
371
+ value: stats.values[i],
372
+ suffix: col.suffix
373
+ },
374
+ col.label
375
+ )) }) })
376
+ ] });
377
+ }
378
+
379
+ // src/team/team-season-schedule-summary-panel.tsx
380
+ import { Card as Card3, CardContent as CardContent3, CardHeader as CardHeader2, CardTitle as CardTitle2, Skeleton as Skeleton2, cn as cn4 } from "@nukleus-sports/ui-web";
381
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
382
+ function TeamSeasonScheduleSummaryPanel({
383
+ selectedYear,
384
+ selectedType,
385
+ summary,
386
+ loading,
387
+ isError,
388
+ className
389
+ }) {
390
+ return /* @__PURE__ */ jsxs5(Card3, { className: cn4("border-0 p-4 flex flex-col gap-4", className), children: [
391
+ /* @__PURE__ */ jsx5(CardHeader2, { className: "p-0", children: /* @__PURE__ */ jsx5(CardTitle2, { className: "text-base text-text-primary font-medium leading-normal", children: "Season Summary" }) }),
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(Skeleton2, { className: "h-4 w-3/4" }) }) : !selectedYear || selectedType === null ? /* @__PURE__ */ jsx5("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__ */ jsx5("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__ */ jsx5("div", { className: "flex items-center justify-center w-full text-14.5 text-text-secondary", children: "No schedule data for the current season." }) : /* @__PURE__ */ jsxs5("div", { className: "w-full flex flex-col sm:flex-row gap-6 sm:gap-3 justify-between items-center", children: [
393
+ /* @__PURE__ */ jsx5(StatColumn, { label: "Record", value: summary.record }),
394
+ /* @__PURE__ */ jsx5(
395
+ StatColumn,
396
+ {
397
+ label: "Games Played",
398
+ value: `${summary.gamesPlayed} of ${summary.totalGames}`
399
+ }
400
+ )
401
+ ] }) })
402
+ ] });
403
+ }
404
+
405
+ // src/team/season-selector.tsx
406
+ import {
407
+ Select,
408
+ SelectContent,
409
+ SelectItem,
410
+ SelectTrigger,
411
+ SelectValue,
412
+ cn as cn5
413
+ } from "@nukleus-sports/ui-web";
414
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
415
+ function SeasonSelector({
416
+ years,
417
+ types,
418
+ selectedYear,
419
+ selectedType,
420
+ onYearChange,
421
+ onTypeChange,
422
+ hideTypeOnMobile = false,
423
+ className
424
+ }) {
425
+ return /* @__PURE__ */ jsxs6("div", { className: cn5("flex gap-3", className), children: [
426
+ /* @__PURE__ */ jsxs6(
427
+ Select,
428
+ {
429
+ value: selectedYear?.toString() ?? "",
430
+ onValueChange: (value) => onYearChange(Number(value)),
431
+ children: [
432
+ /* @__PURE__ */ jsx6(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season year", children: /* @__PURE__ */ jsx6(SelectValue, { placeholder: "Select year" }) }),
433
+ /* @__PURE__ */ jsx6(
434
+ SelectContent,
435
+ {
436
+ className: "bg-card border-border z-50 [&_.checkbox]:!flex",
437
+ classNameViewPort: "gap-2",
438
+ children: years.map((year) => /* @__PURE__ */ jsx6(SelectItem, { value: year.value.toString(), className: "min-h-8", children: year.label }, year.value))
439
+ }
440
+ )
441
+ ]
442
+ }
443
+ ),
444
+ /* @__PURE__ */ jsx6("div", { className: cn5(hideTypeOnMobile && "hidden sm:block"), children: /* @__PURE__ */ jsxs6(
445
+ Select,
446
+ {
447
+ value: selectedType?.toString() ?? "",
448
+ onValueChange: (value) => onTypeChange(Number(value)),
449
+ disabled: selectedYear === null,
450
+ children: [
451
+ /* @__PURE__ */ jsx6(SelectTrigger, { variant: "widget", size: "widget", "aria-label": "Season type", children: /* @__PURE__ */ jsx6(SelectValue, { placeholder: "Select type" }) }),
452
+ /* @__PURE__ */ jsx6(
453
+ SelectContent,
454
+ {
455
+ className: "bg-card border-border z-50 [&_.checkbox]:!flex",
456
+ classNameViewPort: "gap-2",
457
+ children: types.map((type) => /* @__PURE__ */ jsx6(SelectItem, { value: type.value.toString(), className: "min-h-8", children: type.label }, type.value))
458
+ }
459
+ )
460
+ ]
461
+ }
462
+ ) })
463
+ ] });
464
+ }
465
+
466
+ // src/team/fact-pills.tsx
467
+ import { useId, useLayoutEffect, useRef, useState as useState2 } from "react";
468
+ import { cn as cn6 } from "@nukleus-sports/ui-web";
469
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
470
+ var MAX_ROWS = 2;
471
+ var KEY_SEPARATOR = "";
472
+ 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";
473
+ var TOGGLE_CLASS = "flex shrink-0 items-center py-0.5 label-xs-table font-ss02-ss05 text-primary-color-nuk-text hover:underline focus-visible:underline focus-visible:outline-none";
474
+ function pillKeys(items) {
475
+ const seen = /* @__PURE__ */ new Map();
476
+ return items.map((item) => {
477
+ const text = String(item);
478
+ const count = seen.get(text) ?? 0;
479
+ seen.set(text, count + 1);
480
+ return `${text}${KEY_SEPARATOR}${count}`;
481
+ });
482
+ }
483
+ function FactPills({ items, capped = false }) {
484
+ const listId = useId();
485
+ const listRef = useRef(null);
486
+ const [expanded, setExpanded] = useState2(false);
487
+ const [visibleCount, setVisibleCount] = useState2(null);
488
+ const [clipHeight, setClipHeight] = useState2(null);
489
+ const [width, setWidth] = useState2(0);
490
+ const contentKey = items.join(KEY_SEPARATOR);
491
+ const keys = pillKeys(items);
492
+ const collapsible = capped && !expanded;
493
+ useLayoutEffect(() => {
494
+ const list = listRef.current;
495
+ if (!capped || !list || typeof ResizeObserver === "undefined") return;
496
+ const observer = new ResizeObserver((entries) => {
497
+ const next = Math.round(entries[0]?.contentRect.width ?? 0);
498
+ setWidth((prev) => prev === next ? prev : next);
499
+ });
500
+ observer.observe(list);
501
+ return () => observer.disconnect();
502
+ }, [capped]);
503
+ const measurementKey = `${width}:${contentKey}`;
504
+ const [measuredFor, setMeasuredFor] = useState2(measurementKey);
505
+ if (measuredFor !== measurementKey) {
506
+ setMeasuredFor(measurementKey);
507
+ if (visibleCount !== null) setVisibleCount(null);
508
+ }
509
+ useLayoutEffect(() => {
510
+ const list = listRef.current;
511
+ if (!collapsible || !list) return;
512
+ const children = Array.from(list.children).filter(
513
+ (el) => el instanceof HTMLElement
514
+ );
515
+ const first = children[0];
516
+ if (!first || first.offsetHeight === 0) return;
517
+ const rowGap = Number.parseFloat(getComputedStyle(list).rowGap) || 0;
518
+ const rowStep = first.offsetHeight + rowGap;
519
+ const lastRowTop = first.offsetTop + rowStep * (MAX_ROWS - 1);
520
+ const fits = (el) => el.offsetTop <= lastRowTop + 1;
521
+ if (visibleCount === null) {
522
+ const nextClip = Math.ceil(rowStep * MAX_ROWS - rowGap);
523
+ setClipHeight((prev) => prev === nextClip ? prev : nextClip);
524
+ const fitting = children.filter(fits).length;
525
+ if (fitting < items.length) setVisibleCount(fitting);
526
+ return;
527
+ }
528
+ const toggle = children[children.length - 1];
529
+ if (toggle && !fits(toggle)) {
530
+ setVisibleCount((prev) => prev !== null && prev > 0 ? prev - 1 : prev);
531
+ }
532
+ }, [collapsible, visibleCount, contentKey, items.length, width]);
533
+ const truncated = collapsible && visibleCount !== null && visibleCount < items.length;
534
+ const shownCount = truncated ? visibleCount : items.length;
535
+ const handleShowMore = () => setExpanded(true);
536
+ const handleShowLess = () => {
537
+ setExpanded(false);
538
+ setVisibleCount(null);
539
+ };
540
+ return /* @__PURE__ */ jsxs7(
541
+ "ul",
542
+ {
543
+ id: listId,
544
+ ref: listRef,
545
+ className: cn6(
546
+ "flex w-full flex-wrap content-start items-start gap-1",
547
+ collapsible && "overflow-hidden"
548
+ ),
549
+ style: collapsible && clipHeight !== null ? { maxHeight: clipHeight } : void 0,
550
+ children: [
551
+ items.slice(0, shownCount).map((item, index) => /* @__PURE__ */ jsx7("li", { className: PILL_CLASS, title: String(item), children: /* @__PURE__ */ jsx7("span", { className: "truncate", children: item }) }, keys[index])),
552
+ truncated && /* @__PURE__ */ jsx7("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx7(
553
+ "button",
554
+ {
555
+ type: "button",
556
+ className: TOGGLE_CLASS,
557
+ "aria-expanded": false,
558
+ "aria-controls": listId,
559
+ onClick: handleShowMore,
560
+ children: "Show More"
561
+ }
562
+ ) }),
563
+ capped && expanded && /* @__PURE__ */ jsx7("li", { className: "flex shrink-0", children: /* @__PURE__ */ jsx7(
564
+ "button",
565
+ {
566
+ type: "button",
567
+ className: TOGGLE_CLASS,
568
+ "aria-expanded": true,
569
+ "aria-controls": listId,
570
+ onClick: handleShowLess,
571
+ children: "Show Less"
572
+ }
573
+ ) })
574
+ ]
575
+ }
576
+ );
577
+ }
578
+
579
+ // src/team/fact-field.tsx
580
+ import { Skeleton as Skeleton3, cn as cn7 } from "@nukleus-sports/ui-web";
581
+ import {
582
+ EMPTY_FACT_VALUE,
583
+ formatTeamFactNumber,
584
+ formatYearPills,
585
+ TEAM_FACT_KINDS,
586
+ TEAM_FACT_YEAR_PAIRS
587
+ } from "@nukleus-sports/core";
588
+ import { Fragment, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
589
+ function numberFact(facts, key) {
590
+ const value = facts[key];
591
+ return typeof value === "number" ? value : null;
592
+ }
593
+ function listFact(facts, key) {
594
+ const value = facts[key];
595
+ return Array.isArray(value) ? value : [];
596
+ }
597
+ function textFact(facts, key) {
598
+ const value = facts[key];
599
+ return typeof value === "string" ? value : null;
600
+ }
601
+ function EmptyValue({ children = EMPTY_FACT_VALUE }) {
602
+ return /* @__PURE__ */ jsx8("span", { className: "body-text font-ss02-ss05 text-text-secondary", children });
603
+ }
604
+ function FieldLabel({ children }) {
605
+ return /* @__PURE__ */ jsx8("span", { className: "w-full label-xs-text font-ss02-ss05 text-text-secondary", children });
606
+ }
607
+ function CountFact({
608
+ factKey,
609
+ data
610
+ }) {
611
+ const { facts, config } = data;
612
+ const pairedYears = TEAM_FACT_YEAR_PAIRS[factKey];
613
+ const years = pairedYears ? formatYearPills(listFact(facts, pairedYears), config.formatChampionshipYear) : [];
614
+ return /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [
615
+ /* @__PURE__ */ jsx8(FieldLabel, { children: config.labels[factKey] }),
616
+ /* @__PURE__ */ jsx8("span", { className: "stat-count-number title-text text-text-primary", children: formatTeamFactNumber("count", numberFact(facts, factKey)) }),
617
+ years.length > 0 && /* @__PURE__ */ jsx8(FactPills, { items: years, capped: true })
618
+ ] });
619
+ }
620
+ function RivalValue({
621
+ rival,
622
+ resolveImageUrl,
623
+ getRivalHref
624
+ }) {
625
+ switch (rival.status) {
626
+ case "none":
627
+ return /* @__PURE__ */ jsx8(EmptyValue, {});
628
+ case "loading":
629
+ return /* @__PURE__ */ jsx8(Skeleton3, { className: "h-8 w-40", "aria-label": "Loading rival" });
630
+ case "error":
631
+ return /* @__PURE__ */ jsx8(EmptyValue, { children: "Couldn't load the rival team" });
632
+ case "ready": {
633
+ const content = /* @__PURE__ */ jsxs8(Fragment, { children: [
634
+ /* @__PURE__ */ jsx8(
635
+ EntityAvatar,
636
+ {
637
+ entityType: "initials",
638
+ name: rival.rival.name,
639
+ imageUrl: rival.rival.teamLogoUrl,
640
+ resolveImageUrl,
641
+ size: "md",
642
+ className: "shrink-0"
643
+ }
644
+ ),
645
+ /* @__PURE__ */ jsx8("span", { className: "min-w-0", children: rival.rival.name })
646
+ ] });
647
+ const className = "inline-flex max-w-full items-center gap-1.5 body-text-semibold font-ss02-ss05 text-primary-color-nuk-text";
648
+ return getRivalHref ? /* @__PURE__ */ jsx8("a", { href: getRivalHref(rival.rival.id), className: cn7(className, "hover:underline"), children: content }) : /* @__PURE__ */ jsx8("span", { className, children: content });
649
+ }
650
+ }
651
+ }
652
+ function factValue(factKey, layout, data, resolveImageUrl, getRivalHref) {
653
+ const { facts, config } = data;
654
+ const kind = TEAM_FACT_KINDS[factKey];
655
+ if (kind === "number" || kind === "year" || kind === "text") {
656
+ const display = kind === "text" ? textFact(facts, factKey) : formatTeamFactNumber(kind, numberFact(facts, factKey));
657
+ const isEmpty = !display || display === EMPTY_FACT_VALUE;
658
+ return /* @__PURE__ */ jsx8(
659
+ "span",
660
+ {
661
+ className: cn7(
662
+ "w-full header-xl-medium-card font-ss02-ss05 [overflow-wrap:anywhere]",
663
+ isEmpty ? "text-text-secondary" : "text-text-primary"
664
+ ),
665
+ children: display ?? EMPTY_FACT_VALUE
666
+ }
667
+ );
668
+ }
669
+ if (kind === "years" || kind === "labeled_years" || kind === "list") {
670
+ const raw = listFact(facts, factKey);
671
+ const items = kind === "years" ? formatYearPills(raw, config.formatChampionshipYear) : raw;
672
+ return items.length > 0 ? /* @__PURE__ */ jsx8(FactPills, { items, capped: layout === "grid" }) : /* @__PURE__ */ jsx8(EmptyValue, {});
673
+ }
674
+ if (kind === "rival") {
675
+ return /* @__PURE__ */ jsx8(
676
+ RivalValue,
677
+ {
678
+ rival: data.rival,
679
+ resolveImageUrl,
680
+ getRivalHref
681
+ }
682
+ );
683
+ }
684
+ const text = textFact(facts, factKey);
685
+ return /* @__PURE__ */ jsx8(
686
+ "p",
687
+ {
688
+ className: cn7(
689
+ "w-full body-text font-ss02-ss05 whitespace-pre-line",
690
+ text ? "text-text-primary" : "text-text-secondary"
691
+ ),
692
+ children: text ?? EMPTY_FACT_VALUE
693
+ }
694
+ );
695
+ }
696
+ function FactField({
697
+ factKey,
698
+ layout,
699
+ data,
700
+ resolveImageUrl,
701
+ getRivalHref
702
+ }) {
703
+ const kind = TEAM_FACT_KINDS[factKey];
704
+ if (kind === "count") return /* @__PURE__ */ jsx8(CountFact, { factKey, data });
705
+ return /* @__PURE__ */ jsxs8(
706
+ "div",
707
+ {
708
+ className: cn7(
709
+ "flex min-w-0 flex-col items-start gap-1.5",
710
+ layout === "row" && "flex-1",
711
+ layout === "grid" && kind !== "list" && "gap-1"
712
+ ),
713
+ children: [
714
+ /* @__PURE__ */ jsx8(FieldLabel, { children: data.config.labels[factKey] }),
715
+ factValue(factKey, layout, data, resolveImageUrl, getRivalHref)
716
+ ]
717
+ }
718
+ );
719
+ }
720
+
721
+ // src/team/venue-photo.tsx
722
+ import { useState as useState3 } from "react";
723
+ import { cn as cn8 } from "@nukleus-sports/ui-web";
724
+ import { XsViewInvoiceIcon } from "@nukleus-sports/icons";
725
+ import { facilityImageCredit } from "@nukleus-sports/core";
726
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
727
+ var PHOTO_WIDTHS = [640, 960, 1280];
728
+ var PHOTO_SIZES = "(min-width: 1280px) 420px, 100vw";
729
+ var LINK_CLASS = "inline-flex shrink-0 items-center gap-1 hover:text-text-primary";
730
+ function NewTabNote() {
731
+ return /* @__PURE__ */ jsx9("span", { className: "sr-only", children: " (opens in a new tab)" });
732
+ }
733
+ function resolvePhotoSources(path, resolveImageUrl) {
734
+ const candidates = PHOTO_WIDTHS.flatMap((width) => {
735
+ const url = resolveImageUrl(path, width);
736
+ return url ? [{ url, width }] : [];
737
+ });
738
+ return {
739
+ original: resolveImageUrl(path) ?? void 0,
740
+ srcSet: candidates.length ? candidates.map(({ url, width }) => `${url} ${width}w`).join(", ") : void 0,
741
+ resized: resolveImageUrl(path, 960) ?? candidates[0]?.url
742
+ };
743
+ }
744
+ function VenueNameOnly({ name, label }) {
745
+ if (!name) return null;
746
+ return /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-col items-start gap-1.5", children: [
747
+ /* @__PURE__ */ jsx9(FieldLabel, { children: label }),
748
+ /* @__PURE__ */ jsx9("span", { className: "w-full header-xl-medium-card font-ss02-ss05 text-text-primary", children: name })
749
+ ] });
750
+ }
751
+ function PhotoCaption({ name, image }) {
752
+ const credit = facilityImageCredit(image);
753
+ return /* @__PURE__ */ jsxs9("figcaption", { className: "flex w-full flex-col gap-1 xxs-body-text font-ss02-ss05", children: [
754
+ name && /* @__PURE__ */ jsx9("span", { className: "w-full text-text-primary", children: name }),
755
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-start gap-2 text-greys-text-secondary", children: [
756
+ /* @__PURE__ */ jsx9("span", { className: "min-w-0 flex-1", children: credit ? `Photo: ${credit}` : "Photo from Wikimedia Commons" }),
757
+ image.sourceUrl && /* @__PURE__ */ jsxs9(
758
+ "a",
759
+ {
760
+ href: image.sourceUrl,
761
+ target: "_blank",
762
+ rel: "noopener noreferrer",
763
+ className: LINK_CLASS,
764
+ children: [
765
+ "Source",
766
+ /* @__PURE__ */ jsx9(NewTabNote, {}),
767
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ jsx9(
768
+ XsViewInvoiceIcon,
769
+ {
770
+ width: 16,
771
+ height: 16,
772
+ className: "shrink-0 text-greys-ui-elem-strokes"
773
+ }
774
+ ) })
775
+ ]
776
+ }
777
+ ),
778
+ image.licenseUrl && /* @__PURE__ */ jsxs9(
779
+ "a",
780
+ {
781
+ href: image.licenseUrl,
782
+ target: "_blank",
783
+ rel: "noopener noreferrer",
784
+ className: LINK_CLASS,
785
+ children: [
786
+ "License",
787
+ /* @__PURE__ */ jsx9(NewTabNote, {})
788
+ ]
789
+ }
790
+ )
791
+ ] })
792
+ ] });
793
+ }
794
+ function VenuePhoto({ venue, label, resolveImageUrl }) {
795
+ const { name, image } = venue;
796
+ const [failed, setFailed] = useState3("none");
797
+ const [isLoaded, setIsLoaded] = useState3(false);
798
+ const sources = image && resolveImageUrl ? resolvePhotoSources(image.path, resolveImageUrl) : null;
799
+ const useResized = failed === "none" && Boolean(sources?.srcSet);
800
+ const src = failed === "all" ? void 0 : useResized ? sources?.resized : sources?.original;
801
+ if (!image || !src) return /* @__PURE__ */ jsx9(VenueNameOnly, { name, label });
802
+ return /* @__PURE__ */ jsxs9("figure", { className: "flex w-full flex-col gap-3", children: [
803
+ /* @__PURE__ */ jsx9(
804
+ "img",
805
+ {
806
+ src,
807
+ srcSet: useResized ? sources?.srcSet : void 0,
808
+ sizes: useResized ? PHOTO_SIZES : void 0,
809
+ onLoad: () => setIsLoaded(true),
810
+ onError: () => setFailed(useResized ? "resized" : "all"),
811
+ alt: name ?? label,
812
+ className: cn8(
813
+ "h-[150px] w-full rounded-[8px] bg-greys-background-hover object-cover",
814
+ !isLoaded && "animate-pulse"
815
+ ),
816
+ loading: "lazy"
817
+ }
818
+ ),
819
+ /* @__PURE__ */ jsx9(PhotoCaption, { name, image })
820
+ ] });
821
+ }
822
+
823
+ // src/team/team-facts-content.tsx
824
+ import {
825
+ teamFactsDisplayFields
826
+ } from "@nukleus-sports/core";
827
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
828
+ var SECTION_FIELDS_CLASS = {
829
+ grid: "grid grid-cols-2 items-start gap-3",
830
+ row: "flex items-start gap-3",
831
+ column: "flex flex-col gap-3"
832
+ };
833
+ var SECTION_CLASS = (
834
+ // 11px + the 1px border = a 12px inset.
835
+ "flex w-full min-w-0 flex-col gap-3 overflow-hidden rounded-[10px] border border-greys-grey-strokes-tables bg-greys-light-grey p-3"
836
+ );
837
+ function TeamFactsContent({
838
+ data,
839
+ resolveImageUrl,
840
+ resolveVenuePhotoUrl,
841
+ getRivalHref
842
+ }) {
843
+ const { config, venue, hasFacts } = data;
844
+ const photo = /* @__PURE__ */ jsx10(
845
+ VenuePhoto,
846
+ {
847
+ venue,
848
+ label: config.venue.label,
849
+ resolveImageUrl: resolveVenuePhotoUrl
850
+ },
851
+ venue.image?.path ?? "none"
852
+ );
853
+ if (!hasFacts) {
854
+ return /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-3", children: [
855
+ /* @__PURE__ */ jsx10("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." }),
856
+ (venue.image || venue.name) && /* @__PURE__ */ jsx10("section", { className: SECTION_CLASS, children: photo })
857
+ ] });
858
+ }
859
+ return /* @__PURE__ */ jsx10("div", { className: "flex flex-col gap-3", children: config.sections.map((section) => /* @__PURE__ */ jsxs10("section", { "aria-label": section.title, className: SECTION_CLASS, children: [
860
+ /* @__PURE__ */ jsx10("h3", { className: "label-xs-semibold-text font-ss02-ss05 uppercase text-greys-text-secondary", children: section.title }),
861
+ /* @__PURE__ */ jsx10("div", { className: SECTION_FIELDS_CLASS[section.layout], children: teamFactsDisplayFields(section).map((key) => /* @__PURE__ */ jsx10(
862
+ FactField,
863
+ {
864
+ factKey: key,
865
+ layout: section.layout,
866
+ data,
867
+ resolveImageUrl,
868
+ getRivalHref
869
+ },
870
+ key
871
+ )) }),
872
+ section.showsVenuePhoto && photo
873
+ ] }, section.title)) });
874
+ }
875
+
876
+ // src/team/team-facts-widget.tsx
877
+ import {
878
+ Button,
879
+ Card as Card4,
880
+ CardContent as CardContent4,
881
+ CardHeader as CardHeader3,
882
+ CardTitle as CardTitle3,
883
+ Skeleton as Skeleton4,
884
+ cn as cn9
885
+ } from "@nukleus-sports/ui-web";
886
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
887
+ var SKELETON_KEYS = ["trophy-case", "tradition", "profile"];
888
+ function TeamFactsWidget({
889
+ state,
890
+ resolveImageUrl,
891
+ resolveVenuePhotoUrl,
892
+ getRivalHref,
893
+ className
894
+ }) {
895
+ return /* @__PURE__ */ jsxs11(
896
+ Card4,
897
+ {
898
+ className: cn9(
899
+ "flex w-full min-w-0 flex-col gap-3 rounded-[10px] border-0 px-4 pb-[22px] pt-4",
900
+ // Matches the Team Info card's desktop height (TeamInfoCard `md:min-h-[612px]`).
901
+ "xl:min-h-[612px] xl:self-stretch xl:[contain:size]",
902
+ className
903
+ ),
904
+ children: [
905
+ /* @__PURE__ */ jsx11(CardHeader3, { className: "flex h-8 shrink-0 flex-row items-center p-0", children: /* @__PURE__ */ jsx11(CardTitle3, { className: "header-xl-medium-card font-ss02-ss05 text-text-primary", children: "Team Facts" }) }),
906
+ /* @__PURE__ */ jsxs11(CardContent4, { className: "p-0 xl:min-h-0 xl:flex-1 xl:overflow-y-auto xl:[scrollbar-width:none] xl:[&::-webkit-scrollbar]:hidden", children: [
907
+ state.status === "loading" && /* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-3", role: "status", "aria-label": "Loading team facts", children: SKELETON_KEYS.map((key) => /* @__PURE__ */ jsx11(Skeleton4, { className: "h-[200px] w-full rounded-[10px]" }, key)) }),
908
+ state.status === "error" && /* @__PURE__ */ jsxs11(
909
+ "div",
910
+ {
911
+ role: "alert",
912
+ className: "flex h-[120px] flex-col items-center justify-center gap-2 text-14.5 text-text-secondary",
913
+ children: [
914
+ /* @__PURE__ */ jsx11("span", { children: "Couldn't load team facts." }),
915
+ state.devMessage && /* @__PURE__ */ jsx11("span", { className: "xxs-body-text", children: state.devMessage }),
916
+ state.retry && /* @__PURE__ */ jsx11(Button, { type: "button", variant: "outline", size: "sm", onClick: state.retry, children: "Try again" })
917
+ ]
918
+ }
919
+ ),
920
+ state.status === "ready" && /* @__PURE__ */ jsx11(
921
+ TeamFactsContent,
922
+ {
923
+ data: state.data,
924
+ resolveImageUrl,
925
+ resolveVenuePhotoUrl,
926
+ getRivalHref
927
+ },
928
+ state.data.teamId
929
+ )
930
+ ] })
931
+ ]
932
+ }
933
+ );
934
+ }
935
+
936
+ // src/team/stat-ranking-leaderboard-dialog.tsx
937
+ import { useMemo as useMemo2 } from "react";
938
+ import {
939
+ BaseTable as BaseTable2,
940
+ Button as Button2,
941
+ Dialog,
942
+ DialogContent,
943
+ DialogDescription,
944
+ DialogHeader,
945
+ DialogTitle,
946
+ MobileModalLayout,
947
+ cn as cn10
948
+ } from "@nukleus-sports/ui-web";
949
+ import { ChevronLeftIcon, ChevronRightIcon } from "@nukleus-sports/icons";
950
+ import { toOrdinal } from "@nukleus-sports/core";
951
+ import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
952
+ var PAGE_BUTTON_BASE = "background";
953
+ var PAGE_BUTTON_DESKTOP = "!h-[32px] !w-[32px] p-[6px]";
954
+ var PAGE_BUTTON_MOBILE = "!h-11 !w-11 p-3 !outline-0 !border-0 !bg-inherit";
955
+ var HIGHLIGHT_CLASS = "text-semantic-color-status-priority-completed-copy bg-primary-color-total-row-table-2";
956
+ function formatRank(rank, tied) {
957
+ return tied ? `T-${toOrdinal(rank)}` : toOrdinal(rank);
958
+ }
959
+ function Footnotes({ notes }) {
960
+ return /* @__PURE__ */ jsx12("div", { children: notes.map((note) => /* @__PURE__ */ jsxs12("p", { className: "alert-text-italic text-text-secondary", children: [
961
+ "* ",
962
+ note
963
+ ] }, note)) });
964
+ }
965
+ function Pagination({ page, totalPages, isCountKnown, isSm, onPageChange }) {
966
+ const buttonClass = cn10(PAGE_BUTTON_BASE, isSm ? PAGE_BUTTON_DESKTOP : PAGE_BUTTON_MOBILE);
967
+ return /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
968
+ /* @__PURE__ */ jsx12("span", { className: "label-xs-text text-text-secondary", children: isCountKnown ? `Page ${page} of ${totalPages}` : `Page ${page}` }),
969
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3", children: [
970
+ /* @__PURE__ */ jsx12(
971
+ Button2,
972
+ {
973
+ variant: "secondary-greys",
974
+ size: "sm",
975
+ className: buttonClass,
976
+ onClick: () => onPageChange(Math.max(1, page - 1)),
977
+ disabled: page === 1,
978
+ "aria-label": "Go to previous page",
979
+ children: /* @__PURE__ */ jsx12(ChevronLeftIcon, { className: "h-4 w-4" })
980
+ }
981
+ ),
982
+ /* @__PURE__ */ jsx12(
983
+ Button2,
984
+ {
985
+ variant: "secondary-greys",
986
+ size: "sm",
987
+ className: buttonClass,
988
+ onClick: () => onPageChange(Math.min(totalPages, page + 1)),
989
+ disabled: !isCountKnown || page >= totalPages,
990
+ "aria-label": "Go to next page",
991
+ children: /* @__PURE__ */ jsx12(ChevronRightIcon, { className: "h-4 w-4" })
992
+ }
993
+ )
994
+ ] })
995
+ ] });
996
+ }
997
+ function useLeaderboardColumns(entityLabel, statLabel, formatValue, isSm) {
998
+ return useMemo2(
999
+ () => [
1000
+ {
1001
+ accessorKey: "rank",
1002
+ header: "Rank",
1003
+ // BaseTable already wraps every cell in its own <TableCell>; returning another here would
1004
+ // nest <td>s. Column styling goes through rowCellClassName (the row highlight is the
1005
+ // table's getRowClassName).
1006
+ meta: { cellSize: "xs", rowCellClassName: "tabular-nums" },
1007
+ cell: ({ row }) => formatRank(row.original.rank, row.original.tied)
1008
+ },
1009
+ {
1010
+ accessorKey: "entityName",
1011
+ header: entityLabel,
1012
+ meta: { cellSize: isSm ? "xxl" : "m" },
1013
+ cell: ({ row }) => row.original.entityName
1014
+ },
1015
+ {
1016
+ accessorKey: "value",
1017
+ header: () => /* @__PURE__ */ jsx12("div", { className: "text-right text-wrap line-clamp-2", title: statLabel, children: statLabel }),
1018
+ meta: {
1019
+ cellSize: isSm ? "m" : "xs",
1020
+ rowCellClassName: "text-right tabular-nums break-all"
1021
+ },
1022
+ cell: ({ row }) => formatValue(row.original.value)
1023
+ }
1024
+ ],
1025
+ [entityLabel, statLabel, formatValue, isSm]
1026
+ );
1027
+ }
1028
+ function LeaderboardTable(props) {
1029
+ const { rows, highlightEntityId, pageSize, loading, isError, isConfigError } = props;
1030
+ const columns = useLeaderboardColumns(
1031
+ props.entityLabel,
1032
+ props.statLabel,
1033
+ props.formatValue,
1034
+ props.isSm
1035
+ );
1036
+ if (isConfigError) {
1037
+ return /* @__PURE__ */ jsx12("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children: "Couldn't load ranking details. Please try again." });
1038
+ }
1039
+ return /* @__PURE__ */ jsxs12(Fragment2, { children: [
1040
+ isError && rows.length > 0 && /* @__PURE__ */ jsx12("p", { className: "text-12 text-destructive px-1 pb-2", children: "Couldn't refresh rankings. Showing the last loaded data." }),
1041
+ /* @__PURE__ */ jsx12(
1042
+ BaseTable2,
1043
+ {
1044
+ columns,
1045
+ data: rows,
1046
+ loading,
1047
+ pageSize,
1048
+ stickyHeader: true,
1049
+ numberOfColumns: 2,
1050
+ tableClassName: "!border-separate border-spacing-0 !overflow-visible",
1051
+ containerClassName: "border-0 rounded-none w-full !overflow-visible [&_div.overflow-auto]:!overflow-visible [&_div.overflow-auto]:!h-auto",
1052
+ className: "w-full",
1053
+ emptyMessage: isError ? "Couldn't load ranking data. Please try again." : "No ranking data available.",
1054
+ getRowId: (row) => `${row.entityId}-${row.rank}`,
1055
+ getRowClassName: (row) => highlightEntityId != null && row.entityId === highlightEntityId ? HIGHLIGHT_CLASS : ""
1056
+ }
1057
+ )
1058
+ ] });
1059
+ }
1060
+ function LeaderboardContent(props) {
1061
+ const { subtitle, footnotes = [], isSm, page, totalCount, pageSize, onPageChange } = props;
1062
+ const isCountKnown = totalCount !== void 0;
1063
+ const totalPages = Math.max(1, Math.ceil((totalCount ?? 0) / pageSize));
1064
+ const showPagination = page > 1 || isCountKnown && totalPages > 1;
1065
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col h-full overflow-hidden", children: [
1066
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-6 sm:gap-4 overflow-hidden px-5", children: [
1067
+ subtitle && /* @__PURE__ */ jsxs12(DialogDescription, { className: "flex flex-col gap-1 header-xl-medium-card text-text-secondary sm:px-4 font-ss02 ss05 leading-normal", children: [
1068
+ subtitle,
1069
+ !isSm && footnotes.length > 0 && /* @__PURE__ */ jsx12(Footnotes, { notes: footnotes })
1070
+ ] }),
1071
+ /* @__PURE__ */ jsx12("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx12(LeaderboardTable, { ...props }) })
1072
+ ] }),
1073
+ (footnotes.length > 0 || showPagination) && /* @__PURE__ */ jsxs12("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: [
1074
+ footnotes.length > 0 && /* @__PURE__ */ jsx12(Footnotes, { notes: footnotes }),
1075
+ showPagination && /* @__PURE__ */ jsx12(
1076
+ Pagination,
1077
+ {
1078
+ page,
1079
+ totalPages,
1080
+ isCountKnown,
1081
+ isSm,
1082
+ onPageChange
1083
+ }
1084
+ )
1085
+ ] })
1086
+ ] });
1087
+ }
1088
+ function StatRankingLeaderboardDialog(props) {
1089
+ const { open, onOpenChange, title, isSm } = props;
1090
+ if (isSm) {
1091
+ return /* @__PURE__ */ jsx12(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs12(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: [
1092
+ /* @__PURE__ */ jsx12(DialogHeader, { children: /* @__PURE__ */ jsx12(DialogTitle, { className: "header-xl-medium-card", children: title }) }),
1093
+ /* @__PURE__ */ jsx12(LeaderboardContent, { ...props })
1094
+ ] }) });
1095
+ }
1096
+ return /* @__PURE__ */ jsx12(
1097
+ MobileModalLayout,
1098
+ {
1099
+ onCancel: () => onOpenChange(false),
1100
+ isOpen: open,
1101
+ isSm,
1102
+ title,
1103
+ cancelButtonName: "Close",
1104
+ childClassName: "h-auto min-h-full h-[calc(100vh-100px)]",
1105
+ children: /* @__PURE__ */ jsx12("div", { className: "flex flex-col h-full pt-6", children: /* @__PURE__ */ jsx12(LeaderboardContent, { ...props }) })
1106
+ }
1107
+ );
1108
+ }
1109
+
1110
+ // src/team/team-season-stats-widget.tsx
1111
+ import {
1112
+ Button as Button3,
1113
+ Card as Card5,
1114
+ CardContent as CardContent5,
1115
+ CardHeader as CardHeader4,
1116
+ CardTitle as CardTitle4,
1117
+ IconLoader,
1118
+ Skeleton as Skeleton5,
1119
+ cn as cn11
1120
+ } from "@nukleus-sports/ui-web";
1121
+ import {
1122
+ computeTeamSeasonStatsFromSummary,
1123
+ formatStatRankByConfig,
1124
+ getTeamRankingConfigIds,
1125
+ getTeamStatColumns as getTeamStatColumns2,
1126
+ isSupportedTeamStatsSport as isSupportedTeamStatsSport2
1127
+ } from "@nukleus-sports/core";
1128
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1129
+ var PRESEASON_TYPE = 1;
1130
+ var RANK_TEXT_CLASS = "label-xs-medium text-text-secondary";
1131
+ var RANK_LINK_CLASS = `${RANK_TEXT_CLASS} hover:text-text-primary hover:underline cursor-pointer transition-colors`;
1132
+ function RankBadge({
1133
+ rankText,
1134
+ statLabel,
1135
+ configId,
1136
+ isRankingsError,
1137
+ onRankClick
1138
+ }) {
1139
+ if (isRankingsError) {
1140
+ return /* @__PURE__ */ jsxs13("span", { className: "label-xs-medium text-destructive", title: "Couldn't load ranking", children: [
1141
+ /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "--" }),
1142
+ /* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Couldn't load ranking" })
1143
+ ] });
1144
+ }
1145
+ if (!rankText) return null;
1146
+ if (!onRankClick) return /* @__PURE__ */ jsx13("span", { className: RANK_TEXT_CLASS, children: rankText });
1147
+ return /* @__PURE__ */ jsx13(
1148
+ Button3,
1149
+ {
1150
+ type: "button",
1151
+ variant: "unstyled",
1152
+ size: "none",
1153
+ "aria-label": `${rankText} in ${statLabel}: view leaderboard`,
1154
+ onClick: (event) => {
1155
+ event.stopPropagation();
1156
+ onRankClick(configId);
1157
+ },
1158
+ className: RANK_LINK_CLASS,
1159
+ children: rankText
1160
+ }
1161
+ );
1162
+ }
1163
+ function CenteredMessage({ children }) {
1164
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-full text-14.5 text-text-secondary", children });
1165
+ }
1166
+ function StatsBody({
1167
+ stats,
1168
+ sportId,
1169
+ rankings,
1170
+ configIds,
1171
+ showRanks,
1172
+ isSummaryError,
1173
+ isRankingsError,
1174
+ onRankClick
1175
+ }) {
1176
+ const columns = getTeamStatColumns2(sportId);
1177
+ return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-1.5 h-full w-full justify-center", children: [
1178
+ isSummaryError && /* @__PURE__ */ jsx13("p", { className: "text-12 text-destructive", children: "Couldn't refresh stats. Showing the last loaded data." }),
1179
+ /* @__PURE__ */ jsx13("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) => {
1180
+ const configId = configIds?.[index];
1181
+ return /* @__PURE__ */ jsx13(
1182
+ StatColumn,
1183
+ {
1184
+ label: column.label,
1185
+ value: stats.values[index],
1186
+ suffix: column.suffix,
1187
+ rankBadge: showRanks && configId !== void 0 ? /* @__PURE__ */ jsx13(
1188
+ RankBadge,
1189
+ {
1190
+ rankText: formatStatRankByConfig(rankings, configId),
1191
+ statLabel: column.label,
1192
+ configId,
1193
+ isRankingsError,
1194
+ onRankClick
1195
+ }
1196
+ ) : void 0
1197
+ },
1198
+ column.label
1199
+ );
1200
+ }) })
1201
+ ] });
1202
+ }
1203
+ function getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) {
1204
+ if (!isSupportedSport) return "Team season stats coming soon.";
1205
+ if (!hasSeason) return "Select a season to view stats.";
1206
+ return isSummaryError ? "Couldn't load season stats. Please try again." : "No season stats for the current season.";
1207
+ }
1208
+ function TeamSeasonStatsWidget({
1209
+ sportId,
1210
+ leagueId,
1211
+ seasons,
1212
+ seasonsLoading = false,
1213
+ summary,
1214
+ rankings,
1215
+ statsLoading = false,
1216
+ isSummaryError = false,
1217
+ isRankingsError = false,
1218
+ onRankClick,
1219
+ className
1220
+ }) {
1221
+ const isSupportedSport = sportId != null && isSupportedTeamStatsSport2(sportId);
1222
+ const hasSeason = Boolean(seasons?.selectedYear) && seasons?.selectedType != null;
1223
+ const stats = isSupportedSport && hasSeason ? computeTeamSeasonStatsFromSummary(summary, sportId) : null;
1224
+ const configIds = getTeamRankingConfigIds(sportId, leagueId);
1225
+ const showRanks = seasons?.selectedType !== PRESEASON_TYPE;
1226
+ if (seasonsLoading) {
1227
+ return /* @__PURE__ */ jsxs13(Card5, { className: cn11("border-0 p-4 h-[300px]", className), children: [
1228
+ /* @__PURE__ */ jsx13(CardHeader4, { className: "p-0 pb-4", children: /* @__PURE__ */ jsx13(CardTitle4, { className: "text-base font-medium", children: "Season Stats" }) }),
1229
+ /* @__PURE__ */ jsx13(CardContent5, { className: "p-0", children: /* @__PURE__ */ jsx13("div", { className: "space-y-3 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx13(IconLoader, {}) }) })
1230
+ ] });
1231
+ }
1232
+ let body;
1233
+ if (statsLoading) {
1234
+ body = /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx13(Skeleton5, { className: "h-4 w-3/4" }) });
1235
+ } else if (isSupportedSport && stats) {
1236
+ body = /* @__PURE__ */ jsx13(
1237
+ StatsBody,
1238
+ {
1239
+ stats,
1240
+ sportId,
1241
+ rankings: rankings ?? [],
1242
+ configIds,
1243
+ showRanks,
1244
+ isSummaryError,
1245
+ isRankingsError,
1246
+ onRankClick
1247
+ }
1248
+ );
1249
+ } else {
1250
+ body = /* @__PURE__ */ jsx13(CenteredMessage, { children: getEmptyMessage(isSupportedSport, hasSeason, isSummaryError) });
1251
+ }
1252
+ return /* @__PURE__ */ jsxs13(
1253
+ Card5,
1254
+ {
1255
+ className: cn11(
1256
+ "border-0 px-4 py-3 sm:p-4 flex flex-col gap-[25px] sm:gap-4 sm:h-[300px]",
1257
+ className
1258
+ ),
1259
+ children: [
1260
+ /* @__PURE__ */ jsx13(CardHeader4, { className: "p-0", children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-row items-center justify-between w-full h-8", children: [
1261
+ /* @__PURE__ */ jsx13(CardTitle4, { className: "header-xl-medium-card text-base text-text-primary", children: "Team Stats" }),
1262
+ isSupportedSport && seasons && seasons.years.length > 0 && /* @__PURE__ */ jsx13(SeasonSelector, { ...seasons, hideTypeOnMobile: true })
1263
+ ] }) }),
1264
+ /* @__PURE__ */ jsx13(CardContent5, { className: "p-0 h-auto sm:h-[220px] flex justify-center", children: body })
1265
+ ]
1266
+ }
1267
+ );
1268
+ }
1269
+
1270
+ // src/team/recent-games-widget.tsx
1271
+ import { useState as useState4 } from "react";
1272
+ import {
1273
+ Button as Button4,
1274
+ Card as Card6,
1275
+ CardContent as CardContent6,
1276
+ CardHeader as CardHeader5,
1277
+ CardTitle as CardTitle5,
1278
+ IconLoader as IconLoader2,
1279
+ cn as cn12
1280
+ } from "@nukleus-sports/ui-web";
1281
+ import { ArrowUpRightIcon } from "@nukleus-sports/icons";
1282
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
1283
+ var DATE_FORMAT = new Intl.DateTimeFormat("en-US", {
1284
+ weekday: "long",
1285
+ month: "long",
1286
+ day: "numeric",
1287
+ year: "numeric"
1288
+ });
1289
+ var MESSAGES = {
1290
+ "no-team": "No games available.",
1291
+ "team-error": "Couldn't load team info. Please try again.",
1292
+ "games-error": "Couldn't load games. Please try again."
1293
+ };
1294
+ function ResultText({ result }) {
1295
+ if (result.outcome === "none") return /* @__PURE__ */ jsx14("span", { className: "text-text-secondary text-14", children: "--" });
1296
+ if (result.outcome === "tie") {
1297
+ return /* @__PURE__ */ jsxs14("span", { className: "text-14 font-medium text-text-primary", children: [
1298
+ "T ",
1299
+ result.detail
1300
+ ] });
1301
+ }
1302
+ const isWin = result.outcome === "win";
1303
+ return /* @__PURE__ */ jsxs14("span", { className: "text-14 font-medium", children: [
1304
+ /* @__PURE__ */ jsx14(
1305
+ "span",
1306
+ {
1307
+ className: isWin ? "text-primary-color-nuk-text" : "text-semantic-color-status-priority-blocked-hot-copy",
1308
+ children: isWin ? "W" : "L"
1309
+ }
1310
+ ),
1311
+ /* @__PURE__ */ jsxs14("span", { className: "text-text-primary", children: [
1312
+ " ",
1313
+ result.detail
1314
+ ] })
1315
+ ] });
1316
+ }
1317
+ function OpponentLogo({ opponent, resolveImageUrl, defaultLogoUrl }) {
1318
+ const [failedUrl, setFailedUrl] = useState4(null);
1319
+ const { logo } = opponent;
1320
+ const resolved = logo ? logo.stored ? resolveImageUrl?.(logo.url) : logo.url : void 0;
1321
+ return /* @__PURE__ */ jsx14(
1322
+ "img",
1323
+ {
1324
+ src: resolved && resolved !== failedUrl ? resolved : defaultLogoUrl,
1325
+ alt: `${opponent.name} logo`,
1326
+ className: "h-8 w-8 rounded-full",
1327
+ loading: "lazy",
1328
+ onError: () => {
1329
+ if (resolved) setFailedUrl(resolved);
1330
+ }
1331
+ }
1332
+ );
1333
+ }
1334
+ function GameItem({ row, resolveImageUrl, defaultLogoUrl }) {
1335
+ return /* @__PURE__ */ jsxs14("div", { className: "border-b border-border last:border-0", children: [
1336
+ row.isFirstUpcoming && /* @__PURE__ */ jsx14("p", { className: "px-2 pt-2 text-12 font-medium uppercase tracking-wide text-text-secondary", children: "Upcoming" }),
1337
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col p-2 gap-[5px]", children: [
1338
+ /* @__PURE__ */ jsx14("p", { className: "text-14 font-normal text-text-secondary", children: DATE_FORMAT.format(new Date(row.gameDate)) }),
1339
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-3", children: [
1340
+ /* @__PURE__ */ jsx14("span", { className: "text-14 font-normal text-text-secondary shrink-0", children: row.isHome ? "vs " : "@ " }),
1341
+ /* @__PURE__ */ jsx14(
1342
+ OpponentLogo,
1343
+ {
1344
+ opponent: row.opponent,
1345
+ resolveImageUrl,
1346
+ defaultLogoUrl
1347
+ }
1348
+ ),
1349
+ /* @__PURE__ */ jsx14("span", { className: "text-14.5 font-normal text-text-primary truncate", children: row.opponent.name }),
1350
+ row.result && /* @__PURE__ */ jsxs14(Fragment3, { children: [
1351
+ /* @__PURE__ */ jsx14("span", { className: "text-14 text-text-secondary", children: "-" }),
1352
+ /* @__PURE__ */ jsx14(ResultText, { result: row.result })
1353
+ ] })
1354
+ ] }),
1355
+ row.time && /* @__PURE__ */ jsx14("p", { className: "text-14 font-normal text-text-secondary", children: row.time })
1356
+ ] })
1357
+ ] });
1358
+ }
1359
+ function Message({ children }) {
1360
+ return /* @__PURE__ */ jsx14("div", { className: "text-text-primary text-14.5 px-1", children });
1361
+ }
1362
+ function Body({
1363
+ status,
1364
+ rows,
1365
+ resolveImageUrl,
1366
+ defaultLogoUrl
1367
+ }) {
1368
+ if (status === "loading") {
1369
+ return /* @__PURE__ */ jsx14("div", { className: "space-y-4 flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx14(IconLoader2, {}) });
1370
+ }
1371
+ if (status !== "ready") return /* @__PURE__ */ jsx14(Message, { children: MESSAGES[status] });
1372
+ if (rows.length === 0) return /* @__PURE__ */ jsx14(Message, { children: "There are no games scheduled at this time." });
1373
+ return /* @__PURE__ */ jsx14("div", { className: "flex flex-col overflow-y-auto overflow-x-hidden gap-1", children: rows.map((row) => /* @__PURE__ */ jsx14(
1374
+ GameItem,
1375
+ {
1376
+ row,
1377
+ resolveImageUrl,
1378
+ defaultLogoUrl
1379
+ },
1380
+ row.id
1381
+ )) });
1382
+ }
1383
+ function RecentGamesWidget({
1384
+ status,
1385
+ rows,
1386
+ resolveImageUrl,
1387
+ defaultLogoUrl,
1388
+ onExpand,
1389
+ className
1390
+ }) {
1391
+ return /* @__PURE__ */ jsxs14(
1392
+ Card6,
1393
+ {
1394
+ className: cn12(
1395
+ "p-4 w-full xl:w-[420px] flex flex-col overflow-hidden border-none gap-3 h-full md:min-h-[612px]",
1396
+ className
1397
+ ),
1398
+ children: [
1399
+ /* @__PURE__ */ jsxs14(CardHeader5, { className: "flex flex-row items-center justify-between space-y-0 p-0", children: [
1400
+ /* @__PURE__ */ jsx14(CardTitle5, { children: "Recent Games" }),
1401
+ onExpand && /* @__PURE__ */ jsx14(
1402
+ Button4,
1403
+ {
1404
+ type: "button",
1405
+ variant: "ghost",
1406
+ size: "sm",
1407
+ "aria-label": "View full schedule",
1408
+ onClick: onExpand,
1409
+ className: "outline-1 background outline-offset-[-1px] outline-[hsl(var(--color-ui-elem-strokes))] outline h-[32px] w-[32px]",
1410
+ children: /* @__PURE__ */ jsx14(ArrowUpRightIcon, { className: "text-greys-icons h-5 w-5" })
1411
+ }
1412
+ )
1413
+ ] }),
1414
+ /* @__PURE__ */ jsx14(CardContent6, { className: "flex-1 flex flex-col overflow-hidden p-0", children: /* @__PURE__ */ jsx14(
1415
+ Body,
1416
+ {
1417
+ status,
1418
+ rows,
1419
+ resolveImageUrl,
1420
+ defaultLogoUrl
1421
+ }
1422
+ ) })
1423
+ ]
1424
+ }
1425
+ );
1426
+ }
1427
+ export {
1428
+ EmptyValue,
1429
+ FactField,
1430
+ FactPills,
1431
+ FieldLabel,
1432
+ RecentGamesWidget,
1433
+ SeasonSelector,
1434
+ StatColumn,
1435
+ StatRankingLeaderboardDialog,
1436
+ TeamFactsContent,
1437
+ TeamFactsWidget,
1438
+ TeamInfoCard,
1439
+ TeamSeasonScheduleSummaryPanel,
1440
+ TeamSeasonStatsSummaryPanel,
1441
+ TeamSeasonStatsWidget,
1442
+ TeamStaffTable,
1443
+ VenuePhoto
1444
+ };
1445
+ //# sourceMappingURL=team.js.map