@simple-parlay/components 1.30.6-pre.3 → 1.30.6-pre.5

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 (36) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.mjs +289 -294
  4. package/dist/react/components/MultiLegTable.d.ts +3 -1
  5. package/dist/react/components/PlaceEntryProvider.d.ts +4 -1
  6. package/dist/react/components/PropositionFilters.d.ts +3 -1
  7. package/dist/react/components/SportRail.d.ts +0 -4
  8. package/dist/react/components/SportSelector.d.ts +1 -1
  9. package/dist/react/components/_primitives/index.d.ts +4 -0
  10. package/dist/react/index.d.ts +2 -0
  11. package/dist/react/index.js +1 -1
  12. package/dist/react/index.mjs +289 -294
  13. package/dist/react/utils/index.d.ts +1 -1
  14. package/dist/react-native/components/LoadingIndicators.d.ts +1 -1
  15. package/dist/react-native/components/MultiLegTable.d.ts +3 -1
  16. package/dist/react-native/components/PlaceEntryProvider.d.ts +4 -1
  17. package/dist/react-native/components/PropositionFilters.d.ts +3 -1
  18. package/dist/react-native/components/SportRail.d.ts +6 -4
  19. package/dist/react-native/components/SportSelector.d.ts +2 -2
  20. package/dist/react-native/components/_primitives/index.d.ts +5 -1
  21. package/dist/react-native/index.d.ts +2 -0
  22. package/dist/react-native/index.js +1 -1
  23. package/dist/react-native/index.mjs +376 -379
  24. package/dist/react-native/utils/index.d.ts +1 -1
  25. package/dist/shared/date-filters.d.ts +5 -4
  26. package/dist/shared/game-flow.d.ts +12 -1
  27. package/dist/shared/game-set-bet.d.ts +0 -1
  28. package/dist/shared/hooks.d.ts +1 -1
  29. package/dist/shared/menu-placement.d.ts +26 -0
  30. package/dist/shared/mirror.d.ts +5 -3
  31. package/dist/shared/picker-brand.d.ts +2 -0
  32. package/dist/shared/selection-actions.d.ts +9 -4
  33. package/dist/shared/selection-caps.d.ts +0 -1
  34. package/dist/shared/types.d.ts +7 -0
  35. package/dist/shared/utils.d.ts +11 -1
  36. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- export { resolvePrice, toNumber, toBool, formatYesNo, formatCurrency, formatDate, groupPropositionsBySport, getPropositionSportKey, collectPropositionSportKeys, compositePropositionMatchesSport, compositePropositionMatchesGameSports, groupPropositionsByCategory, groupPropositionsByEntryCategory, getPropositionEntryCategory, isRacingProposition, getAvailableEntryCategories, getSportPickerTitle, getCategoryDisplayName, getCategoryTagline, getSportShortCode, getSportPickerTagline, getSportSummaryTagline, splitSportLabel, getSportComingSoonCaption, getHowToPlayPanel, describeDemoVerdict, groupByMatchup, groupByRace, groupPropositionsForDisplay, isRacingCategory, buildRangeLegOptions, getPayoutForCount, generateQuickPick, isValidSelectionCount, getEffectivePropositionLimits, findPermittedRule, getJackpotInfo, getSportDisplayName, resolveSportDisplayName, resolveCategoryDisplayName, filterPropositionsForGame, filterPropositionPool, filterGamesByPropositionPool, filterGamesByEntryCategory, gameHasPropositionsInPool, getGameEntryCategory, gameMatchesEntryCategory, gamePermitsSport, normalizeGamesSport, sportKeysCompatible, propositionSportMatches, isGameAvailableToday, getAvailableDaysLabel, contrastTextColour, readableColor, getCompositeOperatorLabel, getCompositeHelperText, parseCompositeDescription, inferCompositeOperatorFromDescription, resolveCompositeOperator, resolveCompositeDisplay, resolveCompositeLegs, parseCompositeComponentIds, collectCompositeComponentIds, formatPropositionEventLabel, getPropositionDescription, getPropositionMarketType, resolveGameIconId, resolveGameIconUrl, isGameIconUrl, resolveGameIconMarkup, } from '../../shared/utils';
