@agg-build/ui 2.2.3 → 2.2.4

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.
@@ -7,18 +7,33 @@ type EventCategoryLike = {
7
7
  parentId?: string | null;
8
8
  } | null;
9
9
  };
10
- type FormatEventTitleWithDateSuffixParams = {
10
+ type ResolveEventHeadingParams = {
11
11
  title: string;
12
12
  categories?: readonly EventCategoryLike[] | null;
13
13
  structureType?: string | null;
14
14
  /**
15
- * Scheduled kickoff of the underlying game. Preferred over `endDate` for
16
- * the date suffix because `endDate` is the market close/expiration, which
17
- * can sit well after the game (e.g. Kalshi World Cup markets expire weeks
18
- * later — a June 22 game would otherwise read "- July 6").
15
+ * Scheduled kickoff/start of the underlying game. This is the only event
16
+ * date we currently trust as user-meaningful on list/tile surfaces.
19
17
  */
20
18
  gameStartTime?: string | null;
21
19
  endDate?: string | null;
20
+ venueMarkets?: readonly EventMarketLike[] | null;
22
21
  };
23
- export declare const formatEventTitleWithDateSuffix: ({ title, categories, structureType, gameStartTime, endDate, }: FormatEventTitleWithDateSuffixParams) => string;
22
+ type EventHeading = {
23
+ title: string;
24
+ timestampLabel: string | null;
25
+ };
26
+ type EventMarketLike = {
27
+ sportsMarketType?: string | null;
28
+ marketCategory?: string | null;
29
+ marketGroup?: string | null;
30
+ marketSubtype?: string | null;
31
+ period?: string | null;
32
+ lineValue?: number | null;
33
+ };
34
+ export declare const isSportEvent: (categories: readonly EventCategoryLike[] | null | undefined, structureType: string | null | undefined) => boolean;
35
+ export declare const shouldDisplaySportsEventTimestamp: ({ categories, structureType, venueMarkets, }: Pick<ResolveEventHeadingParams, "categories" | "structureType" | "venueMarkets">) => boolean;
36
+ export declare const resolveSportsEventTimestamp: ({ gameStartTime, endDate, }: Pick<ResolveEventHeadingParams, "gameStartTime" | "endDate">) => string | null;
37
+ export declare const resolveEventTimestampLabel: ({ categories, structureType, gameStartTime, endDate, venueMarkets, }: ResolveEventHeadingParams) => string | null;
38
+ export declare const resolveEventHeading: ({ title, categories, structureType, gameStartTime, endDate, venueMarkets, }: ResolveEventHeadingParams) => EventHeading;
24
39
  export {};
@@ -50,7 +50,7 @@ export declare const SPORTS_SECTION_TAB_DEFINITIONS: readonly [{
50
50
  readonly marketCategory: "shots";
51
51
  }, {
52
52
  readonly key: "other";
53
- readonly marketGroup: readonly ["other", "team_props", "player_props", "specials", "completion"];
53
+ readonly marketGroup: readonly ["other", "team_props", "specials", "completion"];
54
54
  }];
55
55
  export type SportsMarketCardVariant = "outcome" | "line" | "yes_no";
56
56
  export type SportsMarketDisplayGroup = {
@@ -114,6 +114,24 @@ export declare const resolveSportsSectionMarkets: ({ tabKey, eventMarkets, secti
114
114
  }) => VenueMarket[];
115
115
  export declare const resolveSportsMarketCardVariant: (market: VenueMarket) => SportsMarketCardVariant;
116
116
  export declare const isBinarySportsMoneylineMarket: (market: VenueMarket) => boolean;
117
+ export declare const isSpreadTeamTitle: (title: string | null | undefined) => boolean;
118
+ /**
119
+ * Resolve favored/dog team display names for a spread market's two outcomes,
120
+ * consistent across whichever venue anchors the ladder stop.
121
+ *
122
+ * A kalshi/limitless anchor stores `Yes`/`No` labels with no clean team title,
123
+ * so the pill would read "Yes +1.5". But the same signed line has cross-venue
124
+ * twins (identical `_sp_{fav}_{line}` aggKey) from poly/predict that DO carry the
125
+ * team name as the outcome title. Outcome index 0 is the favored side (covers
126
+ * the spread) on every venue keyed `_sp_{fav}`. So borrow the fullest clean
127
+ * title at each index. Returns `null` for a side when no twin has a team title
128
+ * (→ caller falls back to the raw `Yes`/`No` label). Null-aggKey spreads can't
129
+ * be matched to twins, so only the market's own titles are considered.
130
+ */
131
+ export declare const resolveSpreadOutcomeTeamNames: (activeMarket: VenueMarket, groupMarkets: VenueMarket[]) => {
132
+ favored: string | null;
133
+ dog: string | null;
134
+ };
117
135
  export declare const buildSportsMarketDisplayGroups: (markets: VenueMarket[]) => SportsMarketDisplayGroup[];
118
136
  export declare const groupSportsMarketsByPeriod: (markets: VenueMarket[]) => SportsPeriodGroup[];
119
137
  export type SportsGameLineSlideKind = "moneyline" | "spread" | "total" | "other";
@@ -50,7 +50,7 @@ export declare const SPORTS_SECTION_TAB_DEFINITIONS: readonly [{
50
50
  readonly marketCategory: "shots";
51
51
  }, {
52
52
  readonly key: "other";
53
- readonly marketGroup: readonly ["other", "team_props", "player_props", "specials", "completion"];
53
+ readonly marketGroup: readonly ["other", "team_props", "specials", "completion"];
54
54
  }];
55
55
  export type SportsMarketCardVariant = "outcome" | "line" | "yes_no";
56
56
  export type SportsMarketDisplayGroup = {
@@ -114,6 +114,24 @@ export declare const resolveSportsSectionMarkets: ({ tabKey, eventMarkets, secti
114
114
  }) => VenueMarket[];
115
115
  export declare const resolveSportsMarketCardVariant: (market: VenueMarket) => SportsMarketCardVariant;
116
116
  export declare const isBinarySportsMoneylineMarket: (market: VenueMarket) => boolean;
117
+ export declare const isSpreadTeamTitle: (title: string | null | undefined) => boolean;
118
+ /**
119
+ * Resolve favored/dog team display names for a spread market's two outcomes,
120
+ * consistent across whichever venue anchors the ladder stop.
121
+ *
122
+ * A kalshi/limitless anchor stores `Yes`/`No` labels with no clean team title,
123
+ * so the pill would read "Yes +1.5". But the same signed line has cross-venue
124
+ * twins (identical `_sp_{fav}_{line}` aggKey) from poly/predict that DO carry the
125
+ * team name as the outcome title. Outcome index 0 is the favored side (covers
126
+ * the spread) on every venue keyed `_sp_{fav}`. So borrow the fullest clean
127
+ * title at each index. Returns `null` for a side when no twin has a team title
128
+ * (→ caller falls back to the raw `Yes`/`No` label). Null-aggKey spreads can't
129
+ * be matched to twins, so only the market's own titles are considered.
130
+ */
131
+ export declare const resolveSpreadOutcomeTeamNames: (activeMarket: VenueMarket, groupMarkets: VenueMarket[]) => {
132
+ favored: string | null;
133
+ dog: string | null;
134
+ };
117
135
  export declare const buildSportsMarketDisplayGroups: (markets: VenueMarket[]) => SportsMarketDisplayGroup[];
118
136
  export declare const groupSportsMarketsByPeriod: (markets: VenueMarket[]) => SportsPeriodGroup[];
119
137
  export type SportsGameLineSlideKind = "moneyline" | "spread" | "total" | "other";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -100,8 +100,8 @@
100
100
  "liveline": "^0.0.7",
101
101
  "react": "^18.0.0 || ^19.0.0",
102
102
  "react-dom": "^18.0.0 || ^19.0.0",
103
- "@agg-build/hooks": "^2.2.1",
104
- "@agg-build/sdk": "^2.2.1"
103
+ "@agg-build/sdk": "^2.2.1",
104
+ "@agg-build/hooks": "^2.2.1"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",