@simple-parlay/components 1.30.6-pre → 1.30.6-pre.10

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.
Files changed (121) hide show
  1. package/dist/index.cjs +1 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +448 -432
  4. package/dist/react/components/CallGameCatalogue.d.ts +4 -0
  5. package/dist/react/components/CallPayoutTable.d.ts +6 -0
  6. package/dist/react/components/CallTicketBuilder.d.ts +3 -0
  7. package/dist/react/components/CorrelationChoicesSkeleton.d.ts +4 -0
  8. package/dist/react/components/CorrelationPricingDebug.d.ts +2 -0
  9. package/dist/react/components/CorrelationPropPlaceholder.d.ts +13 -0
  10. package/dist/react/components/DenseGameCatalogue.d.ts +2 -0
  11. package/dist/react/components/DenseUi.d.ts +30 -0
  12. package/dist/react/components/EntriesPage.d.ts +0 -4
  13. package/dist/react/components/EntrySubmission.d.ts +1 -1
  14. package/dist/react/components/GameModeCard.d.ts +33 -6
  15. package/dist/react/components/GamePage.d.ts +3 -1
  16. package/dist/react/components/GameSelector.d.ts +9 -1
  17. package/dist/react/components/GameSetupPage.d.ts +6 -2
  18. package/dist/react/components/GameShelfCatalogue.d.ts +2 -0
  19. package/dist/react/components/GameShowcaseCatalogue.d.ts +9 -0
  20. package/dist/react/components/GameVariantCatalogue.d.ts +6 -0
  21. package/dist/react/components/HowToPlayButton.d.ts +3 -1
  22. package/dist/react/components/MatchRail.d.ts +30 -0
  23. package/dist/react/components/MultiLegTable.d.ts +3 -1
  24. package/dist/react/components/PageBackButton.d.ts +8 -0
  25. package/dist/react/components/PlaceEntryProvider.d.ts +43 -5
  26. package/dist/react/components/PlaybookChooser.d.ts +7 -0
  27. package/dist/react/components/PropositionFilters.d.ts +3 -1
  28. package/dist/react/components/QuickPickButton.d.ts +3 -1
  29. package/dist/react/components/ScrollShelf.d.ts +5 -1
  30. package/dist/react/components/SelectionReview.d.ts +1 -1
  31. package/dist/react/components/SportRail.d.ts +13 -7
  32. package/dist/react/components/SportSelector.d.ts +16 -3
  33. package/dist/react/components/_primitives/index.d.ts +7 -1
  34. package/dist/react/index.cjs +1 -0
  35. package/dist/react/index.d.ts +36 -17
  36. package/dist/react/index.mjs +448 -432
  37. package/dist/react/utils/dom.d.ts +7 -0
  38. package/dist/react/utils/index.d.ts +1 -1
  39. package/dist/react-native/components/CallGameCatalogue.d.ts +16 -0
  40. package/dist/react-native/components/CallPayoutTable.d.ts +6 -0
  41. package/dist/react-native/components/CallTicketBuilder.d.ts +33 -0
  42. package/dist/react-native/components/CorrelationChoicesSkeleton.d.ts +3 -0
  43. package/dist/react-native/components/CorrelationPricingDebug.d.ts +2 -0
  44. package/dist/react-native/components/CorrelationPropPlaceholder.d.ts +7 -0
  45. package/dist/react-native/components/DenseGameCatalogue.d.ts +2 -0
  46. package/dist/react-native/components/DenseUi.d.ts +59 -0
  47. package/dist/react-native/components/EntrySubmission.d.ts +1 -1
  48. package/dist/react-native/components/GameModeCard.d.ts +32 -5
  49. package/dist/react-native/components/GamePage.d.ts +4 -1
  50. package/dist/react-native/components/GameSelector.d.ts +9 -1
  51. package/dist/react-native/components/GameSetupPage.d.ts +5 -14
  52. package/dist/react-native/components/GameShelfCatalogue.d.ts +7 -0
  53. package/dist/react-native/components/HowToPlayButton.d.ts +3 -1
  54. package/dist/react-native/components/LoadingIndicators.d.ts +1 -1
  55. package/dist/react-native/components/MatchRail.d.ts +36 -0
  56. package/dist/react-native/components/MultiLegTable.d.ts +3 -1
  57. package/dist/react-native/components/PageBackButton.d.ts +7 -0
  58. package/dist/react-native/components/PlaceEntryProvider.d.ts +36 -5
  59. package/dist/react-native/components/PlaybookChooser.d.ts +7 -0
  60. package/dist/react-native/components/PropositionFilters.d.ts +3 -1
  61. package/dist/react-native/components/QuickPickButton.d.ts +3 -1
  62. package/dist/react-native/components/ScrollShelf.d.ts +8 -1
  63. package/dist/react-native/components/SelectionReview.d.ts +1 -1
  64. package/dist/react-native/components/SportRail.d.ts +13 -7
  65. package/dist/react-native/components/SportSelector.d.ts +8 -3
  66. package/dist/react-native/components/_primitives/index.d.ts +10 -2
  67. package/dist/react-native/index.cjs +1 -0
  68. package/dist/react-native/index.d.ts +36 -17
  69. package/dist/react-native/index.mjs +438 -437
  70. package/dist/react-native/utils/index.d.ts +1 -1
  71. package/dist/shared/api-client.d.ts +4 -3
  72. package/dist/shared/call-presentation.d.ts +20 -0
  73. package/dist/shared/correlation-steering.d.ts +49 -0
  74. package/dist/shared/date-filters.d.ts +5 -4
  75. package/dist/shared/dense-ui.d.ts +54 -0
  76. package/dist/shared/game-artwork.d.ts +61 -0
  77. package/dist/shared/game-flow.d.ts +14 -1
  78. package/dist/shared/game-icons.d.ts +6 -3
  79. package/dist/shared/game-library.d.ts +58 -0
  80. package/dist/shared/game-set-bet.d.ts +0 -1
  81. package/dist/shared/game-shelf-artwork.d.ts +3 -0
  82. package/dist/shared/game-shelf-presentation.d.ts +43 -0
  83. package/dist/shared/game-variants.d.ts +5 -0
  84. package/dist/shared/hooks.d.ts +8 -8
  85. package/dist/shared/how-to-play-html.d.ts +1 -1
  86. package/dist/shared/how-to-play-logo.d.ts +1 -1
  87. package/dist/shared/menu-placement.d.ts +26 -0
  88. package/dist/shared/mirror.d.ts +55 -5
  89. package/dist/shared/picker-brand.d.ts +22 -6
  90. package/dist/shared/playbook.d.ts +29 -0
  91. package/dist/shared/selection-actions.d.ts +15 -4
  92. package/dist/shared/selection-caps.d.ts +68 -0
  93. package/dist/shared/selection-variants.d.ts +5 -1
  94. package/dist/shared/swipe-deck.d.ts +1 -1
  95. package/dist/shared/themes.d.ts +22 -0
  96. package/dist/shared/types.d.ts +43 -2
  97. package/dist/shared/ui-system.d.ts +69 -0
  98. package/dist/shared/ui-variant.d.ts +16 -0
  99. package/dist/shared/use-call-payouts.d.ts +8 -0
  100. package/dist/shared/utils.d.ts +18 -7
  101. package/package.json +7 -8
  102. package/dist/index.js +0 -1
  103. package/dist/react/components/GameSetBetPage.d.ts +0 -21
  104. package/dist/react/components/LadderPage.d.ts +0 -21
  105. package/dist/react/components/MirrorPage.d.ts +0 -21
  106. package/dist/react/components/PerfectPickPage.d.ts +0 -22
  107. package/dist/react/components/PickYourDividendPage.d.ts +0 -21
  108. package/dist/react/components/RuleSetupPage.d.ts +0 -27
  109. package/dist/react/components/SafetyNetPage.d.ts +0 -16
  110. package/dist/react/components/SixAgainPage.d.ts +0 -16
  111. package/dist/react/index.js +0 -1
  112. package/dist/react/utils/design.d.ts +0 -55
  113. package/dist/react-native/components/GameSetBetPage.d.ts +0 -19
  114. package/dist/react-native/components/LadderPage.d.ts +0 -19
  115. package/dist/react-native/components/MirrorPage.d.ts +0 -19
  116. package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
  117. package/dist/react-native/components/PickYourDividendPage.d.ts +0 -19
  118. package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
  119. package/dist/react-native/components/SafetyNetPage.d.ts +0 -14
  120. package/dist/react-native/components/SixAgainPage.d.ts +0 -14
  121. package/dist/react-native/index.js +0 -1