1
+ export { resolvePrice, toNumber, toBool, formatYesNo, DEFAULT_YES_NO_LABELS, formatCurrency, formatDate, groupPropositionsBySport, getPropositionSportKey, collectPropositionSportKeys, compositePropositionMatchesSport, compositePropositionMatchesGameSports, groupPropositionsByCategory, groupPropositionsByEntryCategory, getPropositionEntryCategory, isRacingProposition, getAvailableEntryCategories, getSportPickerTitle, getCategoryDisplayName, getCategoryTagline, getSportShortCode, getSportPickerTagline, getSportSummaryTagline, splitSportLabel, getSportComingSoonCaption, getHowToPlayPanel, describeDemoVerdict, groupByMatchup, groupByRace, groupPropositionsForDisplay, isRacingCategory, buildRangeLegOptions, getPayoutForCount, generateQuickPick, isValidSelectionCount, getEffectivePropositionLimits, findPermittedRule, getJackpotInfo, getSportDisplayName, resolveSportDisplayName, resolveSportLabel, resolveCategoryDisplayName, filterPropositionsForGame, filterPropositionPool, filterGamesByPropositionPool, filterGamesByEntryCategory, gameHasPropositionsInPool, getGameEntryCategory, gameMatchesEntryCategory, gamePermitsSport, normalizeGamesSport, sportKeysCompatible, propositionSportMatches, isGameAvailableToday, getAvailableDaysLabel, contrastTextColour, readableColor, getCompositeOperatorLabel, getCompositeHelperText, parseCompositeDescription, inferCompositeOperatorFromDescription, resolveCompositeOperator, resolveCompositeDisplay, resolveCompositeLegs, parseCompositeComponentIds, collectCompositeComponentIds, formatPropositionEventLabel, getPropositionDescription, getPropositionMarketType, resolveGameIconId, resolveGameIconUrl, isGameIconUrl, resolveGameIconMarkup, } from '../../shared/utils';
2
2
  export type { SportDisplayNameOverrides, CategoryDisplayNameOverrides, GameIconId, ComingSoonSport, HowToPlayPanelContent, HowToPlaySummarySegment, HowToPlayStep, HowToPlayDemoLeg, HowToPlayDemoVerdict } from '../../shared/utils';
