@simple-parlay/components 1.30.5 → 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 (131) hide show
  1. package/dist/index.cjs +1 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +451 -374
  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/EventSwipeModal.d.ts +19 -0
  15. package/dist/react/components/GameModeCard.d.ts +41 -6
  16. package/dist/react/components/GamePage.d.ts +3 -1
  17. package/dist/react/components/GameSelector.d.ts +9 -1
  18. package/dist/react/components/GameSetupPage.d.ts +6 -2
  19. package/dist/react/components/GameShelfCatalogue.d.ts +2 -0
  20. package/dist/react/components/GameShowcaseCatalogue.d.ts +9 -0
  21. package/dist/react/components/GameVariantCatalogue.d.ts +6 -0
  22. package/dist/react/components/HowToPlayButton.d.ts +3 -1
  23. package/dist/react/components/MatchRail.d.ts +30 -0
  24. package/dist/react/components/MultiLegTable.d.ts +3 -1
  25. package/dist/react/components/PageBackButton.d.ts +8 -0
  26. package/dist/react/components/PickerBrand.d.ts +7 -0
  27. package/dist/react/components/PlaceEntryProvider.d.ts +62 -5
  28. package/dist/react/components/PlaybookChooser.d.ts +7 -0
  29. package/dist/react/components/PropositionFilters.d.ts +3 -1
  30. package/dist/react/components/QuickPickButton.d.ts +3 -1
  31. package/dist/react/components/ScrollShelf.d.ts +25 -0
  32. package/dist/react/components/SelectionReview.d.ts +1 -1
  33. package/dist/react/components/SelectionVariantList.d.ts +20 -0
  34. package/dist/react/components/SelectionsPage.d.ts +1 -1
  35. package/dist/react/components/SportRail.d.ts +26 -0
  36. package/dist/react/components/SportSelector.d.ts +32 -2
  37. package/dist/react/components/_primitives/index.d.ts +9 -1
  38. package/dist/react/index.cjs +1 -0
  39. package/dist/react/index.d.ts +49 -16
  40. package/dist/react/index.mjs +451 -374
  41. package/dist/react/utils/dom.d.ts +7 -0
  42. package/dist/react/utils/index.d.ts +1 -1
  43. package/dist/react-native/components/CallGameCatalogue.d.ts +16 -0
  44. package/dist/react-native/components/CallPayoutTable.d.ts +6 -0
  45. package/dist/react-native/components/CallTicketBuilder.d.ts +33 -0
  46. package/dist/react-native/components/CorrelationChoicesSkeleton.d.ts +3 -0
  47. package/dist/react-native/components/CorrelationPricingDebug.d.ts +2 -0
  48. package/dist/react-native/components/CorrelationPropPlaceholder.d.ts +7 -0
  49. package/dist/react-native/components/DenseGameCatalogue.d.ts +2 -0
  50. package/dist/react-native/components/DenseUi.d.ts +59 -0
  51. package/dist/react-native/components/EntrySubmission.d.ts +1 -1
  52. package/dist/react-native/components/EventSwipeModal.d.ts +17 -0
  53. package/dist/react-native/components/GameModeCard.d.ts +41 -6
  54. package/dist/react-native/components/GamePage.d.ts +4 -1
  55. package/dist/react-native/components/GameSelector.d.ts +9 -1
  56. package/dist/react-native/components/GameSetupPage.d.ts +5 -14
  57. package/dist/react-native/components/GameShelfCatalogue.d.ts +7 -0
  58. package/dist/react-native/components/HowToPlayButton.d.ts +3 -1
  59. package/dist/react-native/components/LoadingIndicators.d.ts +1 -1
  60. package/dist/react-native/components/MatchRail.d.ts +36 -0
  61. package/dist/react-native/components/MultiLegTable.d.ts +3 -1
  62. package/dist/react-native/components/PageBackButton.d.ts +7 -0
  63. package/dist/react-native/components/PickerBrand.d.ts +6 -0
  64. package/dist/react-native/components/PlaceEntryProvider.d.ts +57 -5
  65. package/dist/react-native/components/PlaybookChooser.d.ts +7 -0
  66. package/dist/react-native/components/PropositionFilters.d.ts +3 -1
  67. package/dist/react-native/components/QuickPickButton.d.ts +3 -1
  68. package/dist/react-native/components/ScrollShelf.d.ts +23 -0
  69. package/dist/react-native/components/SelectionReview.d.ts +1 -1
  70. package/dist/react-native/components/SelectionVariantList.d.ts +20 -0
  71. package/dist/react-native/components/SelectionsPage.d.ts +1 -1
  72. package/dist/react-native/components/SportRail.d.ts +27 -0
  73. package/dist/react-native/components/SportSelector.d.ts +29 -2
  74. package/dist/react-native/components/_primitives/index.d.ts +12 -2
  75. package/dist/react-native/index.cjs +1 -0
  76. package/dist/react-native/index.d.ts +49 -16
  77. package/dist/react-native/index.mjs +438 -382
  78. package/dist/react-native/utils/index.d.ts +1 -1
  79. package/dist/shared/api-client.d.ts +4 -3
  80. package/dist/shared/call-presentation.d.ts +20 -0
  81. package/dist/shared/composite.d.ts +7 -0
  82. package/dist/shared/correlation-steering.d.ts +49 -0
  83. package/dist/shared/date-filters.d.ts +5 -4
  84. package/dist/shared/dense-ui.d.ts +54 -0
  85. package/dist/shared/favourite-sport.d.ts +2 -0
  86. package/dist/shared/game-artwork.d.ts +61 -0
  87. package/dist/shared/game-flow.d.ts +18 -1
  88. package/dist/shared/game-icons.d.ts +6 -3
  89. package/dist/shared/game-library.d.ts +58 -0
  90. package/dist/shared/game-set-bet.d.ts +0 -1
  91. package/dist/shared/game-shelf-artwork.d.ts +3 -0
  92. package/dist/shared/game-shelf-presentation.d.ts +43 -0
  93. package/dist/shared/game-variants.d.ts +5 -0
  94. package/dist/shared/hooks.d.ts +9 -8
  95. package/dist/shared/how-to-play-html.d.ts +1 -1
  96. package/dist/shared/how-to-play-logo.d.ts +1 -1
  97. package/dist/shared/menu-placement.d.ts +26 -0
  98. package/dist/shared/mirror.d.ts +88 -5
  99. package/dist/shared/pick-your-dividend.d.ts +2 -1
  100. package/dist/shared/picker-brand.d.ts +22 -0
  101. package/dist/shared/playbook.d.ts +29 -0
  102. package/dist/shared/selection-actions.d.ts +61 -0
  103. package/dist/shared/selection-caps.d.ts +68 -0
  104. package/dist/shared/selection-variants.d.ts +52 -0
  105. package/dist/shared/six-again.d.ts +105 -0
  106. package/dist/shared/swipe-deck.d.ts +1 -1
  107. package/dist/shared/themes.d.ts +22 -0
  108. package/dist/shared/types.d.ts +83 -3
  109. package/dist/shared/ui-system.d.ts +69 -0
  110. package/dist/shared/ui-variant.d.ts +16 -0
  111. package/dist/shared/use-call-payouts.d.ts +8 -0
  112. package/dist/shared/utils.d.ts +18 -6
  113. package/package.json +7 -8
  114. package/dist/index.js +0 -1
  115. package/dist/react/components/GameSetBetPage.d.ts +0 -21
  116. package/dist/react/components/LadderPage.d.ts +0 -21
  117. package/dist/react/components/MirrorPage.d.ts +0 -21
  118. package/dist/react/components/PerfectPickPage.d.ts +0 -22
  119. package/dist/react/components/PickYourDividendPage.d.ts +0 -21
  120. package/dist/react/components/RuleSetupPage.d.ts +0 -27
  121. package/dist/react/components/SafetyNetPage.d.ts +0 -16
  122. package/dist/react/index.js +0 -1
  123. package/dist/react/utils/design.d.ts +0 -55
  124. package/dist/react-native/components/GameSetBetPage.d.ts +0 -19
  125. package/dist/react-native/components/LadderPage.d.ts +0 -19
  126. package/dist/react-native/components/MirrorPage.d.ts +0 -19
  127. package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
  128. package/dist/react-native/components/PickYourDividendPage.d.ts +0 -19
  129. package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
  130. package/dist/react-native/components/SafetyNetPage.d.ts +0 -14
  131. package/dist/react-native/index.js +0 -1