@@ -13,11 +13,13 @@ import { Game } from './types';
13
13
  * Pricing (suite-standard 21.875% margin): the prize budget is the stake less
14
14
  * the margin, split equally across the two winning outcomes, so each side pays
15
15
  * prize = stake × (1 − margin) × 2^(N−1)
16
- * quoted EXACT — no rounding. Each extra leg exactly doubles the prize and the
17
- * margin holds flat at every leg count (RTP 78.125%).
16
+ * quoted in whole dollars — a dividend is advertised as $1,333, never
17
+ * $1,333.33. Each extra leg doubles the prize and the margin holds flat at
18
+ * every leg count (RTP 78.125%, within the cent the rounding moves).
18
19
  */
19
20
  /** Suite-standard operator margin for Mirror Standard. */
20
21
  export declare const MIRROR_STANDARD_MARGIN = 0.21875;
22
+ export declare function resolveMirrorMargin(stored: number | null | undefined): number;
21
23
  /** A live prize quote for a stake/legs combination. */
22
24
  export interface MirrorPrize {
23
25
  legs: number;
@@ -34,7 +36,7 @@ export interface MirrorPrize {
34
36
  oddsOneIn: number;
35
37
  }
36
38
  export interface MirrorConfig {
37
- /** Selectable leg counts, smallest first (official range 4–12). */
39
+ variant: MirrorVariant;
38
40
  legOptions: number[];
39
41
  /** Leg count preselected on entry. */
40
42
  defaultLegs: number;
@@ -49,10 +51,18 @@ export interface MirrorConfig {
49
51
  operatorMargin: number;
50
52
  perLegProbability: number;
51
53
  }
52
- /** Whether a game is a Mirror (routes to the one-screen Straight Mirror builder). */
54
+ /**
55
+ * The server rule behind each mirror. They are separate games in the catalogue,
56
+ * not a switch inside one — each carries its own tier, pricing and settlement,
57
+ * so the rule on the game is what says which mirror the player opened.
58
+ */
59
+ export declare const MIRROR_RULES: Record<MirrorVariantId, string>;
60
+ /** Whether a game is any of the mirrors (all route to the one-screen builder). */
53
61
  export declare function isMirrorGame(game: Game | null | undefined): boolean;
62
+ /** Which mirror this game is. Unknown rules fall back to the straight one. */
63
+ export declare function resolveMirrorVariantId(game: Game | null | undefined): MirrorVariantId;
54
64
  /**
55
- * Price a Mirror ticket: what each winning side pays, exact to the cent.
65
+ * Price a Mirror ticket: what each winning side pays, to the dollar.
56
66
  *
57
67
  * The prize is fixed at the fair 50/50 price — stake × (1 − margin) × 2^(N−1) —
58
68
  * so it is independent of `perLegProbability`; a skewed leg probability only
@@ -72,6 +82,8 @@ export interface MirrorVariant {
72
82
  minLegs: number;
73
83
  waysToWin: string;
74
84
  description: string;
85
+ /** One-line hook under the lockup on this mirror's setup page. */
86
+ tagline: string;
75
87
  tierNames: string[];
76
88
  }
77
89
  export declare const MIRROR_VARIANTS: MirrorVariant[];
@@ -96,4 +108,42 @@ export declare function mirrorCombinations(n: number, k: number): number;
96
108
  export declare function mirrorSuitePrize(variantId: MirrorVariantId, stake: number, legs: number, opts?: {
97
109
  operatorMargin?: number;
98
110
  }): MirrorSuitePrize;
111
+ /** Marks on a prize row: a call landed, a call missed. */
112
+ export declare const MIRROR_TICK = "\u2713";
113
+ export declare const MIRROR_CROSS = "\u2715";
114
+ /** One payable outcome: the two sweeps are two rows, not one "12 or 0" row. */
115
+ export interface MirrorPrizeRow {
116
+ /** Correct calls this row pays on — also how many ticks the row shows. */
117
+ correct: number;
118
+ label: string;
119
+ prize: number;
120
+ }
121
+ /**
122
+ * Flatten the tiers into one row per winning outcome. A tier reaching both
123
+ * edges pays twice, and quoting it as "12 or 0 of 12" reads as one way to win
124
+ * with strange wording — so each edge gets its own row and its own price.
125
+ */
126
+ export declare function mirrorPrizeRows(quote: MirrorSuitePrize): MirrorPrizeRow[];
127
+ /** A mirror in the catalogue, paired with the variant its rule names. */
128
+ export interface MirrorVariantGame {
129
+ variant: MirrorVariant;
130
+ game: Game;
131
+ }
132
+ /**
133
+ * The mirrors a player can switch between from `current`, straight first.
134
+ *
135
+ * The base mirror is the Straight Mirror and nothing else: on Signature it is
136
+ * one game with no depth to choose. The set of three lives on Premier, so only
137
+ * a Premier mirror offers the switch, and only to the mirrors sharing its tier.
138
+ * They are separate games, so the page can only offer what the catalogue
139
+ * carries — one mirror at that tier means no choice to make.
140
+ */
141
+ export declare function mirrorVariantGames(games: Game[], current: Game | null | undefined): MirrorVariantGame[];
142
+ /**
143
+ * The catalogue as the games menu should show it. A tier carrying a full
144
+ * mirror set lists one tile — the straight mirror, the set's front door —
145
+ * because its page is where the deeper two are chosen. A deeper mirror with no
146
+ * straight mirror beside it keeps its own tile, or there would be no way in.
147
+ */
148
+ export declare function collapseMirrorSet(games: Game[]): Game[];
99
149
  export declare function mirrorVariantLegOptions(config: MirrorConfig, variantId: MirrorVariantId): number[];
@@ -2,18 +2,34 @@ export declare const PICKER_BRAND: {
2
2
  readonly stone: "#DDD9D2";
3
3
  readonly teal: "#0F4C5C";
4
4
  readonly citron: "#DFFF1A";
5
+ readonly tealMid: "#4B7985";
6
+ readonly tealSoft: "#7B9DA5";
5
7
  };
6
8
  export declare const SPORT_SHORT_CODES: Record<string, string>;
9
+ /**
10
+ * What a league's acronym stands for. The sport track rides on short codes and
11
+ * swaps in the full names once it is wide enough to hold them, so the leagues
12
+ * whose display name *is* the acronym need a longer one to open into.
13
+ */
14
+ export declare const SPORT_LONG_NAMES: Record<string, string>;
15
+ export declare function getSportLongName(sport: string, fallback: string): string;
16
+ /**
17
+ * The pair of labels one sport track segment rides on: the code it shows at
18
+ * rest and the name it opens out to. `shown` is whatever the flow calls the
19
+ * sport — a host override, the API's label, or the derived name.
20
+ *
21
+ * A `shown` that is already an acronym *is* the code (deriving one from the raw
22
+ * key gave AFLW the code "RUG"), and a sport whose name is only its acronym
23
+ * opens out to the long form, if there is one to open into.
24
+ */
25
+ export declare function sportTrackLabels(sport: string, shown: string, sportBaseKey?: string | null): {
26
+ code: string;
27
+ name: string;
28
+ };
7
29
  export declare function getCategoryTagline(category: string): string;
8
30
  export declare function getSportShortCode(sport: string, sportBaseKey?: string | null, override?: string): string;
9
31
  export declare function getSportPickerTagline(count: number, selectedCategory?: string | null): string;
10
32
  export declare function getSportSummaryTagline(gamesToday: number, activeProps: number): string;
11
- /**
12
- * The one-line caption on a sport rail card. A rail card is ~92px wide, so the
13
- * two-part `getSportSummaryTagline` never fits — lead with today's fixtures
14
- * when there are any, and fall back to the pick count when there aren't.
15
- */
16
- export declare function getSportRailCaption(gamesToday: number, activeProps: number): string;
17
33
  export declare function gameLogoTileFontSize(code: string): number;
18
34
  export interface ComingSoonSport {
19
35
  key: string;
@@ -0,0 +1,29 @@
1
+ import { Game, TopPayoutsResponse } from './types';
2
+ import { GameTierId } from './game-tiers';
3
+ /**
4
+ * Playbook chooser: one featured hero above a comparison grid. The copy and
5
+ * numbers here are shared by the web and native twins so both read the same.
6
+ */
7
+ /** "Perfect Pick 8" → "Perfect Pick" when the count is chosen on the card. */
8
+ export declare function playbookName(game: Game): string;
9
+ /** The mechanic in one line — the Call catalogue's copy, with the set-card games told apart. */
10
+ export declare function playbookMechanic(game: Game): string;
11
+ export interface PlaybookHook {
12
+ amount: number;
13
+ count: number;
14
+ stake: number;
15
+ }
16
+ /** The payout hook: the dividend at the game's default count and the default stake. */
17
+ export declare function playbookHook(game: Game, payouts?: TopPayoutsResponse, stake?: number): PlaybookHook | null;
18
+ export declare function playbookTier(game: Game): {
19
+ id: GameTierId;
20
+ label: string;
21
+ };
22
+ export type PlaybookTierFilter = GameTierId | 'all';
23
+ /** Tier segments with counts; empty when every game sits in one tier. */
24
+ export declare function playbookTierTabs(games: readonly Game[]): {
25
+ id: PlaybookTierFilter;
26
+ label: string;
27
+ count: number;
28
+ }[];
29
+ export declare function playbookFilter(games: readonly Game[], tier: PlaybookTierFilter): Game[];
@@ -1,8 +1,16 @@
1
- import { TopPayoutsResponse } from './types';
1
+ import { Game, TopPayoutsResponse } from './types';
2
2
  /** Copy for the live slip docked under the selection list. */
3
3
  export declare const SLIP_EMPTY_HINT = "Tap Yes or No to start building your multi.";
4
4
  export declare const SLIP_STAKE_LABEL = "Your stake";
5
5
  export declare const SLIP_DIVIDEND_LABEL = "Potential dividend";
6
+ export declare const SLIP_LEG_HINT = "Tap a leg to read it.";
7
+ export declare const SLIP_LEG_REMOVE = "Remove";
8
+ export declare const SLIP_CLEAR = "Clear bet";
9
+ export declare const SPORT_LOCKED_HINT = "One sport per bet.";
10
+ export declare const VIEW_LIST_GLYPH = "\u2630";
11
+ export declare const VIEW_SWIPE_GLYPH = "\u21C6";
12
+ export declare const VIEW_LIST_LABEL = "List";
13
+ export declare const VIEW_SWIPE_LABEL = "Swipe";
6
14
  export interface LiveSlipLeg {
7
15
  id: number;
8
16
  /** 1-based position in the multi — the number printed on the tile. */
@@ -44,7 +52,10 @@ export declare function buildLiveSlip({ selections, order, minReq, maxReq, stake
44
52
  export declare function mergePickOrder(prev: number[], selections: Record<number, 'yes' | 'no'>): number[];
45
53
  /**
46
54
  * Dividend for a leg count, normalised to a $20 bet. Reads the game's own
47
- * `/max-payout` table, so it prices every game — not just the range ones the
48
- * overload callout covers.
55
+ * `/max-payout` table
49
56
  */
50
- export declare function payout20AtCount(payouts: TopPayoutsResponse | undefined, count: number): number;
57
+ export declare function payout20AtCount(payouts: TopPayoutsResponse | undefined, count: number, opts?: {
58
+ game?: Game | null;
59
+ expectedCorrect?: number;
60
+ stake?: number;
61
+ }): number;
@@ -0,0 +1,68 @@
1
+ import { Game, Proposition } from './types';
2
+ /**
3
+ * Which games ration the slots at all.
4
+ *
5
+ * Only Cross Game SGM: it is the product that invites several legs off one
6
+ * fixture, so it is the only one that has to hold them to one apiece. Same
7
+ * Game is already confined to a single fixture and priced for it, and every
8
+ * other game leaves the slots alone — nothing greyed, no slot chips drawn.
9
+ *
10
+ * No game means no caps, so a caller that forgets to pass one shows no
11
+ * limitation rather than an unexplained one.
12
+ */
13
+ export declare function selectionCapsApply(game?: Game | null): boolean;
14
+ export type MarketFamily = 'totals' | 'spread' | 'player';
15
+ export declare const MARKET_FAMILIES: MarketFamily[];
16
+ export declare const MARKET_CAPS: Record<MarketFamily, number>;
17
+ export declare function marketCaps(game?: Game | null): Record<MarketFamily, number>;
18
+ /** Slot names, as they read on a fixture header. */
19
+ export declare const MARKET_FAMILY_LABEL: Record<MarketFamily, string>;
20
+ /** How the market filter names each family — plural, since it picks many. */
21
+ export declare const MARKET_FAMILY_FILTER_LABEL: Record<MarketFamily, string>;
22
+ /** A raw feed market type as a filter chip reads it: `player_first_try` → "Player First Try". */
23
+ export declare function formatMarketTypeLabel(marketType: string): string;
24
+ export declare function slotTooltip(family: MarketFamily, filled: boolean): string;
25
+ /** Why a greyed row won't answer. */
26
+ export declare function capReason(family: MarketFamily): string;
27
+ /**
28
+ * Which slot a proposition spends, or null when it spends none.
29
+ *
30
+ * Market type first — it is the only field the feed guarantees a shape for —
31
+ * and the description second, for the markets whose type is a product name
32
+ * rather than a market key.
33
+ */
34
+ export declare function marketFamily(prop: Proposition): MarketFamily | null;
35
+ /**
36
+ * Every slot a proposition spends. A composite spends one per leg: "the total
37
+ * is over AND Hawthorn covers" is a total and a line bought together, so it
38
+ * blocks — and is blocked by — the singles that spend the same slots.
39
+ */
40
+ export declare function marketFamilies(prop: Proposition, componentById?: ReadonlyMap<number, Proposition> | null): MarketFamily[];
41
+ /**
42
+ * The fixture a proposition belongs to. Event id when the feed has one, the
43
+ * matchup otherwise; null when neither, which leaves the prop uncapped — with
44
+ * no fixture to count against there is no slot to spend.
45
+ */
46
+ export declare function capFixtureKey(prop: Proposition): string | null;
47
+ export interface SelectionCaps {
48
+ /** True when this prop's slot is already spent by a different pick in its fixture. */
49
+ isCapped: (prop: Proposition) => boolean;
50
+ /** Families already spent in a fixture — for the slot chips on its header. */
51
+ filledFor: (key: string | null) => ReadonlySet<MarketFamily>;
52
+ slotsFor: (key: string | null) => {
53
+ family: MarketFamily;
54
+ label: string;
55
+ filled: boolean;
56
+ }[];
57
+ }
58
+ /**
59
+ * Read the picks so far as spent slots. Everything the UI needs to grey a row
60
+ * or tick a chip comes off the returned object, so web and native ask the same
61
+ * question and get the same answer.
62
+ */
63
+ export declare function buildSelectionCaps(propositions: readonly Proposition[], selections: Record<number, 'yes' | 'no'>, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null): SelectionCaps;
64
+ /**
65
+ * Quick pick's pool, thinned to what a player could have picked by hand — one
66
+ * slot per family per fixture, in the order it is handed (already shuffled).
67
+ */
68
+ export declare function takeWithinCaps(pool: readonly Proposition[], count: number, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null): Proposition[];
@@ -8,7 +8,7 @@ import { Proposition } from './types';
8
8
  * the default list draws, so date/market filters, composites, jerseys and the
9
9
  * leg cap behave identically whichever one is on screen.
10
10
  */
11
- export type SelectionVariant = 'split' | 'split-inline' | 'compact';
11
+ export type SelectionVariant = 'split' | 'split-inline' | 'call' | 'shelf' | 'playboard' | 'matchbook' | 'game-deck' | 'compact';
12
12
  export declare const SELECTION_VARIANTS: SelectionVariant[];
13
13
  /** One fixture (or race) and every question asked about it. */
14
14
  export interface SelectionEvent {
@@ -38,6 +38,10 @@ export declare function formatFixtureTime(date: Date): string;
38
38
  * Australian club name (`South Sydney Rabbitohs` → `RAB`).
39
39
  */
40
40
  export declare function teamCode(team: string | null | undefined): string;
41
+ /** `HAW v ADE` — a chip-sized fixture label; races and team-less groups keep their title. */
42
+ export declare function fixtureShortLabel(event: SelectionEvent): string;
43
+ /** Both teams in full — the selected match chip, when the rail has room. */
44
+ export declare function fixtureFullLabel(event: SelectionEvent): string;
41
45
  /**
42
46
  * Fixtures in kick-off order, split into day blocks; undated ones trail.
43
47
  *
@@ -19,4 +19,4 @@ export interface SwipeDeckState {
19
19
  * The platform-free half of the swipe deck — queue, visible stack, and what
20
20
  * skip/answer/undo do. The twins wrap it with their own gesture layers.
21
21
  */
22
- export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void): SwipeDeckState;
22
+ export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void, isBlocked?: (prop: Proposition) => boolean): SwipeDeckState;
@@ -92,6 +92,28 @@ export interface BladeTheme {
92
92
  buttonSecondaryHover: string;
93
93
  buttonSecondaryText: string;
94
94
  };
95
+ /** Optional Game Shelf skin. Omitted values follow the normal theme colors. */
96
+ shelf?: {
97
+ canvas?: string;
98
+ onCanvas?: string;
99
+ surface?: string;
100
+ text?: string;
101
+ muted?: string;
102
+ accent?: string;
103
+ button?: string;
104
+ buttonText?: string;
105
+ coverText?: string;
106
+ coverColors?: Record<string, string>;
107
+ /** Cover colour for games without artwork, by tier id (signature / premier / exclusive). */
108
+ tierColors?: Record<string, string>;
109
+ /** Replacement artwork by game icon id — Shelf covers and Showcase tiles; null hides the bundled Shelf cover. */
110
+ artwork?: Record<string, string | null>;
111
+ /** Replacement Showcase hero image by category (sports / racing / prediction / fantasy); null hides it. */
112
+ heroArtwork?: Record<string, string | null>;
113
+ categoryColors?: Record<string, string>;
114
+ /** Replacement category artwork; null hides the bundled image. */
115
+ categoryArtwork?: Record<string, string | null>;
116
+ };
95
117
  brand?: {
96
118
  chip?: string;
97
119
  text?: string;
@@ -1,3 +1,5 @@
1
+ import { GameVariant } from './game-variants';
2
+ import { UiVariant } from './ui-variant';
1
3
  import { ReactNode } from 'react';
2
4
  import { SelectionVariant } from './selection-variants';
3
5
  import { BladeTheme, BladeThemeSet, ColorScheme } from './themes';
@@ -28,6 +30,8 @@ export interface RuleExpressionObject {
28
30
  validated?: boolean;
29
31
  expression: string;
30
32
  }
33
+ /** The game categories BLADE files a game under. */
34
+ export type GameCategory = 'sports' | 'casino' | 'racing' | 'prediction' | 'fantasy';
31
35
  export interface Game {
32
36
  id: number;
33
37
  game_name: string;
@@ -67,6 +71,12 @@ export interface Game {
67
71
  };
68
72
  };
69
73
  operator_margin?: number;
74
+ /**
75
+ * BLADE's quote-rounding switch: when true (or absent) quotes round to the
76
+ * nearest `payout_structure.round_to` (default $1); explicit false means the
77
+ * backend quotes exact and blade must not re-round.
78
+ */
79
+ round_payouts?: boolean;
70
80
  jackpot_enabled?: boolean;
71
81
  jackpot_amount?: number;
72
82
  jackpot_limit?: number | null;
@@ -77,6 +87,7 @@ export interface Game {
77
87
  /** Boolean alias for APIs that expose selection scope as a flag. */
78
88
  require_same_event?: boolean;
79
89
  require_distinct_events?: boolean;
90
+ sgm_mode?: 'off' | 'any' | 'limited' | 'limited_2p';
80
91
  allocations?: GameAllocation[];
81
92
  rule_expression?: string | RuleExpressionObject | null;
82
93
  min_bet?: number | null;
@@ -180,6 +191,8 @@ export interface GameEntry {
180
191
  selections?: Record<number, 'yes' | 'no'>;
181
192
  pending: boolean;
182
193
  winning?: number;
194
+ /** Raw API field for the payout; normalised into `winning` by the client. */
195
+ win_amount?: number;
183
196
  expected_correct?: number;
184
197
  bet_amount?: number;
185
198
  stake?: number;
@@ -242,7 +255,7 @@ export interface PlaceEntryFlowProps {
242
255
  onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
243
256
  onCancel?: () => void;
244
257
  initialGameId?: number;
245
- gameCategory?: 'sports' | 'casino' | 'racing';
258
+ gameCategory?: GameCategory;
246
259
  jurisdiction?: string;
247
260
  /** Supply demo/test data instead of hitting the API */
248
261
  demoGames?: Game[];
@@ -264,6 +277,7 @@ export interface PlaceEntryFlowProps {
264
277
  * Proposition layout for every selection screen in the flow. Omit for the
265
278
  * packaged matchup list, which stays the default.
266
279
  */
280
+ uiVariant?: UiVariant;
267
281
  selectionVariant?: SelectionVariant;
268
282
  /** Drop the per-fixture swipe deck offered by the variant layouts. @default false */
269
283
  disableEventSwipe?: boolean;
@@ -280,6 +294,13 @@ export interface PlaceEntryFlowProps {
280
294
  howToPlayMarkdown?: string | null;
281
295
  }
282
296
  export interface GameSelectorProps {
297
+ /** Game discovery layout; overrides the UI system's default. Web renders cards, split, compare, shelf and showcase; native renders shelf and falls back to the system's layout for the rest. */
298
+ gameVariant?: GameVariant;
299
+ /** Showcase: `games` is already a curated set, so leave out the dimmed tiles for games not on offer. */
300
+ onlyListedGames?: boolean;
301
+ /** @deprecated Layouts no longer draw their own header; back lives in the page header (`GamePageTitle` / `PageHeader`). */
302
+ onBack?: () => void;
303
+ uiVariant?: UiVariant;
283
304
  games: Game[];
284
305
  selectedGame: Game | null;
285
306
  onSelectGame: (game: Game) => void;
@@ -297,6 +318,8 @@ export interface GameSelectorProps {
297
318
  /** Called when a proposition count option is picked (can be used to auto-advance) */
298
319
  onPropositionCountSelected?: () => void;
299
320
  onQuickPickGame?: (game: Game, count: number) => void;
321
+ /** Show quick-pick tiles while their required selection pool is loading. */
322
+ quickPickLoading?: boolean;
300
323
  /** Max payout data per game ID (from /max-payout endpoint) */
301
324
  maxPayouts?: Record<number, TopPayoutsResponse>;
302
325
  }
@@ -313,7 +336,7 @@ export interface SportSelectorProps {
313
336
  colorScheme?: ColorScheme;
314
337
  hideActions?: boolean;
315
338
  initialSport?: string;
316
- gameCategory?: 'sports' | 'casino' | 'racing';
339
+ gameCategory?: GameCategory;
317
340
  renderTeamLogo?: RenderTeamLogo;
318
341
  /** Hide the Quick Pick button and count input. @default false */
319
342
  disableQuickPick?: boolean;
@@ -326,6 +349,12 @@ export interface SportSelectorProps {
326
349
  onPropositionCountChange?: (count: number) => void;
327
350
  allowAnswerToggle?: boolean;
328
351
  headerExtra?: ReactNode;
352
+ /**
353
+ * Sport rail for the header row. A node draws to the left of the filter and
354
+ * view controls; a function is handed those controls to place itself, which
355
+ * is how the rail keeps the full width for its track.
356
+ */
357
+ railSlot?: ReactNode | ((actions: ReactNode) => ReactNode);
329
358
  /**
330
359
  * Which proposition layout to draw. Omitted (the default) is the packaged
331
360
  * matchup list; the variants are YESNO's fixture-first designs. Falls back to
@@ -354,6 +383,11 @@ export interface EntrySubmissionProps {
354
383
  winningCounts?: number[];
355
384
  payouts?: Record<number, number>;
356
385
  renderTeamLogo?: RenderTeamLogo;
386
+ /**
387
+ * Component legs of composite propositions, by id — lets a composite row
388
+ * name the fixture each leg is from. See SelectionReviewProps.componentById.
389
+ */
390
+ componentById?: ReadonlyMap<number, Proposition> | null;
357
391
  /** Show the free-text custom amount input. @default false */
358
392
  showCustomAmount?: boolean;
359
393
  /**
@@ -389,6 +423,13 @@ export interface SelectionReviewProps {
389
423
  gameName?: string;
390
424
  potentialPayout?: number;
391
425
  defaultExpanded?: boolean;
426
+ /**
427
+ * Component legs of composite propositions, by id. Supply it and a composite
428
+ * row names the fixture each leg comes from — without it a cross-event
429
+ * composite reads as one run-on sentence with no clue the halves are from
430
+ * different games. `usePlaceEntry().compositeComponentById` provides it.
431
+ */
432
+ componentById?: ReadonlyMap<number, Proposition> | null;
392
433
  addMorePicks?: {
393
434
  remaining: number;
394
435
  max: number;
@@ -0,0 +1,69 @@
1
+ import { UiVariant } from './ui-variant';
2
+ export interface UiSystemPages {
3
+ games: 'kit' | 'playbook' | 'call' | 'shelf' | 'dense';
4
+ picks: 'kit' | 'shelf' | 'call' | 'dense';
5
+ setup: 'kit' | 'ticket' | 'dense';
6
+ }
7
+ export interface PageHeaderSpec {
8
+ /**
9
+ * stacked — title, then a ← context row beneath it.
10
+ * toolbar — round back button + context eyebrow above a display title.
11
+ * bar — one compact ruled row: back, title, actions.
12
+ */
13
+ layout: 'stacked' | 'toolbar' | 'bar';
14
+ /** Title px on phones, then from 640px. */
15
+ size: readonly [number, number];
16
+ weight: 700 | 800 | 850;
17
+ /** Letter-spacing in em. */
18
+ tracking: number;
19
+ lineHeight: number;
20
+ }
21
+ export interface YesNoSpec {
22
+ fill: 'product' | 'primary' | 'button';
23
+ /** Metrics that replace the xs/sm/md size ramp. */
24
+ box?: {
25
+ minHeight: number;
26
+ minWidth: number;
27
+ padX: number;
28
+ padY: number;
29
+ radius: number;
30
+ fontSize: number;
31
+ weight: 700 | 750;
32
+ };
33
+ /** Underline the selected label. */
34
+ underline?: boolean;
35
+ /** A ✓ before the selected label. */
36
+ check?: boolean;
37
+ /** Tiny "Selected" caption under the selected label. */
38
+ caption?: boolean;
39
+ /** Dim disabled sides (default true). */
40
+ dimDisabled?: boolean;
41
+ }
42
+ /** The match scroll bar on the picks screen: fixture chips between previous / next buttons. */
43
+ export interface MatchRailSpec {
44
+ /** Chip and button corner radius in px; 999 is a pill. */
45
+ radius: number;
46
+ /** The selected chip fills with the theme's button colour or its primary. */
47
+ fill: 'button' | 'primary';
48
+ /** Pick count after the label: inline "· 2", or a round badge. */
49
+ count: 'inline' | 'badge';
50
+ }
51
+ export interface UiSystem {
52
+ label: string;
53
+ pages: UiSystemPages;
54
+ pageHeader: PageHeaderSpec;
55
+ yesNo: YesNoSpec;
56
+ matchRail: MatchRailSpec;
57
+ /**
58
+ * yesno — the green/red split button with a QUICKPICK caption.
59
+ * solid — one filled button: bolt mark + "QuickPick", a chevron when it opens a count menu.
60
+ */
61
+ quickPick: 'yesno' | 'solid';
62
+ /** Sport selector: the pill-track segmented control, or the match rail's chips. */
63
+ sportRail: 'segmented' | 'chips';
64
+ }
65
+ export declare const UI_SYSTEMS: Record<UiVariant, UiSystem>;
66
+ export declare function uiSystem(variant: UiVariant | undefined): UiSystem;
67
+ export declare function useUiSystem(): UiSystem;
68
+ /** Systems whose picks screen is the Game Shelf one: fixture tabs, inline Yes/No, one-row dock. */
69
+ export declare function usesShelfPicks(value: unknown): boolean;
@@ -0,0 +1,16 @@
1
+ import { BladeTheme } from './themes';
2
+ /** Presentation only. Omit to preserve the original component library UI. */
3
+ export type DenseUiVariant = 'playboard' | 'matchbook' | 'game-deck';
4
+ export type UiVariant = 'default' | 'playbook' | 'call' | 'shelf' | DenseUiVariant;
5
+ export declare const UI_VARIANTS: readonly UiVariant[];
6
+ export declare const UI_VARIANT_LABELS: Record<UiVariant, string>;
7
+ export declare function isDenseUiVariant(value: unknown): value is DenseUiVariant;
8
+ export declare function parseUiVariant(value: unknown): UiVariant;
9
+ /**
10
+ * @deprecated UI systems no longer change theming — they only swap components.
11
+ * Pass a theme yourself; this returns the palette a system used to force, or
12
+ * undefined.
13
+ */
14
+ export declare function uiVariantTheme(variant: UiVariant, colorScheme?: 'light' | 'dark'): BladeTheme | undefined;
15
+ export declare const UiVariantContext: import('react').Context<UiVariant>;
16
+ export declare function useUiVariant(): UiVariant;
@@ -0,0 +1,8 @@
1
+ import { Game, EntryPreviewRequest, EntryPreviewResponse } from './types';
2
+ import { CallPayoutView } from './call-presentation';
3
+ export type PreviewCallPayouts = (gameId: number, request: EntryPreviewRequest) => Promise<EntryPreviewResponse>;
4
+ /** Reuse the review endpoint: configured estimates never overwrite a live quote. */
5
+ export declare function useCallPayouts(preview: PreviewCallPayouts | undefined, game: Game | null, count: number, stake: number, expectedCorrect: number, ruleId: number | null | undefined, fallback: CallPayoutView | null): {
6
+ view: CallPayoutView | null;
7
+ estimated: boolean;
8
+ };
@@ -1,5 +1,5 @@
1
- import { Game, GamePermittedRule, Proposition, QuickPickResult } from './types';
2
- export declare const DEFAULT_STAKE = 10;
1
+ import { Game, GamePermittedRule, Proposition, QuickPickResult, GameCategory } from './types';
2
+ export declare const DEFAULT_STAKE = 20;
3
3
  export declare function stripColumns(count: number, containerWidth: number): number;
4
4
  export declare function resolvePrice(price: number | string | {
5
5
  amount: number | string;
@@ -7,14 +7,19 @@ export declare function resolvePrice(price: number | string | {
7
7
  } | null | undefined): number;
8
8
  export declare function toNumber(value: unknown): number;
9
9
  export declare function toBool(value: unknown): boolean;
10
- export declare function formatYesNo(value: string): string;
10
+ export interface YesNoLabels {
11
+ yes: string;
12
+ no: string;
13
+ }
14
+ export declare const DEFAULT_YES_NO_LABELS: YesNoLabels;
15
+ export declare function formatYesNo(value: string, labels?: YesNoLabels): string;
11
16
  export declare function formatCurrency(value: number): string;
12
17
  export declare function formatDate(date: Date | string): string;
13
18
  export declare function groupPropositionsBySport(propositions: Proposition[]): Record<string, Proposition[]>;
14
19
  export declare function getPropositionSportKey(prop: Proposition, pool?: Proposition[]): string;
15
20
  export declare function collectPropositionSportKeys(propositions: Proposition[]): string[];
16
21
  export declare function groupPropositionsByCategory(propositions: Proposition[]): Record<string, Proposition[]>;
17
- export type EntryCategory = 'sports' | 'casino' | 'racing';
22
+ export type EntryCategory = GameCategory;
18
23
  export declare const ENTRY_CATEGORY_ORDER: EntryCategory[];
19
24
  export declare function getPropositionEntryCategory(prop: Proposition): EntryCategory;
20
25
  /**
@@ -58,13 +63,18 @@ export declare function getJackpotInfo(game: Game): {
58
63
  limit: number;
59
64
  progressive: boolean;
60
65
  };
61
- export declare function isRacingCategory(gameCategory?: 'sports' | 'casino' | 'racing', propositions?: Proposition[], sportBaseKey?: string | null): boolean;
66
+ export declare function isRacingCategory(gameCategory?: GameCategory, propositions?: Proposition[], sportBaseKey?: string | null): boolean;
62
67
  export declare function getSportDisplayName(sport: string, sportBaseKey?: string | null): string;
63
68
  /** Host-supplied UI labels keyed by sport key (e.g. `basketball_nba` → `NBA`). */
64
69
  export type SportDisplayNameOverrides = Record<string, string>;
65
70
  /** Host-supplied UI labels keyed by entry category (e.g. `sports`, `casino`, `racing`). */
66
71
  export type CategoryDisplayNameOverrides = Record<string, string>;
67
72
  export declare function resolveSportDisplayName(sport: string, overrides?: SportDisplayNameOverrides | null, sportBaseKey?: string | null): string;
73
+ export declare function resolveSportLabel(sport: string, sources: {
74
+ overrides?: SportDisplayNameOverrides | null;
75
+ summaryLabel?: string | null;
76
+ sportBaseKey?: string | null;
77
+ }): string;
68
78
  export declare function resolveCategoryDisplayName(category: string, overrides?: CategoryDisplayNameOverrides | null): string;
69
79
  /**
70
80
  * Filter propositions to only those allowed by a game's constraints.
@@ -109,10 +119,11 @@ export declare function isGameAvailableToday(game: Game, now?: Date): boolean;
109
119
  export declare function getAvailableDaysLabel(game: Game): string | null;
110
120
  export declare function contrastTextColour(bgColor: string | undefined | null, lightText?: string, darkText?: string): string;
111
121
  export declare function readableColor(bg: string | undefined | null, desired: string | undefined | null, fallback: string, minRatio?: number): string;
112
- /** Group propositions by matchup (home_team vs away_team). */
122
+ export declare function predictionTopic(p: Proposition): string | undefined;
123
+ /** Group propositions by matchup (home_team vs away_team); prediction questions by topic. */
113
124
  export declare function groupByMatchup(props: Proposition[]): Record<string, Proposition[]>;
114
125
  export declare function groupByRace(props: Proposition[]): Record<string, Proposition[]>;
115
- export declare function groupPropositionsForDisplay(props: Proposition[], gameCategory?: 'sports' | 'casino' | 'racing', sportBaseKey?: string | null): Record<string, Proposition[]>;
126
+ export declare function groupPropositionsForDisplay(props: Proposition[], gameCategory?: GameCategory, sportBaseKey?: string | null): Record<string, Proposition[]>;
116
127
  /**
117
128
  * Group picks under the event they belong to, keeping pick order. The key is
118
129
  * the "A vs B" matchup, the race name, or `null` for props with no event.