@simple-parlay/components 1.30.3 → 1.30.6-pre

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 (45) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.mjs +358 -297
  4. package/dist/react/components/EventSwipeModal.d.ts +19 -0
  5. package/dist/react/components/GameModeCard.d.ts +8 -0
  6. package/dist/react/components/PickerBrand.d.ts +7 -0
  7. package/dist/react/components/PlaceEntryProvider.d.ts +22 -3
  8. package/dist/react/components/ScrollShelf.d.ts +21 -0
  9. package/dist/react/components/SelectionVariantList.d.ts +20 -0
  10. package/dist/react/components/SelectionsPage.d.ts +1 -1
  11. package/dist/react/components/SixAgainPage.d.ts +16 -0
  12. package/dist/react/components/SportRail.d.ts +20 -0
  13. package/dist/react/components/SportSelector.d.ts +18 -1
  14. package/dist/react/components/_primitives/index.d.ts +3 -1
  15. package/dist/react/index.d.ts +15 -1
  16. package/dist/react/index.js +1 -1
  17. package/dist/react/index.mjs +358 -297
  18. package/dist/react-native/components/EventSwipeModal.d.ts +17 -0
  19. package/dist/react-native/components/GameModeCard.d.ts +9 -1
  20. package/dist/react-native/components/PickerBrand.d.ts +6 -0
  21. package/dist/react-native/components/PlaceEntryProvider.d.ts +24 -3
  22. package/dist/react-native/components/ScrollShelf.d.ts +16 -0
  23. package/dist/react-native/components/SelectionVariantList.d.ts +20 -0
  24. package/dist/react-native/components/SelectionsPage.d.ts +1 -1
  25. package/dist/react-native/components/SixAgainPage.d.ts +14 -0
  26. package/dist/react-native/components/SportRail.d.ts +21 -0
  27. package/dist/react-native/components/SportSelector.d.ts +23 -1
  28. package/dist/react-native/components/_primitives/index.d.ts +3 -1
  29. package/dist/react-native/index.d.ts +15 -1
  30. package/dist/react-native/index.js +1 -1
  31. package/dist/react-native/index.mjs +391 -336
  32. package/dist/shared/composite.d.ts +7 -0
  33. package/dist/shared/favourite-sport.d.ts +2 -0
  34. package/dist/shared/game-flow.d.ts +5 -1
  35. package/dist/shared/game-icons.d.ts +1 -1
  36. package/dist/shared/hooks.d.ts +1 -0
  37. package/dist/shared/mirror.d.ts +33 -0
  38. package/dist/shared/pick-your-dividend.d.ts +2 -1
  39. package/dist/shared/picker-brand.d.ts +6 -0
  40. package/dist/shared/selection-actions.d.ts +50 -0
  41. package/dist/shared/selection-variants.d.ts +48 -0
  42. package/dist/shared/six-again.d.ts +105 -0
  43. package/dist/shared/types.d.ts +40 -1
  44. package/dist/shared/utils.d.ts +1 -0
  45. package/package.json +2 -2
@@ -0,0 +1,17 @@
1
+ import { Proposition } from '../types';
2
+ /**
3
+ * Swipe one fixture's questions, over the card that opened it.
4
+ *
5
+ * The full `SwipeDeck` always swipes the whole proposition list and navigates
6
+ * on its own, so a per-fixture deck is composed from the same parts —
7
+ * `useSwipeDeck` for the queue, `SwipeCard`/`SwipeCardFace` for the cards —
8
+ * over just the props handed in. Silks and composite legs come with the face.
9
+ */
10
+ export interface EventSwipeModalProps {
11
+ /** The fixture's answerable questions, in card order. */
12
+ propositions: Proposition[];
13
+ /** Fixture label shown above the deck. */
14
+ title: string;
15
+ onClose: () => void;
16
+ }
17
+ export declare function EventSwipeModal({ propositions, title, onClose }: EventSwipeModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ViewStyle } from 'react-native';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
3
  /** Shared card kit for the unique-game pages — same anatomy as RuleSetupPage's ModeCard/EmblemTile. */