@@ -1,4 +1,7 @@
1
+ import { GameVariant } from './game-variants';
2
+ import { UiVariant } from './ui-variant';
1
3
  import { ReactNode } from 'react';
4
+ import { SelectionVariant } from './selection-variants';
2
5
  import { BladeTheme, BladeThemeSet, ColorScheme } from './themes';
3
6
  export type { BladeTheme, BladeThemeSet, ColorScheme };
4
7
  /** Screen size category for responsive behavior.
@@ -27,6 +30,8 @@ export interface RuleExpressionObject {
27
30
  validated?: boolean;
28
31
  expression: string;
29
32
  }
33
+ /** The game categories BLADE files a game under. */
34
+ export type GameCategory = 'sports' | 'casino' | 'racing' | 'prediction' | 'fantasy';
30
35
  export interface Game {
31
36
  id: number;
32
37
  game_name: string;
@@ -66,6 +71,12 @@ export interface Game {
66
71
  };
67
72
  };
68
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;
69
80
  jackpot_enabled?: boolean;
70
81
  jackpot_amount?: number;
71
82
  jackpot_limit?: number | null;
@@ -76,6 +87,7 @@ export interface Game {
76
87
  /** Boolean alias for APIs that expose selection scope as a flag. */
77
88
  require_same_event?: boolean;
78
89
  require_distinct_events?: boolean;
90
+ sgm_mode?: 'off' | 'any' | 'limited' | 'limited_2p';
79
91
  allocations?: GameAllocation[];
80
92
  rule_expression?: string | RuleExpressionObject | null;
81
93
  min_bet?: number | null;
@@ -119,7 +131,24 @@ export interface GameAllocation {
119
131
  created_at?: string;
120
132
  updated_at?: string;
121
133
  }
122
- export type RenderTeamLogo = (teamName: string) => ReactNode;
134
+ /**
135
+ * A club badge or runner silk for `teamName`.
136
+ *
137
+ * `size` is the pixel edge the layout wants — the fixture-first variants ask
138
+ * for anything from 16px in a folded strip to 24px in a split stub. Hosts that
139
+ * ignore it get their own single size everywhere, which is what every existing
140
+ * renderer did before the argument existed.
141
+ */
142
+ export type RenderTeamLogo = (teamName: string, size?: number) => ReactNode;
143
+ /**
144
+ * The runner's silk, the player's headshot, the team's jersey — whatever art
145
+ * belongs to this proposition. It sits inline in front of the question it
146
+ * belongs to, and a composite gets one per leg, so honour `size`: it is the
147
+ * pixel edge the caller has room for (32 in front of a swipe card's question,
148
+ * 24 in front of one of its legs). Return null for propositions with no art
149
+ * and nothing is reserved.
150
+ */
151
+ export type RenderPropositionSilk = (proposition: Proposition, size?: number) => ReactNode;
123
152
  export interface Proposition {
124
153
  id: number;
125
154
  api_key_id?: number;
@@ -162,6 +191,8 @@ export interface GameEntry {
162
191
  selections?: Record<number, 'yes' | 'no'>;
163
192
  pending: boolean;
164
193
  winning?: number;
194
+ /** Raw API field for the payout; normalised into `winning` by the client. */
195
+ win_amount?: number;
165
196
  expected_correct?: number;
166
197
  bet_amount?: number;
167
198
  stake?: number;
@@ -224,7 +255,7 @@ export interface PlaceEntryFlowProps {
224
255
  onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
225
256
  onCancel?: () => void;
226
257
  initialGameId?: number;
227
- gameCategory?: 'sports' | 'casino' | 'racing';
258
+ gameCategory?: GameCategory;
228
259
  jurisdiction?: string;
229
260
  /** Supply demo/test data instead of hitting the API */
230
261
  demoGames?: Game[];
@@ -240,6 +271,16 @@ export interface PlaceEntryFlowProps {
240
271
  filterSport?: string;
241
272
  /** Custom renderer for team or proposition logos. Receives a display name or prop logo key. */
242
273
  renderTeamLogo?: RenderTeamLogo;
274
+ /** Custom renderer for a proposition's silk or jersey, shown on the swipe card. */
275
+ renderPropositionSilk?: RenderPropositionSilk;
276
+ /**
277
+ * Proposition layout for every selection screen in the flow. Omit for the
278
+ * packaged matchup list, which stays the default.
279
+ */
280
+ uiVariant?: UiVariant;
281
+ selectionVariant?: SelectionVariant;
282
+ /** Drop the per-fixture swipe deck offered by the variant layouts. @default false */
283
+ disableEventSwipe?: boolean;
243
284
  /** Hide the Quick Pick @default false */
244
285
  disableQuickPick?: boolean;
245
286
  /** Callback when an entry is selected in the Entries tab */
@@ -253,6 +294,13 @@ export interface PlaceEntryFlowProps {
253
294
  howToPlayMarkdown?: string | null;
254
295
  }
255
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;
256
304
  games: Game[];
257
305
  selectedGame: Game | null;
258
306
  onSelectGame: (game: Game) => void;
@@ -270,6 +318,8 @@ export interface GameSelectorProps {
270
318
  /** Called when a proposition count option is picked (can be used to auto-advance) */
271
319
  onPropositionCountSelected?: () => void;
272
320
  onQuickPickGame?: (game: Game, count: number) => void;
321
+ /** Show quick-pick tiles while their required selection pool is loading. */
322
+ quickPickLoading?: boolean;
273
323
  /** Max payout data per game ID (from /max-payout endpoint) */
274
324
  maxPayouts?: Record<number, TopPayoutsResponse>;
275
325
  }
@@ -286,14 +336,31 @@ export interface SportSelectorProps {
286
336
  colorScheme?: ColorScheme;
287
337
  hideActions?: boolean;
288
338
  initialSport?: string;
289
- gameCategory?: 'sports' | 'casino' | 'racing';
339
+ gameCategory?: GameCategory;
290
340
  renderTeamLogo?: RenderTeamLogo;
291
341
  /** Hide the Quick Pick button and count input. @default false */
292
342
  disableQuickPick?: boolean;
343
+ /**
344
+ * Drop the per-fixture swipe deck the variant layouts offer, leaving the rows
345
+ * as the only way to answer. Falls back to the provider's flag. @default false
346
+ */
347
+ disableEventSwipe?: boolean;
293
348
  selectedPropositionCount?: number;
294
349
  onPropositionCountChange?: (count: number) => void;
295
350
  allowAnswerToggle?: boolean;
296
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);
358
+ /**
359
+ * Which proposition layout to draw. Omitted (the default) is the packaged
360
+ * matchup list; the variants are YESNO's fixture-first designs. Falls back to
361
+ * the provider's `selectionVariant` when this is not set.
362
+ */
363
+ variant?: SelectionVariant;
297
364
  }
298
365
  export interface EntrySubmissionProps {
299
366
  game: Game;
@@ -316,6 +383,11 @@ export interface EntrySubmissionProps {
316
383
  winningCounts?: number[];
317
384
  payouts?: Record<number, number>;
318
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;
319
391
  /** Show the free-text custom amount input. @default false */
320
392
  showCustomAmount?: boolean;
321
393
  /**
@@ -351,6 +423,13 @@ export interface SelectionReviewProps {
351
423
  gameName?: string;
352
424
  potentialPayout?: number;
353
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;
354
433
  addMorePicks?: {
355
434
  remaining: number;
356
435
  max: number;
@@ -411,6 +490,7 @@ export interface EntryPreviewRequest {
411
490
  predicted: number;
412
491
  total: number;
413
492
  bet_amount: number;
493
+ rule_id?: number | null;
414
494
  }
415
495
  export interface EntryPreviewResponse {
416
496
  winning_counts: 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,4 +1,5 @@
1
- import { Game, GamePermittedRule, Proposition, QuickPickResult } from './types';
1
+ import { Game, GamePermittedRule, Proposition, QuickPickResult, GameCategory } from './types';
2
+ export declare const DEFAULT_STAKE = 20;
2
3
  export declare function stripColumns(count: number, containerWidth: number): number;
3
4
  export declare function resolvePrice(price: number | string | {
4
5
  amount: number | string;
@@ -6,14 +7,19 @@ export declare function resolvePrice(price: number | string | {
6
7
  } | null | undefined): number;
7
8
  export declare function toNumber(value: unknown): number;
8
9
  export declare function toBool(value: unknown): boolean;
9
- 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;
10
16
  export declare function formatCurrency(value: number): string;
11
17
  export declare function formatDate(date: Date | string): string;
12
18
  export declare function groupPropositionsBySport(propositions: Proposition[]): Record<string, Proposition[]>;
13
19
  export declare function getPropositionSportKey(prop: Proposition, pool?: Proposition[]): string;
14
20
  export declare function collectPropositionSportKeys(propositions: Proposition[]): string[];
15
21
  export declare function groupPropositionsByCategory(propositions: Proposition[]): Record<string, Proposition[]>;
16
- export type EntryCategory = 'sports' | 'casino' | 'racing';
22
+ export type EntryCategory = GameCategory;
17
23
  export declare const ENTRY_CATEGORY_ORDER: EntryCategory[];
18
24
  export declare function getPropositionEntryCategory(prop: Proposition): EntryCategory;
19
25
  /**
@@ -57,13 +63,18 @@ export declare function getJackpotInfo(game: Game): {
57
63
  limit: number;
58
64
  progressive: boolean;
59
65
  };
60
- 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;
61
67
  export declare function getSportDisplayName(sport: string, sportBaseKey?: string | null): string;
62
68
  /** Host-supplied UI labels keyed by sport key (e.g. `basketball_nba` → `NBA`). */
63
69
  export type SportDisplayNameOverrides = Record<string, string>;
64
70
  /** Host-supplied UI labels keyed by entry category (e.g. `sports`, `casino`, `racing`). */
65
71
  export type CategoryDisplayNameOverrides = Record<string, string>;
66
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;
67
78
  export declare function resolveCategoryDisplayName(category: string, overrides?: CategoryDisplayNameOverrides | null): string;
68
79
  /**
69
80
  * Filter propositions to only those allowed by a game's constraints.
@@ -108,10 +119,11 @@ export declare function isGameAvailableToday(game: Game, now?: Date): boolean;
108
119
  export declare function getAvailableDaysLabel(game: Game): string | null;
109
120
  export declare function contrastTextColour(bgColor: string | undefined | null, lightText?: string, darkText?: string): string;
110
121
  export declare function readableColor(bg: string | undefined | null, desired: string | undefined | null, fallback: string, minRatio?: number): string;
111
- /** 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. */
112
124
  export declare function groupByMatchup(props: Proposition[]): Record<string, Proposition[]>;
113
125
  export declare function groupByRace(props: Proposition[]): Record<string, Proposition[]>;
114
- 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[]>;
115
127
  /**
116
128
  * Group picks under the event they belong to, keeping pick order. The key is
117
129
  * the "A vs B" matchup, the race name, or `null` for props with no event.
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@simple-parlay/components",
3
- "version": "1.30.5",
3
+ "version": "1.30.6-pre.10",
4
4
  "description": "UI components, hooks, and utilities for React and React Native",
5
5
  "type": "module",
6
- "main": "./dist/index.js",
6
+ "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.mjs",
13
- "require": "./dist/index.js"
13
+ "require": "./dist/index.cjs"
14
14
  },
15
15
  "./react": {
16
16
  "types": "./dist/react/index.d.ts",
17
17
  "import": "./dist/react/index.mjs",
18
- "require": "./dist/react/index.js"
18
+ "require": "./dist/react/index.cjs"
19
19
  },
20
20
  "./react-native": {
21
21
  "types": "./dist/react-native/index.d.ts",
22
22
  "import": "./dist/react-native/index.mjs",
23
- "require": "./dist/react-native/index.js"
23
+ "require": "./dist/react-native/index.cjs"
24
24
  }
25
25
  },
26
26
  "files": [
@@ -48,9 +48,7 @@
48
48
  "test:e2e:ui": "playwright test --ui",
49
49
  "test:visual": "playwright test --config playwright.visual.config.ts",
50
50
  "dev:expo": "npm run start --prefix dev-expo",
51
- "prepublishOnly": "npm run build",
52
- "generate:how-to-play-logo": "node scripts/embed-how-to-play-logo.mjs",
53
- "generate:game-icons": "node scripts/embed-game-icons.mjs"
51
+ "prepublishOnly": "npm run build"
54
52
  },
55
53
  "keywords": [
56
54
  "components",
@@ -91,6 +89,7 @@
91
89
  "msw": "^2.12.10",
92
90
  "react": "^18.2.0",
93
91
  "react-dom": "^18.2.0",
92
+ "react-native": "^0.86.2",
94
93
  "react-native-svg": "^15.15.4",
95
94
  "react-native-web": "^0.21.2",
96
95
  "terser": "^5.46.1",