@@ -12,10 +12,11 @@ export declare function matchesDateWindow(commenceTime: string | null | undefine
12
12
  /**
13
13
  * Which date-window chips are worth showing for a set of propositions.
14
14
  *
15
- * A window only appears when it *partitions* the set — at least one prop falls
16
- * inside it and at least one outside — so a filter that would match everything
17
- * (a game the operator already caps to, say, this week) or nothing (no games
18
- * today) is hidden rather than shown as a no-op.
15
+ * A window appears when at least one prop falls inside it — so the chips read
16
+ * the same way every time you open the panel. The whole group drops out only
17
+ * when no window can change the list at all (every dated prop inside every
18
+ * window it matches), which is what a game the operator already caps to a
19
+ * single day or week looks like.
19
20
  */
20
21
  export declare function availableDateWindows(propositions: ReadonlyArray<Pick<Proposition, 'commence_time'>>, now: Date): DateWindowOption[];
21
22
  /**
@@ -38,7 +38,18 @@ export interface ConfirmBoostCopy {
38
38
  */
39
39
  export declare function getConfirmBoostCopy(game: Game | null | undefined): ConfirmBoostCopy;
40
40
  export declare function describeWinCondition(rule: GamePermittedRule | null | undefined, winningCounts: number[] | null | undefined, totalPicks: number, payouts?: Record<number, number> | null): string | null;
41
+ export interface WinConditionPrizeRow {
42
+ count: number;
43
+ label: string;
44
+ prize: number;
45
+ }
46
+ export declare function winConditionPrizeRows(winningCounts: number[] | null | undefined, totalPicks: number, payouts: Record<number, number> | null | undefined): WinConditionPrizeRow[];
47
+ export declare function lockedLegCount(game: Game | null | undefined, selectedCount: number | null | undefined): number | null;
48
+ export declare function isLegsLockedGame(game: Game | null | undefined): boolean;
41
49
  export declare function isStakeLockedGame(game: Game | null | undefined): boolean;
42
50
  /** Why the stake is fixed, shown beside the locked figure. */
43
51
  export declare function stakeLockedNote(game: Game | null | undefined): string;
44
- export declare function quotedPayoutAtCount(game: Game | null | undefined, count: number, stake: number): number;
52
+ export declare function quotedPayoutAtCount(game: Game | null | undefined, count: number, stake: number, opts?: {
53
+ expectedCorrect?: number;
54
+ }): number;
55
+ export declare function roundQuotedPayout(amount: number, game?: Game | null): number;
@@ -39,7 +39,6 @@ export interface GameSetBetConfig {
39
39
  }
40
40
  /** Whether a game is a Game Set Bet (routes to the one-screen ticket builder). */
41
41
  export declare function isGameSetBetGame(game: Game | null | undefined): boolean;
42
- /** Price a ticket: total return incl. stake, exact to the cent — never rounded. */
43
42
  export declare function gameSetPrize(stake: number, legs: number, opts?: {
44
43
  operatorMargin?: number;
45
44
  perLegProbability?: number;
@@ -67,7 +67,7 @@ export declare function useCreateGameEntry(apiClient: BladeApiClient): {
67
67
  clearSubmitError: () => void;
68
68
  };
69
69
  export declare function usePlaceEntryFlow(initialGameId?: number): {
70
- step: "success" | "sport" | "game" | "confirm";
70
+ step: "sport" | "success" | "game" | "confirm";
71
71
  selectedGame: Game | null;
72
72
  selections: Record<number, "yes" | "no">;
73
73
  placedEntry: GameEntry | null;
@@ -0,0 +1,26 @@
1
+ export interface MenuPlacement {
2
+ top: number;
3
+ left: number;
4
+ maxHeight: number;
5
+ }
6
+ export interface MenuPlacementInput {
7
+ /** Trigger box, viewport coordinates (a `getBoundingClientRect()`). */
8
+ trigger: {
9
+ top: number;
10
+ bottom: number;
11
+ left: number;
12
+ right: number;
13
+ };
14
+ viewport: {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ /** How tall the menu is with every option shown. */
19
+ wanted: number;
20
+ width: number;
21
+ align: 'left' | 'right';
22
+ direction: 'down' | 'up';
23
+ /** Trim an over-tall menu to a whole number of rows. */
24
+ snap?: (space: number) => number;
25
+ }
26
+ export declare function placeMenu({ trigger, viewport, wanted, width, align, direction, snap, }: MenuPlacementInput): MenuPlacement;
@@ -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;
@@ -60,7 +62,7 @@ export declare function isMirrorGame(game: Game | null | undefined): boolean;
60
62
  /** Which mirror this game is. Unknown rules fall back to the straight one. */
61
63
  export declare function resolveMirrorVariantId(game: Game | null | undefined): MirrorVariantId;
62
64
  /**
63
- * 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.
64
66
  *
65
67
  * The prize is fixed at the fair 50/50 price — stake × (1 − margin) × 2^(N−1) —
66
68
  * so it is independent of `perLegProbability`; a skewed leg probability only
@@ -2,6 +2,8 @@ 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>;
7
9
  export declare function getCategoryTagline(category: string): string;
@@ -1,10 +1,12 @@
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
6
  export declare const SLIP_LEG_HINT = "Tap a leg to read it.";
7
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.";
8
10
  export declare const VIEW_LIST_GLYPH = "\u2630";
9
11
  export declare const VIEW_SWIPE_GLYPH = "\u21C6";
10
12
  export declare const VIEW_LIST_LABEL = "List view";
@@ -50,7 +52,10 @@ export declare function buildLiveSlip({ selections, order, minReq, maxReq, stake
50
52
  export declare function mergePickOrder(prev: number[], selections: Record<number, 'yes' | 'no'>): number[];
51
53
  /**
52
54
  * Dividend for a leg count, normalised to a $20 bet. Reads the game's own
53
- * `/max-payout` table, so it prices every game — not just the range ones the
54
- * overload callout covers.
55
+ * `/max-payout` table
55
56
  */
56
- 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;
@@ -32,7 +32,6 @@ export interface SelectionCaps {
32
32
  isCapped: (prop: Proposition) => boolean;
33
33
  /** Families already spent in a fixture — for the slot chips on its header. */
34
34
  filledFor: (key: string | null) => ReadonlySet<MarketFamily>;
35
- /** Slots to draw on a fixture header, in a fixed order. */
36
35
  slotsFor: (key: string | null) => {
37
36
  family: MarketFamily;
38
37
  label: string;
@@ -67,6 +67,12 @@ export interface Game {
67
67
  };
68
68
  };
69
69
  operator_margin?: number;
70
+ /**
71
+ * BLADE's quote-rounding switch: when true (or absent) quotes round to the
72
+ * nearest `payout_structure.round_to` (default $1); explicit false means the
73
+ * backend quotes exact and blade must not re-round.
74
+ */
75
+ round_payouts?: boolean;
70
76
  jackpot_enabled?: boolean;
71
77
  jackpot_amount?: number;
72
78
  jackpot_limit?: number | null;
@@ -326,6 +332,7 @@ export interface SportSelectorProps {
326
332
  onPropositionCountChange?: (count: number) => void;
327
333
  allowAnswerToggle?: boolean;
328
334
  headerExtra?: ReactNode;
335
+ railSlot?: ReactNode;
329
336
  /**
330
337
  * Which proposition layout to draw. Omitted (the default) is the packaged
331
338
  * matchup list; the variants are YESNO's fixture-first designs. Falls back to
@@ -7,7 +7,12 @@ 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[]>;
@@ -65,6 +70,11 @@ 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-parlay/components",
3
- "version": "1.30.6-pre.3",
3
+ "version": "1.30.6-pre.5",
4
4
  "description": "UI components, hooks, and utilities for React and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",