@nukleus-sports/ui-patterns 0.5.0 → 0.6.2

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.d.cts CHANGED
@@ -268,4 +268,157 @@ interface RecentGamesWidgetProps {
268
268
  */
269
269
  declare function RecentGamesWidget({ status, rows, resolveImageUrl, defaultLogoUrl, onExpand, className, }: RecentGamesWidgetProps): react.JSX.Element;
270
270
 
271
- export { EmptyValue, FactField, type FactFieldProps, FactPills, type FactPillsProps, FieldLabel, type RecentGamesStatus, RecentGamesWidget, type RecentGamesWidgetProps, SeasonSelector, type SeasonSelectorProps, StatColumn, type StatColumnProps, type StatLeaderboardRow, StatRankingLeaderboardDialog, type StatRankingLeaderboardDialogProps, TeamFactsContent, type TeamFactsContentProps, TeamFactsWidget, type TeamFactsWidgetProps, TeamInfoCard, type TeamInfoCardProps, type TeamInfoCardSocialLink, type TeamInfoCardTeam, TeamSeasonScheduleSummaryPanel, type TeamSeasonScheduleSummaryPanelProps, type TeamSeasonStatsRanking, TeamSeasonStatsSummaryPanel, type TeamSeasonStatsSummaryPanelProps, TeamSeasonStatsWidget, type TeamSeasonStatsWidgetProps, type TeamStaffMember, TeamStaffTable, type TeamStaffTableProps, VenuePhoto, type VenuePhotoProps };
271
+ interface TeamStatGameDetails {
272
+ home_team_id?: number;
273
+ away_team_id?: number;
274
+ home_team_name?: string;
275
+ away_team_name?: string;
276
+ home_team_logo?: string;
277
+ away_team_logo?: string;
278
+ home_team_score?: number;
279
+ away_team_score?: number;
280
+ status_alt_details?: string;
281
+ date?: string;
282
+ }
283
+ interface TeamStatValue {
284
+ stat_id: number;
285
+ stat_value: number | string;
286
+ stat_type?: string;
287
+ }
288
+ interface TeamStatDetails {
289
+ game_details?: TeamStatGameDetails;
290
+ stats?: TeamStatValue[];
291
+ }
292
+ interface TeamStatRow {
293
+ team_id: number;
294
+ stat_details: TeamStatDetails | null;
295
+ }
296
+ interface TeamStatTypeDef {
297
+ id: number;
298
+ sport_id: number;
299
+ name: string;
300
+ label?: string;
301
+ type_source_name: string;
302
+ }
303
+ interface TeamStatsTableProps {
304
+ /** Already date-sorted and ready to render -- this table does no sorting of its own. */
305
+ stats: TeamStatRow[];
306
+ statsLoading?: boolean;
307
+ isStatsError?: boolean;
308
+ /**
309
+ * Need not already be scoped to `sportId` or filtered to one category -- this table does both,
310
+ * plus drops this sport's hidden ids.
311
+ */
312
+ statTypes: TeamStatTypeDef[];
313
+ isStatTypesError?: boolean;
314
+ sportId: number | null;
315
+ /** The team record this stats table belongs to failed to load -- distinct from still loading. */
316
+ isTeamError?: boolean;
317
+ /** Turns a stored opponent-logo path into a URL. */
318
+ resolveOpponentLogoUrl: (path: string) => string;
319
+ /** Shown for a game with no stored opponent logo, and when one fails to load. */
320
+ defaultLogoUrl: string;
321
+ seasons?: Omit<SeasonSelectorProps, "className" | "hideTypeOnMobile">;
322
+ /** Whole-card skeleton while the team's season list loads. */
323
+ seasonsLoading?: boolean;
324
+ isSeasonsError?: boolean;
325
+ /** At or above the app's `sm` breakpoint -- shows the opponent name and widens a few columns. */
326
+ isSm: boolean;
327
+ /** Below the app's own "small laptop" cutoff (~1226px) -- narrows the opponent column further. */
328
+ isSmallLaptop: boolean;
329
+ className?: string;
330
+ }
331
+ /**
332
+ * The Team page's Stats tab: a season's per-game stat lines, filtered to one offense/defense-style
333
+ * category, with per-sport hidden/ordered columns. Presentational; the caller owns all the data.
334
+ */
335
+ declare function TeamStatsTable({ stats, statsLoading, isStatsError, statTypes, isStatTypesError, sportId, isTeamError, resolveOpponentLogoUrl, defaultLogoUrl, seasons, seasonsLoading, isSeasonsError, isSm, isSmallLaptop, className, }: TeamStatsTableProps): react.JSX.Element;
336
+
337
+ /** The subset of an ESPN competitor's `team` payload this table reads. */
338
+ interface ScheduleEspnTeam {
339
+ id: string | number;
340
+ abbreviation: string;
341
+ displayName: string;
342
+ }
343
+ /** ESPN leader categories and featured athletes are matched by `name`. */
344
+ interface ScheduleEspnNamed {
345
+ name?: string;
346
+ }
347
+ interface ScheduleEspnAthlete {
348
+ displayName?: string;
349
+ lastName?: string;
350
+ saves?: string;
351
+ record?: string;
352
+ }
353
+ interface ScheduleEspnLeaderEntry extends ScheduleEspnNamed {
354
+ leaders?: {
355
+ displayValue?: string;
356
+ athlete?: ScheduleEspnAthlete;
357
+ }[];
358
+ }
359
+ interface ScheduleGameCompetitor {
360
+ id: string;
361
+ homeAway?: string;
362
+ team: ScheduleEspnTeam;
363
+ score?: {
364
+ value?: number;
365
+ displayValue?: string;
366
+ };
367
+ winner?: boolean;
368
+ record?: {
369
+ displayValue?: string;
370
+ }[];
371
+ leaders?: ScheduleEspnLeaderEntry[];
372
+ }
373
+ interface ScheduleGame {
374
+ id: number | string;
375
+ game_date: string;
376
+ /** Nullable in the DB: not every game has an ESPN payload yet. */
377
+ game_details: {
378
+ date: string;
379
+ timeValid: boolean;
380
+ competitions?: {
381
+ status?: {
382
+ type?: {
383
+ id?: string;
384
+ };
385
+ };
386
+ /** ESPN payloads can carry holes, so entries may be null. */
387
+ competitors?: (ScheduleGameCompetitor | null)[];
388
+ featuredAthletes?: (ScheduleEspnNamed & {
389
+ athlete?: ScheduleEspnAthlete;
390
+ })[];
391
+ }[];
392
+ } | null;
393
+ }
394
+ interface TeamScheduleTableProps {
395
+ games: ScheduleGame[];
396
+ gamesLoading?: boolean;
397
+ isGamesError?: boolean;
398
+ leagueId: number | null;
399
+ /** e.g. "NFL" -- drives the opponent logo's special-league/folder rule and column widths. */
400
+ leagueAbbreviation: string | null;
401
+ /** The team record this schedule belongs to failed to load -- distinct from still loading. */
402
+ isTeamError?: boolean;
403
+ teamEspnId: string | null;
404
+ /** Turns a league/NCAA folder name and an ESPN team id/abbreviation into a logo URL. */
405
+ resolveLogoUrl: (folderName: string, identifier: string | number) => string;
406
+ /** Shown when `resolveLogoUrl`'s image fails to load. */
407
+ defaultLogoUrl: string;
408
+ seasons?: Omit<SeasonSelectorProps, "className" | "hideTypeOnMobile">;
409
+ /** Whole-card loader while the team's season list loads. */
410
+ seasonsLoading?: boolean;
411
+ isSeasonsError?: boolean;
412
+ /** At or above the app's `sm` breakpoint -- shows the opponent name and widens a few columns. */
413
+ isSm: boolean;
414
+ /** Below the app's own "small laptop" cutoff (~1226px) -- narrows the opponent column further. */
415
+ isSmallLaptop: boolean;
416
+ className?: string;
417
+ }
418
+ /**
419
+ * The Team page's Schedule tab: a season's full game list with per-league leader columns, backed
420
+ * by the raw ESPN JSON each `season_games` row carries. Presentational; the caller owns all the data.
421
+ */
422
+ declare function TeamScheduleTable({ games, gamesLoading, isGamesError, leagueId, leagueAbbreviation, isTeamError, teamEspnId, resolveLogoUrl, defaultLogoUrl, seasons, seasonsLoading, isSeasonsError, isSm, isSmallLaptop, className, }: TeamScheduleTableProps): react.JSX.Element;
423
+
424
+ export { EmptyValue, FactField, type FactFieldProps, FactPills, type FactPillsProps, FieldLabel, type RecentGamesStatus, RecentGamesWidget, type RecentGamesWidgetProps, type ScheduleEspnTeam, type ScheduleGame, type ScheduleGameCompetitor, SeasonSelector, type SeasonSelectorProps, StatColumn, type StatColumnProps, type StatLeaderboardRow, StatRankingLeaderboardDialog, type StatRankingLeaderboardDialogProps, TeamFactsContent, type TeamFactsContentProps, TeamFactsWidget, type TeamFactsWidgetProps, TeamInfoCard, type TeamInfoCardProps, type TeamInfoCardSocialLink, type TeamInfoCardTeam, TeamScheduleTable, type TeamScheduleTableProps, TeamSeasonScheduleSummaryPanel, type TeamSeasonScheduleSummaryPanelProps, type TeamSeasonStatsRanking, TeamSeasonStatsSummaryPanel, type TeamSeasonStatsSummaryPanelProps, TeamSeasonStatsWidget, type TeamSeasonStatsWidgetProps, type TeamStaffMember, TeamStaffTable, type TeamStaffTableProps, type TeamStatDetails, type TeamStatGameDetails, type TeamStatRow, type TeamStatTypeDef, type TeamStatValue, TeamStatsTable, type TeamStatsTableProps, VenuePhoto, type VenuePhotoProps };
package/dist/team.d.ts CHANGED
@@ -268,4 +268,157 @@ interface RecentGamesWidgetProps {
268
268
  */
269
269
  declare function RecentGamesWidget({ status, rows, resolveImageUrl, defaultLogoUrl, onExpand, className, }: RecentGamesWidgetProps): react.JSX.Element;
270
270
 
271
- export { EmptyValue, FactField, type FactFieldProps, FactPills, type FactPillsProps, FieldLabel, type RecentGamesStatus, RecentGamesWidget, type RecentGamesWidgetProps, SeasonSelector, type SeasonSelectorProps, StatColumn, type StatColumnProps, type StatLeaderboardRow, StatRankingLeaderboardDialog, type StatRankingLeaderboardDialogProps, TeamFactsContent, type TeamFactsContentProps, TeamFactsWidget, type TeamFactsWidgetProps, TeamInfoCard, type TeamInfoCardProps, type TeamInfoCardSocialLink, type TeamInfoCardTeam, TeamSeasonScheduleSummaryPanel, type TeamSeasonScheduleSummaryPanelProps, type TeamSeasonStatsRanking, TeamSeasonStatsSummaryPanel, type TeamSeasonStatsSummaryPanelProps, TeamSeasonStatsWidget, type TeamSeasonStatsWidgetProps, type TeamStaffMember, TeamStaffTable, type TeamStaffTableProps, VenuePhoto, type VenuePhotoProps };
271
+ interface TeamStatGameDetails {
272
+ home_team_id?: number;
273
+ away_team_id?: number;
274
+ home_team_name?: string;
275
+ away_team_name?: string;
276
+ home_team_logo?: string;
277
+ away_team_logo?: string;
278
+ home_team_score?: number;
279
+ away_team_score?: number;
280
+ status_alt_details?: string;
281
+ date?: string;
282
+ }
283
+ interface TeamStatValue {
284
+ stat_id: number;
285
+ stat_value: number | string;
286
+ stat_type?: string;
287
+ }
288
+ interface TeamStatDetails {
289
+ game_details?: TeamStatGameDetails;
290
+ stats?: TeamStatValue[];
291
+ }
292
+ interface TeamStatRow {
293
+ team_id: number;
294
+ stat_details: TeamStatDetails | null;
295
+ }
296
+ interface TeamStatTypeDef {
297
+ id: number;
298
+ sport_id: number;
299
+ name: string;
300
+ label?: string;
301
+ type_source_name: string;
302
+ }
303
+ interface TeamStatsTableProps {
304
+ /** Already date-sorted and ready to render -- this table does no sorting of its own. */
305
+ stats: TeamStatRow[];
306
+ statsLoading?: boolean;
307
+ isStatsError?: boolean;
308
+ /**
309
+ * Need not already be scoped to `sportId` or filtered to one category -- this table does both,
310
+ * plus drops this sport's hidden ids.
311
+ */
312
+ statTypes: TeamStatTypeDef[];
313
+ isStatTypesError?: boolean;
314
+ sportId: number | null;
315
+ /** The team record this stats table belongs to failed to load -- distinct from still loading. */
316
+ isTeamError?: boolean;
317
+ /** Turns a stored opponent-logo path into a URL. */
318
+ resolveOpponentLogoUrl: (path: string) => string;
319
+ /** Shown for a game with no stored opponent logo, and when one fails to load. */
320
+ defaultLogoUrl: string;
321
+ seasons?: Omit<SeasonSelectorProps, "className" | "hideTypeOnMobile">;
322
+ /** Whole-card skeleton while the team's season list loads. */
323
+ seasonsLoading?: boolean;
324
+ isSeasonsError?: boolean;
325
+ /** At or above the app's `sm` breakpoint -- shows the opponent name and widens a few columns. */
326
+ isSm: boolean;
327
+ /** Below the app's own "small laptop" cutoff (~1226px) -- narrows the opponent column further. */
328
+ isSmallLaptop: boolean;
329
+ className?: string;
330
+ }
331
+ /**
332
+ * The Team page's Stats tab: a season's per-game stat lines, filtered to one offense/defense-style
333
+ * category, with per-sport hidden/ordered columns. Presentational; the caller owns all the data.
334
+ */
335
+ declare function TeamStatsTable({ stats, statsLoading, isStatsError, statTypes, isStatTypesError, sportId, isTeamError, resolveOpponentLogoUrl, defaultLogoUrl, seasons, seasonsLoading, isSeasonsError, isSm, isSmallLaptop, className, }: TeamStatsTableProps): react.JSX.Element;
336
+
337
+ /** The subset of an ESPN competitor's `team` payload this table reads. */
338
+ interface ScheduleEspnTeam {
339
+ id: string | number;
340
+ abbreviation: string;
341
+ displayName: string;
342
+ }
343
+ /** ESPN leader categories and featured athletes are matched by `name`. */
344
+ interface ScheduleEspnNamed {
345
+ name?: string;
346
+ }
347
+ interface ScheduleEspnAthlete {
348
+ displayName?: string;
349
+ lastName?: string;
350
+ saves?: string;
351
+ record?: string;
352
+ }
353
+ interface ScheduleEspnLeaderEntry extends ScheduleEspnNamed {
354
+ leaders?: {
355
+ displayValue?: string;
356
+ athlete?: ScheduleEspnAthlete;
357
+ }[];
358
+ }
359
+ interface ScheduleGameCompetitor {
360
+ id: string;
361
+ homeAway?: string;
362
+ team: ScheduleEspnTeam;
363
+ score?: {
364
+ value?: number;
365
+ displayValue?: string;
366
+ };
367
+ winner?: boolean;
368
+ record?: {
369
+ displayValue?: string;
370
+ }[];
371
+ leaders?: ScheduleEspnLeaderEntry[];
372
+ }
373
+ interface ScheduleGame {
374
+ id: number | string;
375
+ game_date: string;
376
+ /** Nullable in the DB: not every game has an ESPN payload yet. */
377
+ game_details: {
378
+ date: string;
379
+ timeValid: boolean;
380
+ competitions?: {
381
+ status?: {
382
+ type?: {
383
+ id?: string;
384
+ };
385
+ };
386
+ /** ESPN payloads can carry holes, so entries may be null. */
387
+ competitors?: (ScheduleGameCompetitor | null)[];
388
+ featuredAthletes?: (ScheduleEspnNamed & {
389
+ athlete?: ScheduleEspnAthlete;
390
+ })[];
391
+ }[];
392
+ } | null;
393
+ }
394
+ interface TeamScheduleTableProps {
395
+ games: ScheduleGame[];
396
+ gamesLoading?: boolean;
397
+ isGamesError?: boolean;
398
+ leagueId: number | null;
399
+ /** e.g. "NFL" -- drives the opponent logo's special-league/folder rule and column widths. */
400
+ leagueAbbreviation: string | null;
401
+ /** The team record this schedule belongs to failed to load -- distinct from still loading. */
402
+ isTeamError?: boolean;
403
+ teamEspnId: string | null;
404
+ /** Turns a league/NCAA folder name and an ESPN team id/abbreviation into a logo URL. */
405
+ resolveLogoUrl: (folderName: string, identifier: string | number) => string;
406
+ /** Shown when `resolveLogoUrl`'s image fails to load. */
407
+ defaultLogoUrl: string;
408
+ seasons?: Omit<SeasonSelectorProps, "className" | "hideTypeOnMobile">;
409
+ /** Whole-card loader while the team's season list loads. */
410
+ seasonsLoading?: boolean;
411
+ isSeasonsError?: boolean;
412
+ /** At or above the app's `sm` breakpoint -- shows the opponent name and widens a few columns. */
413
+ isSm: boolean;
414
+ /** Below the app's own "small laptop" cutoff (~1226px) -- narrows the opponent column further. */
415
+ isSmallLaptop: boolean;
416
+ className?: string;
417
+ }
418
+ /**
419
+ * The Team page's Schedule tab: a season's full game list with per-league leader columns, backed
420
+ * by the raw ESPN JSON each `season_games` row carries. Presentational; the caller owns all the data.
421
+ */
422
+ declare function TeamScheduleTable({ games, gamesLoading, isGamesError, leagueId, leagueAbbreviation, isTeamError, teamEspnId, resolveLogoUrl, defaultLogoUrl, seasons, seasonsLoading, isSeasonsError, isSm, isSmallLaptop, className, }: TeamScheduleTableProps): react.JSX.Element;
423
+
424
+ export { EmptyValue, FactField, type FactFieldProps, FactPills, type FactPillsProps, FieldLabel, type RecentGamesStatus, RecentGamesWidget, type RecentGamesWidgetProps, type ScheduleEspnTeam, type ScheduleGame, type ScheduleGameCompetitor, SeasonSelector, type SeasonSelectorProps, StatColumn, type StatColumnProps, type StatLeaderboardRow, StatRankingLeaderboardDialog, type StatRankingLeaderboardDialogProps, TeamFactsContent, type TeamFactsContentProps, TeamFactsWidget, type TeamFactsWidgetProps, TeamInfoCard, type TeamInfoCardProps, type TeamInfoCardSocialLink, type TeamInfoCardTeam, TeamScheduleTable, type TeamScheduleTableProps, TeamSeasonScheduleSummaryPanel, type TeamSeasonScheduleSummaryPanelProps, type TeamSeasonStatsRanking, TeamSeasonStatsSummaryPanel, type TeamSeasonStatsSummaryPanelProps, TeamSeasonStatsWidget, type TeamSeasonStatsWidgetProps, type TeamStaffMember, TeamStaffTable, type TeamStaffTableProps, type TeamStatDetails, type TeamStatGameDetails, type TeamStatRow, type TeamStatTypeDef, type TeamStatValue, TeamStatsTable, type TeamStatsTableProps, VenuePhoto, type VenuePhotoProps };