4
4
  export declare function hexA(color: string, alpha: number): string;
5
5
  /** Branded rounded tile carrying a game icon — the EmblemTile look, icon-driven. */
@@ -53,3 +53,11 @@ export declare function GameModeCard({ tile, label, stat, detail, onSelect, chil
53
53
  onSelect: () => void;
54
54
  children?: React.ReactNode;
55
55
  }): import("react/jsx-runtime").JSX.Element;
56
+ /**
57
+ * The sport step of a game's setup page — the one place in the flow the sport
58
+ * is chosen. Renders nothing when the game has a single sport, which is what
59
+ * lets those games skip the step entirely.
60
+ */
61
+ export declare function GameSportRow({ style }: {
62
+ style?: StyleProp<ViewStyle>;
63
+ }): import("react/jsx-runtime").JSX.Element;
@@ -24,3 +24,9 @@ export declare function YesNoCategoryLabel({ label, category, icon, theme, disab
24
24
  theme: BladeTheme;
25
25
  disabled?: boolean;
26
26
  }): import("react/jsx-runtime").JSX.Element;
27
+ export declare function StarIcon({ size, color, filled, }: {
28
+ size?: number;
29
+ color?: string;
30
+ /** Solid for a pinned favourite, outline for one you can pin. */
31
+ filled?: boolean;
32
+ }): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,8 @@ import { default as React } from 'react';
2
2
  import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
3
3
  import { BladeTheme, BladeThemeSet, ColorScheme } from '../utils/themes';
4
4
  import { SportDisplayNameOverrides, CategoryDisplayNameOverrides } from '../utils';
5
- import { RenderTeamLogo, GamePermittedRule } from '../../shared/types';
5
+ import { RenderTeamLogo, RenderPropositionSilk, GamePermittedRule } from '../../shared/types';
6
+ import { SelectionVariant } from '../../shared/selection-variants';
6
7
  import { SameGameMultiEvent } from '../../shared/same-game-multi';
7
8
  export interface PlaceEntryContextValue {
8
9
  theme: BladeTheme;
@@ -10,8 +11,16 @@ export interface PlaceEntryContextValue {
10
11
  headingFont: string;
11
12
  games: Game[];
12
13
  propositions: Proposition[];
14
+ /** Component legs of composite propositions, by id — for per-leg event labels. */
15
+ compositeComponentById: ReadonlyMap<number, Proposition>;
13
16
  propositionsForCategoryPicker: Proposition[];
14
17
  propositionsForSportPicker: Proposition[];
18
+ sportsForSelectedGame: string[];
19
+ /** The sports the switcher can offer, busiest first, with their pick counts. */
20
+ sportOptions: {
21
+ key: string;
22
+ count: number;
23
+ }[];
15
24
  sportSummaries: SportSummary[];
16
25
  loading: boolean;
17
26
  error: string | null;
@@ -51,7 +60,7 @@ export interface PlaceEntryContextValue {
51
60
  reset: () => void;
52
61
  clearSelectedGame: () => void;
53
62
  toggleSelection: (id: number, answer: 'yes' | 'no') => void;
54
- quickPickGame: (game: Game, count: number) => void;
63
+ quickPickGame: (game: Game, count: number, stake?: number) => void;
55
64
  selectedCategory: string | null;
56
65
  setSelectedCategory: (category: string | null) => void;
57
66
  selectedSport: string | null;
@@ -66,6 +75,13 @@ export interface PlaceEntryContextValue {
66
75
  userId?: string | number;
67
76
  disableQuickPick: boolean;
68
77
  renderTeamLogo?: RenderTeamLogo;
78
+ renderPropositionSilk?: RenderPropositionSilk;
79
+ /** Proposition layout for the selection screens; undefined = the packaged list. */
80
+ selectionVariant?: SelectionVariant;
81
+ /** Drop the per-fixture swipe deck the variant layouts offer. */
82
+ disableEventSwipe?: boolean;
83
+ /** Let players star a sport in the rail to pin it up front (per device). Off by default. */
84
+ enableSportFavourites?: boolean;
69
85
  filterSport?: string;
70
86
  initialSport?: string;
71
87
  initialEventId?: string;
@@ -116,6 +132,11 @@ export interface PlaceEntryProviderProps {
116
132
  sportBaseKey?: string;
117
133
  disableQuickPick?: boolean;
118
134
  renderTeamLogo?: RenderTeamLogo;
135
+ renderPropositionSilk?: RenderPropositionSilk;
136
+ selectionVariant?: SelectionVariant;
137
+ disableEventSwipe?: boolean;
138
+ /** Let players star a sport in the rail to pin it up front (per device). Off by default. */
139
+ enableSportFavourites?: boolean;
119
140
  onEntryPlaced?: (entry: GameEntry) => void;
120
141
  onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
121
142
  onCancel?: () => void;
@@ -127,4 +148,4 @@ export interface PlaceEntryProviderProps {
127
148
  sportDisplayNames?: SportDisplayNameOverrides;
128
149
  categoryDisplayNames?: CategoryDisplayNameOverrides;
129
150
  }
130
- export declare function PlaceEntryProvider({ apiUrl, apiKey, fetchImpl, getAuthHeaders, userId, getUserBalance, children, theme: themeProp, colorScheme, demoGames, demoPropositions, demoEntries, demoMaxPayouts, gameCategory, jurisdiction, initialGameId, filterSport, initialSport, initialEventId, initialEventLabel, sportBaseKey, disableQuickPick, renderTeamLogo, onEntryPlaced, onBeforeSubmit, onCancel, onShare, onRecharge, onClearEventFilter, screenSize, howToPlayMarkdown: howToPlayMarkdownProp, sportDisplayNames, categoryDisplayNames, }: PlaceEntryProviderProps): import("react/jsx-runtime").JSX.Element;
151
+ export declare function PlaceEntryProvider({ apiUrl, apiKey, fetchImpl, getAuthHeaders, userId, getUserBalance, children, theme: themeProp, colorScheme, demoGames, demoPropositions, demoEntries, demoMaxPayouts, gameCategory, jurisdiction, initialGameId, filterSport, initialSport, initialEventId, initialEventLabel, sportBaseKey, disableQuickPick, renderTeamLogo, renderPropositionSilk, selectionVariant, disableEventSwipe, enableSportFavourites, onEntryPlaced, onBeforeSubmit, onCancel, onShare, onRecharge, onClearEventFilter, screenSize, howToPlayMarkdown: howToPlayMarkdownProp, sportDisplayNames, categoryDisplayNames, }: PlaceEntryProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { ViewStyle, StyleProp } from 'react-native';
3
+ import { BladeTheme } from '../types';
4
+ export interface ScrollShelfProps {
5
+ theme: BladeTheme;
6
+ /** Padding/gap for the row's content — cards need more room than chips. */
7
+ contentContainerStyle?: StyleProp<ViewStyle>;
8
+ style?: StyleProp<ViewStyle>;
9
+ children: React.ReactNode;
10
+ }
11
+ /**
12
+ * The horizontal shelf every picker row sits in: edge arrow discs once there is
13
+ * more in that direction. Shared so the filter chips and the sport rail scroll
14
+ * identically.
15
+ */
16
+ export declare function ScrollShelf({ theme, contentContainerStyle, style, children, }: ScrollShelfProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { Proposition } from '../types';
2
+ import { BladeTheme } from '../../shared/themes';
3
+ import { SelectionVariant } from '../../shared/selection-variants';
4
+ import { RenderTeamLogo } from '../../shared/types';
5
+ export interface SelectionVariantListProps {
6
+ variant: SelectionVariant;
7
+ /** Already filtered and grouped by `groupPropositionsForDisplay`. */
8
+ groups: Record<string, Proposition[]>;
9
+ racing: boolean;
10
+ selections: Record<number, 'yes' | 'no'>;
11
+ onToggleSelection: (id: number, answer: 'yes' | 'no') => void;
12
+ /** True once the game's leg cap is full — unanswered props go quiet. */
13
+ atMax: boolean;
14
+ theme: BladeTheme;
15
+ renderTeamLogo?: RenderTeamLogo;
16
+ componentById?: ReadonlyMap<number, Proposition>;
17
+ /** Drop the per-fixture swipe deck, leaving the rows as the only way to answer. */
18
+ disableEventSwipe?: boolean;
19
+ }
20
+ export declare function SelectionVariantList({ variant, groups, racing, selections, onToggleSelection, atMax, theme, renderTeamLogo, componentById, disableEventSwipe, }: SelectionVariantListProps): import("react/jsx-runtime").JSX.Element;
@@ -19,7 +19,7 @@ export declare function SelectionsPageTitle({ onBack, onNext, hideActions }?: {
19
19
  onNext?: () => void;
20
20
  hideActions?: boolean;
21
21
  }): import("react/jsx-runtime").JSX.Element;
22
- /** Renders selection progress indicator. Must be inside `<PlaceEntryProvider>`. */
22
+ /** Renders the live bet slip. Must be inside `<PlaceEntryProvider>`. */
23
23
  export declare function SelectionsPageActions({ onNext, onBack, hideButtons, }: {
24
24
  onNext?: () => void;
25
25
  onBack?: () => void;
@@ -0,0 +1,14 @@
1
+ import { SixAgainConfig } from '../../shared/six-again';
2
+ export interface SixAgainPageProps {
3
+ onQuickPick?: () => void;
4
+ onPickYourOwn?: () => void;
5
+ onBack?: () => void;
6
+ hideTitle?: boolean;
7
+ config?: SixAgainConfig | null;
8
+ backLabel?: string;
9
+ }
10
+ export declare function SixAgainPageTitle({ onBack, hideActions, }?: {
11
+ onBack?: () => void;
12
+ hideActions?: boolean;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export declare function SixAgainPage({ onQuickPick, onPickYourOwn, onBack, hideTitle, config: configOverride, backLabel, }: SixAgainPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ export interface SportRailProps {
4
+ /** Heading above the rail. Pass `null` to drop it. @default 'Pick your sport' */
5
+ label?: string | null;
6
+ /** Line under the heading. Pass `null` to drop it; omit for the default hint. */
7
+ sublabel?: string | null;
8
+ /** Custom renderer for the sport tile. */
9
+ renderSportLogo?: (sportKey: string) => React.ReactNode;
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+ /**
13
+ * The sport step, and the only place the sport is chosen: it sits on the game's
14
+ * setup page, after the game and before the picks. The game page never shows it
15
+ * — a sport picked up front just scopes the game list — and the selections show
16
+ * the sport read-only, with a Change that comes back here.
17
+ *
18
+ * Renders nothing at all when the sport is not a choice, which is every
19
+ * single-sport game.
20
+ */
21
+ export declare function SportRail({ label, sublabel, renderSportLogo, style }: SportRailProps): import("react/jsx-runtime").JSX.Element | null;
@@ -12,4 +12,26 @@ export declare function MatchupTeams({ matchup, renderTeamLogo, altText, mutedCo
12
12
  mutedColor: string;
13
13
  size?: 'sm' | 'md';
14
14
  }): import("react/jsx-runtime").JSX.Element;
15
- export declare function SportSelector({ game, propositions, selections, onToggleSelection, onNext, onBack, loading, error, theme: themeProp, colorScheme, hideActions, initialSport, renderTeamLogo, disableQuickPick, selectedPropositionCount, onPropositionCountChange, gameCategory, headerExtra, }: SportSelectorProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CompositePropositionText({ prop, colors: c, size, componentById, textStyle, textColor, }: {
16
+ prop: Proposition;
17
+ colors: {
18
+ primary: string;
19
+ text: string;
20
+ textMuted?: string;
21
+ textAltMuted?: string;
22
+ backgroundAlt?: string;
23
+ border?: string;
24
+ };
25
+ size?: 'sm' | 'md';
26
+ componentById?: ReadonlyMap<number, Proposition>;
27
+ /** Replaces the size-derived type — the variant layouts set their own. */
28
+ textStyle?: {
29
+ fontSize: number;
30
+ fontWeight: '400' | '500' | '600' | '700';
31
+ lineHeight?: number;
32
+ textAlign?: 'left' | 'center';
33
+ };
34
+ /** Replaces `colors.text` on the question itself, legs included. */
35
+ textColor?: string;
36
+ }): import("react/jsx-runtime").JSX.Element;
37
+ export declare function SportSelector({ game, propositions, selections, onToggleSelection, onNext, onBack, loading, error, theme: themeProp, colorScheme, hideActions, initialSport, renderTeamLogo, disableQuickPick, selectedPropositionCount, onPropositionCountChange, gameCategory, headerExtra, variant, disableEventSwipe, }: SportSelectorProps): import("react/jsx-runtime").JSX.Element;
@@ -85,13 +85,15 @@ export interface YesNoButtonsProps {
85
85
  onYes?: () => void;
86
86
  onNo?: () => void;
87
87
  size?: YesNoSize;
88
+ /** Fill the row, each side taking half — the roomy card layouts want this. */
89
+ stretch?: boolean;
88
90
  disabled?: boolean;
89
91
  yesLabel?: string;
90
92
  noLabel?: string;
91
93
  style?: StyleProp<ViewStyle>;
92
94
  }
93
95
  /** The interactive Yes/No pair. Identical everywhere it is used. */
94
- export declare function YesNoButtons({ theme, value, onYes, onNo, size, disabled, yesLabel, noLabel, style, }: YesNoButtonsProps): import("react/jsx-runtime").JSX.Element;
96
+ export declare function YesNoButtons({ theme, value, onYes, onNo, size, stretch, disabled, yesLabel, noLabel, style, }: YesNoButtonsProps): import("react/jsx-runtime").JSX.Element;
95
97
  /** Read-only Yes/No chip — the settled answer, same product tokens. */
96
98
  export declare function YesNoTag({ theme, value, size, style, }: {
97
99
  theme: BladeTheme;
@@ -19,6 +19,12 @@ export { EventFilterBanner } from './components/EventFilterBanner';
19
19
  export type { EventFilterBannerProps } from './components/EventFilterBanner';
20
20
  export { SelectionsPage, SelectionsPageTitle, SelectionsPageActions } from './components/SelectionsPage';
21
21
  export type { SelectionsPageProps, SelectionsView } from './components/SelectionsPage';
22
+ export { SelectionVariantList } from './components/SelectionVariantList';
23
+ export type { SelectionVariantListProps } from './components/SelectionVariantList';
24
+ export { EventSwipeModal } from './components/EventSwipeModal';
25
+ export type { EventSwipeModalProps } from './components/EventSwipeModal';
26
+ export { SELECTION_VARIANTS, groupSelectionDays } from '../shared/selection-variants';
27
+ export type { SelectionVariant, SelectionDay, SelectionEvent } from '../shared/selection-variants';
22
28
  export { SwipeDeck, SwipeCard, SwipeCardFace } from './components/SwipeDeck';
23
29
  export type { SwipeDeckProps, SwipeCardProps, SwipeCardFaceProps, SwipeCardApi, FlyDirection, } from './components/SwipeDeck';
24
30
  export { useSwipeDeck, VISIBLE_DEPTH } from '../shared/swipe-deck';
@@ -29,6 +35,10 @@ export { SuccessPage, SuccessPageTitle, SuccessPageActions } from './components/
29
35
  export type { SuccessPageProps } from './components/SuccessPage';
30
36
  export { EntriesPage, EntriesPageTitle } from './components/EntriesPage';
31
37
  export type { EntriesPageProps } from './components/EntriesPage';
38
+ export { SportRail } from './components/SportRail';
39
+ export type { SportRailProps } from './components/SportRail';
40
+ export { ScrollShelf } from './components/ScrollShelf';
41
+ export type { ScrollShelfProps } from './components/ScrollShelf';
32
42
  export { SportPickerPage, SportPickerPageTitle, SportPickerPageActions } from './components/SportPickerPage';
33
43
  export type { SportPickerPageProps } from './components/SportPickerPage';
34
44
  export { CategoryPickerPage, CategoryPickerPageTitle, CategoryPickerPageActions } from './components/CategoryPickerPage';
@@ -59,6 +69,10 @@ export { SafetyNetPage, SafetyNetPageTitle } from './components/SafetyNetPage';
59
69
  export type { SafetyNetPageProps } from './components/SafetyNetPage';
60
70
  export { getSafetyNetConfig, getSafetyNetPricing, isSafetyNetGame, safetyNetTicket, safetyNetCollect, EXTRA_SHOT_MIN_LEGS, DOUBLE_SHOT_MIN_LEGS, } from '../shared/safety-net';
61
71
  export type { SafetyNetConfig, SafetyNetMode, SafetyNetModeId, SafetyNetPricing, SafetyNetTicket, } from '../shared/safety-net';
72
+ export { SixAgainPage, SixAgainPageTitle } from './components/SixAgainPage';
73
+ export type { SixAgainPageProps } from './components/SixAgainPage';
74
+ export { getSixAgainConfig, isSixAgainGame, sixAgainTicket, sixAgainRuleId, sixAgainStakeMultiples, NO_BOOSTS, SIX_AGAIN_MARGIN, SIX_AGAIN_LEGS, CHALLENGE_MULTIPLE, CHALLENGE_MISSES, GOLDEN_POINT_FACTOR, } from '../shared/six-again';
75
+ export type { SixAgainConfig, SixAgainTicket, SixAgainBoost, SixAgainBoostId, SixAgainBoosts, } from '../shared/six-again';
62
76
  export { getGameFlow, getConfirmBoostCopy, isFixedCardExactGame, isOpenExactMultiGame } from '../shared/game-flow';
63
77
  export { GAME_TIER_LEVEL, GAME_TIER_TABS, resolveGameTierLevel, filterGamesByTierLevel, availableGameTierTabs, defaultGameTierId, } from '../shared/game-tiers';
64
78
  export type { GameTierId } from '../shared/game-tiers';
@@ -73,7 +87,7 @@ export { BrandLockup } from './components/BrandLockup';
73
87
  export type { BrandLockupProps } from './components/BrandLockup';
74
88
  export { GameLogo } from './components/GameLogo';
75
89
  export type { GameLogoProps } from './components/GameLogo';
76
- export { YesNoCategoryLabel, CategoryIcon, ChevronRightIcon, LockIcon } from './components/PickerBrand';
90
+ export { YesNoCategoryLabel, CategoryIcon, ChevronRightIcon, LockIcon, StarIcon } from './components/PickerBrand';
77
91
  export type { Game, SportSummary, Proposition, GameEntry, RuleExpressionObject, PlaceEntryFlowProps, GameSelectorProps, EntrySubmissionProps, SelectionReviewProps, GameEntriesProps, ResolvedEntryData, ShareData, PendingBet, ScreenSize, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, } from './types';
78
92
  export { BladeApiClient } from './utils/api-client';
79
93
  export type { BladeApiClientConfig } from './utils/api-client';