@simple-parlay/components 1.29.0
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.
- package/LICENSE +71 -0
- package/README.md +196 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +325 -0
- package/dist/react/components/BrandLockup.d.ts +18 -0
- package/dist/react/components/BrandLogo.d.ts +17 -0
- package/dist/react/components/CategoryPickerPage.d.ts +22 -0
- package/dist/react/components/ConfirmPage.d.ts +23 -0
- package/dist/react/components/EntriesPage.d.ts +19 -0
- package/dist/react/components/EntrySubmission.d.ts +2 -0
- package/dist/react/components/EventFilterBanner.d.ts +4 -0
- package/dist/react/components/EventPickerPage.d.ts +5 -0
- package/dist/react/components/GameEntries.d.ts +2 -0
- package/dist/react/components/GameLogo.d.ts +10 -0
- package/dist/react/components/GameModeCard.d.ts +34 -0
- package/dist/react/components/GamePage.d.ts +36 -0
- package/dist/react/components/GameSelector.d.ts +2 -0
- package/dist/react/components/GameSetBetPage.d.ts +21 -0
- package/dist/react/components/GameSetupPage.d.ts +27 -0
- package/dist/react/components/HowToPlayButton.d.ts +28 -0
- package/dist/react/components/HowToPlayPropsTable.d.ts +6 -0
- package/dist/react/components/HtmlContent.d.ts +5 -0
- package/dist/react/components/IconSvg.d.ts +11 -0
- package/dist/react/components/LadderPage.d.ts +21 -0
- package/dist/react/components/LoadingIndicators.d.ts +67 -0
- package/dist/react/components/MarkdownContent.d.ts +13 -0
- package/dist/react/components/MirrorPage.d.ts +21 -0
- package/dist/react/components/MultiLegTable.d.ts +40 -0
- package/dist/react/components/PageBackButton.d.ts +13 -0
- package/dist/react/components/PayoutCircles.d.ts +15 -0
- package/dist/react/components/PerfectPickPage.d.ts +22 -0
- package/dist/react/components/PickYourDividendPage.d.ts +21 -0
- package/dist/react/components/PickerBrand.d.ts +19 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +137 -0
- package/dist/react/components/PressToPlayTile.d.ts +14 -0
- package/dist/react/components/QuickPickButton.d.ts +11 -0
- package/dist/react/components/QuickPickMenu.d.ts +17 -0
- package/dist/react/components/RuleSetupPage.d.ts +27 -0
- package/dist/react/components/SelectionReview.d.ts +2 -0
- package/dist/react/components/SelectionsPage.d.ts +25 -0
- package/dist/react/components/SportPickerPage.d.ts +27 -0
- package/dist/react/components/SportSelector.d.ts +2 -0
- package/dist/react/components/SuccessPage.d.ts +27 -0
- package/dist/react/components/_primitives/index.d.ts +91 -0
- package/dist/react/hooks/index.d.ts +1 -0
- package/dist/react/index.d.ts +74 -0
- package/dist/react/index.js +1 -0
- package/dist/react/index.mjs +325 -0
- package/dist/react/types/index.d.ts +8 -0
- package/dist/react/utils/api-client.d.ts +2 -0
- package/dist/react/utils/design.d.ts +55 -0
- package/dist/react/utils/dummy-data.d.ts +1 -0
- package/dist/react/utils/index.d.ts +2 -0
- package/dist/react/utils/themes.d.ts +13 -0
- package/dist/react-native/components/BrandLockup.d.ts +17 -0
- package/dist/react-native/components/BrandLogo.d.ts +16 -0
- package/dist/react-native/components/CategoryPickerPage.d.ts +17 -0
- package/dist/react-native/components/ConfirmPage.d.ts +19 -0
- package/dist/react-native/components/EntriesPage.d.ts +14 -0
- package/dist/react-native/components/EntrySubmission.d.ts +2 -0
- package/dist/react-native/components/EventFilterBanner.d.ts +4 -0
- package/dist/react-native/components/EventPickerPage.d.ts +4 -0
- package/dist/react-native/components/GameEntries.d.ts +2 -0
- package/dist/react-native/components/GameLogo.d.ts +9 -0
- package/dist/react-native/components/GameModeCard.d.ts +33 -0
- package/dist/react-native/components/GamePage.d.ts +33 -0
- package/dist/react-native/components/GameSelector.d.ts +2 -0
- package/dist/react-native/components/GameSetBetPage.d.ts +19 -0
- package/dist/react-native/components/GameSetupPage.d.ts +26 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +17 -0
- package/dist/react-native/components/IconSvg.d.ts +9 -0
- package/dist/react-native/components/LadderPage.d.ts +19 -0
- package/dist/react-native/components/LoadingIndicators.d.ts +62 -0
- package/dist/react-native/components/MirrorPage.d.ts +19 -0
- package/dist/react-native/components/MultiLegTable.d.ts +37 -0
- package/dist/react-native/components/NativeMenuOverlay.d.ts +32 -0
- package/dist/react-native/components/PageBackButton.d.ts +25 -0
- package/dist/react-native/components/PayoutCircles.d.ts +14 -0
- package/dist/react-native/components/PerfectPickPage.d.ts +20 -0
- package/dist/react-native/components/PickYourDividendPage.d.ts +19 -0
- package/dist/react-native/components/PickerBrand.d.ts +18 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +129 -0
- package/dist/react-native/components/PressToPlayTile.d.ts +13 -0
- package/dist/react-native/components/QuickPickButton.d.ts +11 -0
- package/dist/react-native/components/QuickPickMenu.d.ts +17 -0
- package/dist/react-native/components/RuleSetupPage.d.ts +23 -0
- package/dist/react-native/components/SelectionReview.d.ts +2 -0
- package/dist/react-native/components/SelectionsPage.d.ts +22 -0
- package/dist/react-native/components/SportPickerPage.d.ts +20 -0
- package/dist/react-native/components/SportSelector.d.ts +2 -0
- package/dist/react-native/components/SuccessPage.d.ts +24 -0
- package/dist/react-native/components/_primitives/index.d.ts +93 -0
- package/dist/react-native/hooks/index.d.ts +1 -0
- package/dist/react-native/index.d.ts +72 -0
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/index.mjs +334 -0
- package/dist/react-native/types/index.d.ts +1 -0
- package/dist/react-native/utils/api-client.d.ts +2 -0
- package/dist/react-native/utils/dummy-data.d.ts +1 -0
- package/dist/react-native/utils/index.d.ts +2 -0
- package/dist/react-native/utils/themes.d.ts +5 -0
- package/dist/shared/api-client.d.ts +73 -0
- package/dist/shared/composite.d.ts +44 -0
- package/dist/shared/date-filters.d.ts +25 -0
- package/dist/shared/dummy-data.d.ts +9 -0
- package/dist/shared/game-flow.d.ts +39 -0
- package/dist/shared/game-icons.d.ts +10 -0
- package/dist/shared/game-set-bet.d.ts +48 -0
- package/dist/shared/game-tiers.d.ts +23 -0
- package/dist/shared/hooks.d.ts +100 -0
- package/dist/shared/how-to-play-html.d.ts +12 -0
- package/dist/shared/how-to-play-logo.d.ts +2 -0
- package/dist/shared/how-to-play-props-table.d.ts +21 -0
- package/dist/shared/how-to-play-styles.d.ts +2 -0
- package/dist/shared/ladder.d.ts +53 -0
- package/dist/shared/markdown.d.ts +24 -0
- package/dist/shared/mirror.d.ts +66 -0
- package/dist/shared/pick-your-dividend.d.ts +59 -0
- package/dist/shared/picker-brand.d.ts +11 -0
- package/dist/shared/rule-setup.d.ts +75 -0
- package/dist/shared/same-game-multi.d.ts +22 -0
- package/dist/shared/themes.d.ts +164 -0
- package/dist/shared/tokens.d.ts +64 -0
- package/dist/shared/types.d.ts +397 -0
- package/dist/shared/utils.d.ts +118 -0
- package/package.json +101 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
|
|
3
|
+
import { BladeTheme, BladeThemeSet, ColorScheme } from '../utils/themes';
|
|
4
|
+
import { SportDisplayNameOverrides, CategoryDisplayNameOverrides } from '../utils';
|
|
5
|
+
import { RenderTeamLogo } from '../../shared/types';
|
|
6
|
+
import { SameGameMultiEvent } from '../../shared/same-game-multi';
|
|
7
|
+
export interface PlaceEntryContextValue {
|
|
8
|
+
theme: BladeTheme;
|
|
9
|
+
bodyFont: string;
|
|
10
|
+
headingFont: string;
|
|
11
|
+
games: Game[];
|
|
12
|
+
propositions: Proposition[];
|
|
13
|
+
propositionsForCategoryPicker: Proposition[];
|
|
14
|
+
propositionsForSportPicker: Proposition[];
|
|
15
|
+
sportSummaries: SportSummary[];
|
|
16
|
+
loading: boolean;
|
|
17
|
+
error: string | null;
|
|
18
|
+
step: 'game' | 'sport' | 'review' | 'confirm' | 'success';
|
|
19
|
+
selectedGame: Game | null;
|
|
20
|
+
selections: Record<number, 'yes' | 'no'>;
|
|
21
|
+
placedEntry: GameEntry | null;
|
|
22
|
+
selectedPropositionIds: number[];
|
|
23
|
+
selectedPropositions: Proposition[];
|
|
24
|
+
selectionValid: boolean;
|
|
25
|
+
answeredCount: number;
|
|
26
|
+
betAmount: number;
|
|
27
|
+
setBetAmount: (v: number) => void;
|
|
28
|
+
expectedCorrect: number;
|
|
29
|
+
setExpectedCorrect: (v: number) => void;
|
|
30
|
+
selectedPropositionCount: number | undefined;
|
|
31
|
+
handlePropositionCountChange: (count: number) => void;
|
|
32
|
+
upgradePropositionCount: (count: number) => void;
|
|
33
|
+
winningCounts: number[];
|
|
34
|
+
payouts: Record<number, number>;
|
|
35
|
+
overloadPayouts: Record<number, number>;
|
|
36
|
+
submitting: boolean;
|
|
37
|
+
submitError: string | null;
|
|
38
|
+
canSubmit: boolean;
|
|
39
|
+
gamePrice: number;
|
|
40
|
+
userBalance?: number;
|
|
41
|
+
hasSufficientBalance: boolean;
|
|
42
|
+
refreshUserBalance: () => Promise<void>;
|
|
43
|
+
handleSubmit: () => Promise<void>;
|
|
44
|
+
selectGame: (game: Game) => void;
|
|
45
|
+
goToSportSelection: () => void;
|
|
46
|
+
goToConfirmation: () => void;
|
|
47
|
+
goBack: () => void;
|
|
48
|
+
reset: () => void;
|
|
49
|
+
clearSelectedGame: () => void;
|
|
50
|
+
toggleSelection: (id: number, answer: 'yes' | 'no') => void;
|
|
51
|
+
quickPickGame: (game: Game, count: number) => void;
|
|
52
|
+
selectedCategory: string | null;
|
|
53
|
+
setSelectedCategory: (category: string | null) => void;
|
|
54
|
+
selectedSport: string | null;
|
|
55
|
+
setSelectedSport: (sport: string | null) => void;
|
|
56
|
+
selectedEventId: string | null;
|
|
57
|
+
sameGameMultiEvents: SameGameMultiEvent[];
|
|
58
|
+
selectSameGameMultiEvent: (eventId: string | null) => void;
|
|
59
|
+
apiUrl: string;
|
|
60
|
+
apiKey?: string;
|
|
61
|
+
fetchImpl?: typeof fetch;
|
|
62
|
+
getAuthHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
63
|
+
userId?: string | number;
|
|
64
|
+
showHomeAway: boolean;
|
|
65
|
+
disableQuickPick: boolean;
|
|
66
|
+
renderTeamLogo?: RenderTeamLogo;
|
|
67
|
+
filterSport?: string;
|
|
68
|
+
initialSport?: string;
|
|
69
|
+
initialEventId?: string;
|
|
70
|
+
initialEventLabel?: string;
|
|
71
|
+
sportBaseKey?: string;
|
|
72
|
+
gameCategory?: 'sports' | 'casino' | 'racing';
|
|
73
|
+
screenSize: ScreenSize;
|
|
74
|
+
eventFilterActive: boolean;
|
|
75
|
+
eventFilterLabel?: string;
|
|
76
|
+
clearEventFilter: () => void;
|
|
77
|
+
/** Resolve a sport key to its UI label (host overrides applied). */
|
|
78
|
+
displaySportName: (sport: string) => string;
|
|
79
|
+
/** Resolve an entry category to its UI label (host overrides applied). */
|
|
80
|
+
displayCategoryName: (category: string) => string;
|
|
81
|
+
maxPayouts: Record<number, TopPayoutsResponse>;
|
|
82
|
+
howToPlayMarkdown: string | null;
|
|
83
|
+
onEntryPlaced?: (entry: GameEntry) => void;
|
|
84
|
+
onCancel?: () => void;
|
|
85
|
+
onShare?: (data: ShareData) => void;
|
|
86
|
+
onRecharge?: () => void;
|
|
87
|
+
demoEntries?: GameEntry[];
|
|
88
|
+
demoGames?: Game[];
|
|
89
|
+
demoPropositions?: Proposition[];
|
|
90
|
+
}
|
|
91
|
+
export declare const PlaceEntryContext: React.Context<PlaceEntryContextValue | null>;
|
|
92
|
+
/**
|
|
93
|
+
* Hook to consume the PlaceEntry context.
|
|
94
|
+
* Must be used inside a `<PlaceEntryProvider>`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function usePlaceEntry(): PlaceEntryContextValue;
|
|
97
|
+
export interface PlaceEntryProviderProps {
|
|
98
|
+
apiUrl: string;
|
|
99
|
+
apiKey?: string;
|
|
100
|
+
fetchImpl?: typeof fetch;
|
|
101
|
+
getAuthHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
102
|
+
userId?: string | number;
|
|
103
|
+
getUserBalance?: () => Promise<number> | number;
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
theme?: BladeTheme | BladeThemeSet;
|
|
106
|
+
colorScheme?: ColorScheme;
|
|
107
|
+
/** Supply demo/test data instead of hitting the API */
|
|
108
|
+
demoGames?: Game[];
|
|
109
|
+
demoPropositions?: Proposition[];
|
|
110
|
+
demoEntries?: GameEntry[];
|
|
111
|
+
/** Demo dividend/max-payout data (the /max-payout fetch is skipped for demo data). */
|
|
112
|
+
demoMaxPayouts?: Record<number, TopPayoutsResponse>;
|
|
113
|
+
gameCategory?: 'sports' | 'casino' | 'racing';
|
|
114
|
+
jurisdiction?: string;
|
|
115
|
+
initialGameId?: number;
|
|
116
|
+
filterSport?: string;
|
|
117
|
+
initialSport?: string;
|
|
118
|
+
initialEventId?: string;
|
|
119
|
+
initialEventLabel?: string;
|
|
120
|
+
sportBaseKey?: string;
|
|
121
|
+
showHomeAway?: boolean;
|
|
122
|
+
disableQuickPick?: boolean;
|
|
123
|
+
renderTeamLogo?: RenderTeamLogo;
|
|
124
|
+
onEntryPlaced?: (entry: GameEntry) => void;
|
|
125
|
+
onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
|
|
126
|
+
onCancel?: () => void;
|
|
127
|
+
onShare?: (data: ShareData) => void;
|
|
128
|
+
onRecharge?: () => void;
|
|
129
|
+
onClearEventFilter?: () => void;
|
|
130
|
+
screenSize?: ScreenSize;
|
|
131
|
+
howToPlayMarkdown?: string | null;
|
|
132
|
+
/** Map sport keys to UI labels (e.g. `basketball_nba` → `NBA`). */
|
|
133
|
+
sportDisplayNames?: SportDisplayNameOverrides;
|
|
134
|
+
/** Map entry categories to UI labels. */
|
|
135
|
+
categoryDisplayNames?: CategoryDisplayNameOverrides;
|
|
136
|
+
}
|
|
137
|
+
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, showHomeAway, disableQuickPick, renderTeamLogo, onEntryPlaced, onBeforeSubmit, onCancel, onShare, onRecharge, onClearEventFilter, screenSize, howToPlayMarkdown: howToPlayMarkdownProp, sportDisplayNames, categoryDisplayNames, }: PlaceEntryProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PressToPlayTileProps {
|
|
2
|
+
iconUrl: string;
|
|
3
|
+
gameName: string;
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
size?: number;
|
|
6
|
+
brandColor?: string;
|
|
7
|
+
cardColor?: string;
|
|
8
|
+
iconColor?: string;
|
|
9
|
+
accentColor?: string;
|
|
10
|
+
captionColor?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function PressToPlayTile({ iconUrl, gameName, onPress, size, brandColor, cardColor, iconColor, accentColor, captionColor, className, ariaLabel, }: PressToPlayTileProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BladeTheme } from '../types';
|
|
2
|
+
export interface QuickPickButtonProps {
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
onDoubleClick?: () => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
size?: 'md' | 'sm';
|
|
7
|
+
yesColor?: string;
|
|
8
|
+
noColor?: string;
|
|
9
|
+
theme?: BladeTheme;
|
|
10
|
+
}
|
|
11
|
+
export declare function QuickPickButton({ onPress, onDoubleClick, label, size, yesColor, noColor, theme: themeProp, }: QuickPickButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface QuickPickMenuColors {
|
|
2
|
+
background: string;
|
|
3
|
+
backgroundAlt: string;
|
|
4
|
+
border: string;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export interface QuickPickMenuProps {
|
|
8
|
+
counts: number[];
|
|
9
|
+
onPick: (count: number) => void;
|
|
10
|
+
onDoubleAction?: () => void;
|
|
11
|
+
colors: QuickPickMenuColors;
|
|
12
|
+
align?: 'left' | 'right';
|
|
13
|
+
direction?: 'down' | 'up';
|
|
14
|
+
/** Themed elevation for the dropdown (pass `elevatedShadow(theme)`). */
|
|
15
|
+
menuShadow?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function QuickPickMenu({ counts, onPick, onDoubleAction, colors, align, direction, menuShadow }: QuickPickMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RuleSetupConfig, RuleSetupOption } from '../../shared/rule-setup';
|
|
3
|
+
export interface RuleSetupPageProps {
|
|
4
|
+
onContinue?: () => void;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
/** Hide the built-in title section (use `<RuleSetupPageTitle />` separately). The game lockup always renders in the page body. */
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
hideActions?: boolean;
|
|
9
|
+
config?: RuleSetupConfig | null;
|
|
10
|
+
/** Render a custom dividends table on the option card */
|
|
11
|
+
renderDividends?: (option: RuleSetupOption) => React.ReactNode;
|
|
12
|
+
/** Label for the back link (where "back" leads). @default 'Games' */
|
|
13
|
+
backLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function RuleSetupPageTitle({ className, onBack, hideActions, }: {
|
|
17
|
+
className?: string;
|
|
18
|
+
onBack?: () => void;
|
|
19
|
+
hideActions?: boolean;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function RuleSetupPageActions({ onContinue, canContinue, continueLabel, className, }: {
|
|
22
|
+
onContinue?: () => void;
|
|
23
|
+
canContinue?: boolean;
|
|
24
|
+
continueLabel?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export declare function RuleSetupPage({ onContinue, onBack, hideTitle, config: configOverride, renderDividends, backLabel, className, }: RuleSetupPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SelectionReviewProps } from '../types';
|
|
2
|
+
export declare function SelectionReview({ propositions, selections, onToggleSelection, onNext, onBack, theme: themeProp, colorScheme, hideActions, renderTeamLogo, showHomeAway, allowAnswerToggle, gameName, potentialPayout, defaultExpanded, addMorePicks, }: SelectionReviewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SelectionsPageProps {
|
|
2
|
+
/** Called when the user presses Continue (e.g. navigate to confirm page) */
|
|
3
|
+
onNext?: () => void;
|
|
4
|
+
/** Called when the user presses Back (e.g. navigate to game page) */
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
/** Hide the built-in title section (use `<SelectionsPageTitle />` separately) */
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
/** Hide the built-in action buttons (use `<SelectionsPageActions />` separately) */
|
|
9
|
+
hideActions?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function SelectionsPageTitle({ className, onBack, onNext, hideActions }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
onBack?: () => void;
|
|
15
|
+
onNext?: () => void;
|
|
16
|
+
hideActions?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
/** Renders selection progress indicator. Must be inside `<PlaceEntryProvider>`. */
|
|
19
|
+
export declare function SelectionsPageActions({ onNext, onBack, hideButtons, className, }: {
|
|
20
|
+
onNext?: () => void;
|
|
21
|
+
onBack?: () => void;
|
|
22
|
+
hideButtons?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function SelectionsPage({ onNext, onBack, hideTitle, hideActions, className }: SelectionsPageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SportPickerPageProps {
|
|
3
|
+
/** Called after a sport is selected */
|
|
4
|
+
onSelectSport?: (sport: string) => void;
|
|
5
|
+
/** Called when the user cancels */
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
hideActions?: boolean;
|
|
9
|
+
/** Custom renderer for sport logos. When omitted, the branded `GameLogo` tile is shown. */
|
|
10
|
+
renderSportLogo?: (sportKey: string) => React.ReactNode;
|
|
11
|
+
/** Override the subtitle under each sport row */
|
|
12
|
+
renderSportTagline?: (sport: string, count: number) => string;
|
|
13
|
+
/** Label for the back link (where "back" leads). @default 'Category' */
|
|
14
|
+
backLabel?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function SportPickerPageTitle({ className, onBack, hideActions, backLabel, }: {
|
|
18
|
+
className?: string;
|
|
19
|
+
onBack?: () => void;
|
|
20
|
+
hideActions?: boolean;
|
|
21
|
+
backLabel?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function SportPickerPageActions({ onCancel, className, }: {
|
|
24
|
+
onCancel?: () => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export declare function SportPickerPage({ onSelectSport, onCancel, hideTitle, hideActions, renderSportLogo, renderSportTagline, backLabel, className, }: SportPickerPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SportSelectorProps } from '../../shared/types';
|
|
2
|
+
export declare function SportSelector({ game, propositions, selections, onToggleSelection, onNext, onBack, loading, error, theme: themeProp, colorScheme, hideActions, initialSport, renderTeamLogo, disableQuickPick, selectedPropositionCount, onPropositionCountChange, showHomeAway, gameCategory, }: SportSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ShareData } from '../types';
|
|
2
|
+
export interface SuccessPageProps {
|
|
3
|
+
/** Called when "Place Another" is clicked */
|
|
4
|
+
onPlayAgain?: () => void;
|
|
5
|
+
/** Called when "Close" / "Done" is clicked */
|
|
6
|
+
onDone?: () => void;
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
onShare?: (data: ShareData) => void;
|
|
9
|
+
/** Hide the built-in title section (use `<SuccessPageTitle />` separately) */
|
|
10
|
+
hideTitle?: boolean;
|
|
11
|
+
/** Hide the built-in action buttons (use `<SuccessPageActions />` separately) */
|
|
12
|
+
hideActions?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function SuccessPageTitle({ className, onBack, hideActions, }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
onBack?: () => void;
|
|
18
|
+
hideActions?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/** Renders Place Another + Share + Done buttons. Must be inside `<PlaceEntryProvider>`. */
|
|
21
|
+
export declare function SuccessPageActions({ onPlayAgain, onDone, onShare, className, }: {
|
|
22
|
+
onPlayAgain?: () => void;
|
|
23
|
+
onDone?: () => void;
|
|
24
|
+
onShare?: (data: ShareData) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function SuccessPage({ onPlayAgain, onDone, onBack, onShare, hideTitle, hideActions, className }: SuccessPageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { default as React, CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { BladeTheme } from '../../../shared/themes';
|
|
3
|
+
export declare function useBreakpoint(minWidth?: number): boolean;
|
|
4
|
+
export type SurfaceLevel = 'flat' | 'raised' | 'elevated';
|
|
5
|
+
export interface SurfaceProps {
|
|
6
|
+
theme: BladeTheme;
|
|
7
|
+
level?: SurfaceLevel;
|
|
8
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
9
|
+
radius?: 'sm' | 'md' | 'lg' | 'pill' | 'none';
|
|
10
|
+
as?: keyof JSX.IntrinsicElements;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function Surface({ theme, level, padding, radius, as, className, style, children, onClick, }: SurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface StackProps {
|
|
18
|
+
/** Gap token name OR raw px. */
|
|
19
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
20
|
+
align?: CSSProperties['alignItems'];
|
|
21
|
+
justify?: CSSProperties['justifyContent'];
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
as?: keyof JSX.IntrinsicElements;
|
|
26
|
+
theme?: BladeTheme;
|
|
27
|
+
}
|
|
28
|
+
export declare function Stack({ gap, align, justify, className, style, children, as }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function Row({ gap, align, justify, wrap, className, style, children, as, }: StackProps & {
|
|
30
|
+
wrap?: boolean;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export type PressableVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
33
|
+
export interface PressableProps {
|
|
34
|
+
theme: BladeTheme;
|
|
35
|
+
variant?: PressableVariant;
|
|
36
|
+
size?: 'sm' | 'md' | 'lg';
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
block?: boolean;
|
|
39
|
+
radius?: 'sm' | 'md' | 'lg' | 'pill';
|
|
40
|
+
onPress?: () => void;
|
|
41
|
+
onDoubleClick?: () => void;
|
|
42
|
+
type?: 'button' | 'submit';
|
|
43
|
+
className?: string;
|
|
44
|
+
style?: CSSProperties;
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const Pressable: React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
export interface TextProps {
|
|
50
|
+
theme: BladeTheme;
|
|
51
|
+
variant?: 'display' | 'heading' | 'subheading' | 'body' | 'caption' | 'eyebrow';
|
|
52
|
+
numeric?: boolean;
|
|
53
|
+
tone?: 'default' | 'muted' | 'primary' | 'success' | 'error' | 'warning';
|
|
54
|
+
weight?: 400 | 500 | 600 | 700;
|
|
55
|
+
align?: CSSProperties['textAlign'];
|
|
56
|
+
as?: keyof JSX.IntrinsicElements;
|
|
57
|
+
className?: string;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
export declare function Text({ theme, variant, numeric, tone, weight, align, as, className, style, children, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare function Divider({ theme, orientation, style, }: {
|
|
63
|
+
theme: BladeTheme;
|
|
64
|
+
orientation?: 'horizontal' | 'vertical';
|
|
65
|
+
style?: CSSProperties;
|
|
66
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export type YesNoValue = 'yes' | 'no';
|
|
68
|
+
export type YesNoAnswer = YesNoValue | null | undefined;
|
|
69
|
+
export type YesNoSize = 'xs' | 'sm' | 'md';
|
|
70
|
+
export interface YesNoButtonsProps {
|
|
71
|
+
theme: BladeTheme;
|
|
72
|
+
/** Currently selected side, if any. */
|
|
73
|
+
value?: YesNoAnswer;
|
|
74
|
+
onYes?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
75
|
+
onNo?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
76
|
+
size?: YesNoSize;
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
yesLabel?: string;
|
|
79
|
+
noLabel?: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
style?: CSSProperties;
|
|
82
|
+
}
|
|
83
|
+
/** The interactive Yes/No pair. Identical everywhere it is used. */
|
|
84
|
+
export declare function YesNoButtons({ theme, value, onYes, onNo, size, disabled, yesLabel, noLabel, className, style, }: YesNoButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
/** Read-only Yes/No chip — the settled answer, same product tokens. */
|
|
86
|
+
export declare function YesNoTag({ theme, value, size, style, }: {
|
|
87
|
+
theme: BladeTheme;
|
|
88
|
+
value: YesNoValue;
|
|
89
|
+
size?: 'sm' | 'md';
|
|
90
|
+
style?: CSSProperties;
|
|
91
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useGames, usePropositions, useSports, useGameEntries, useCreateGameEntry, useGameMaxPayouts, usePlaceEntryFlow, useEvaluateRule, useCalculatePayout, useEntryPreview, useCompositeComponentLookup, } from '../../shared/hooks';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export { HowToPlayButton, HowToPlayModal } from './components/HowToPlayButton';
|
|
2
|
+
export type { HowToPlayButtonProps, HowToPlayModalProps } from './components/HowToPlayButton';
|
|
3
|
+
export { MarkdownContent } from './components/MarkdownContent';
|
|
4
|
+
export type { MarkdownContentProps } from './components/MarkdownContent';
|
|
5
|
+
export { GameSelector } from './components/GameSelector';
|
|
6
|
+
export { SelectionReview } from './components/SelectionReview';
|
|
7
|
+
export { EntrySubmission } from './components/EntrySubmission';
|
|
8
|
+
export { PayoutCircles } from './components/PayoutCircles';
|
|
9
|
+
export { GameEntries } from './components/GameEntries';
|
|
10
|
+
export { QuickPickButton } from './components/QuickPickButton';
|
|
11
|
+
export type { QuickPickButtonProps } from './components/QuickPickButton';
|
|
12
|
+
export { PlaceEntryProvider, usePlaceEntry } from './components/PlaceEntryProvider';
|
|
13
|
+
export type { PlaceEntryProviderProps, PlaceEntryContextValue } from './components/PlaceEntryProvider';
|
|
14
|
+
export { GamePage, GamePageTitle, GamePageActions } from './components/GamePage';
|
|
15
|
+
export type { GamePageProps } from './components/GamePage';
|
|
16
|
+
export { EventFilterBanner } from './components/EventFilterBanner';
|
|
17
|
+
export type { EventFilterBannerProps } from './components/EventFilterBanner';
|
|
18
|
+
export { SelectionsPage, SelectionsPageTitle, SelectionsPageActions } from './components/SelectionsPage';
|
|
19
|
+
export type { SelectionsPageProps } from './components/SelectionsPage';
|
|
20
|
+
export { ConfirmPage, ConfirmPageTitle, ConfirmPageActions } from './components/ConfirmPage';
|
|
21
|
+
export type { ConfirmPageProps } from './components/ConfirmPage';
|
|
22
|
+
export { SuccessPage, SuccessPageTitle, SuccessPageActions } from './components/SuccessPage';
|
|
23
|
+
export type { SuccessPageProps } from './components/SuccessPage';
|
|
24
|
+
export { EntriesPage, EntriesPageTitle } from './components/EntriesPage';
|
|
25
|
+
export type { EntriesPageProps } from './components/EntriesPage';
|
|
26
|
+
export { SportPickerPage, SportPickerPageTitle, SportPickerPageActions } from './components/SportPickerPage';
|
|
27
|
+
export type { SportPickerPageProps } from './components/SportPickerPage';
|
|
28
|
+
export { EventPickerPage } from './components/EventPickerPage';
|
|
29
|
+
export type { EventPickerPageProps } from './components/EventPickerPage';
|
|
30
|
+
export { CategoryPickerPage, CategoryPickerPageTitle, CategoryPickerPageActions } from './components/CategoryPickerPage';
|
|
31
|
+
export type { CategoryPickerPageProps } from './components/CategoryPickerPage';
|
|
32
|
+
export { RuleSetupPage, RuleSetupPageTitle, RuleSetupPageActions } from './components/RuleSetupPage';
|
|
33
|
+
export type { RuleSetupPageProps } from './components/RuleSetupPage';
|
|
34
|
+
export { getRuleSetupConfig, gameNeedsRuleSetup, roundDividendAmount, } from '../shared/rule-setup';
|
|
35
|
+
export type { RuleSetupConfig, RuleSetupMode, RuleSetupOption, } from '../shared/rule-setup';
|
|
36
|
+
export { GameSetBetPage, GameSetBetPageTitle } from './components/GameSetBetPage';
|
|
37
|
+
export type { GameSetBetPageProps } from './components/GameSetBetPage';
|
|
38
|
+
export { getGameSetBetConfig, gameSetPrize, isGameSetBetGame, } from '../shared/game-set-bet';
|
|
39
|
+
export type { GameSetBetConfig, GameSetBetPrize, } from '../shared/game-set-bet';
|
|
40
|
+
export { PickYourDividendPage, PickYourDividendPageTitle } from './components/PickYourDividendPage';
|
|
41
|
+
export type { PickYourDividendPageProps } from './components/PickYourDividendPage';
|
|
42
|
+
export { getPickYourDividendConfig, isPickYourDividendGame, pydLadder, pydRung, PYD_RETAIL_DIVIDENDS, PYD_LEG_RUNGS, } from '../shared/pick-your-dividend';
|
|
43
|
+
export type { PickYourDividendConfig, PydDividendGame, PydRung, } from '../shared/pick-your-dividend';
|
|
44
|
+
export { LadderPage, LadderPageTitle } from './components/LadderPage';
|
|
45
|
+
export type { LadderPageProps } from './components/LadderPage';
|
|
46
|
+
export { getLadderConfig, isLadderGame, ladderTiers, ladderCollectAt, fullStackPrize, LADDER_FAMILY, LADDER_STAKES, LADDER_REFERENCE_BET, } from '../shared/ladder';
|
|
47
|
+
export type { LadderConfig, LadderDef, LadderTier, } from '../shared/ladder';
|
|
48
|
+
export { MirrorPage, MirrorPageTitle } from './components/MirrorPage';
|
|
49
|
+
export type { MirrorPageProps } from './components/MirrorPage';
|
|
50
|
+
export { getMirrorConfig, mirrorPrize, isMirrorGame, MIRROR_STANDARD_MARGIN, } from '../shared/mirror';
|
|
51
|
+
export type { MirrorConfig, MirrorPrize, } from '../shared/mirror';
|
|
52
|
+
export { getGameFlow, getConfirmBoostCopy, isFixedCardExactGame, isOpenExactMultiGame } from '../shared/game-flow';
|
|
53
|
+
export type { GameFlow, ConfirmBoostCopy } from '../shared/game-flow';
|
|
54
|
+
export { GAME_TIER_LEVEL, GAME_TIER_TABS, resolveGameTierLevel, filterGamesByTierLevel, availableGameTierTabs, defaultGameTierId, } from '../shared/game-tiers';
|
|
55
|
+
export type { GameTierId } from '../shared/game-tiers';
|
|
56
|
+
export { filterPropositionsToEvent, formatSameGameMultiEventLabel, getPropositionEventId, groupSameGameMultiEvents, isSameGameMultiGame, isSelectableSameGameMultiProposition, propositionsBelongToEvent, } from '../shared/same-game-multi';
|
|
57
|
+
export type { SameGameMultiEvent } from '../shared/same-game-multi';
|
|
58
|
+
export { GameSetupPage } from './components/GameSetupPage';
|
|
59
|
+
export type { GameSetupPageProps } from './components/GameSetupPage';
|
|
60
|
+
export { PerfectPickPage, PerfectPickPageTitle } from './components/PerfectPickPage';
|
|
61
|
+
export type { PerfectPickPageProps } from './components/PerfectPickPage';
|
|
62
|
+
export { BrandLockup } from './components/BrandLockup';
|
|
63
|
+
export type { BrandLockupProps } from './components/BrandLockup';
|
|
64
|
+
export { GameLogo } from './components/GameLogo';
|
|
65
|
+
export type { GameLogoProps } from './components/GameLogo';
|
|
66
|
+
export { YesNoCategoryLabel, CategoryIcon, ChevronRightIcon } from './components/PickerBrand';
|
|
67
|
+
export type { Game, SportSummary, Proposition, GameEntry, RuleExpressionObject, PlaceEntryFlowProps, GameSelectorProps, EntrySubmissionProps, SelectionReviewProps, GameEntriesProps, ResolvedEntryData, ShareData, ScreenSize, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, } from './types';
|
|
68
|
+
export { BladeApiClient } from './utils/api-client';
|
|
69
|
+
export type { BladeApiClientConfig } from './utils/api-client';
|
|
70
|
+
export { formatCurrency, formatDate, groupPropositionsBySport, isValidSelectionCount, getSportDisplayName, resolveSportDisplayName, resolveCategoryDisplayName, resolvePrice, getJackpotInfo, contrastTextColour, } from './utils';
|
|
71
|
+
export type { SportDisplayNameOverrides, CategoryDisplayNameOverrides } from './utils';
|
|
72
|
+
export { getTheme, getThemeSet, applyTheme, useBladeTheme, useResolvedTheme, resolveTheme, isThemeSet, themes, themeSets, defaultTheme, greenTheme, greenLightTheme, darkTheme, goldTheme, goldLightTheme, defaultThemeSet, greenThemeSet, goldThemeSet, themeHeading, themeLabel, themeValue, themeAccent, themeTextAlt, themeTextAltMuted, themeBodyFont, themeHeadingFont, } from './utils/themes';
|
|
73
|
+
export type { BladeTheme, BladeThemeSet, ColorScheme } from './utils/themes';
|
|
74
|
+
export { useGames, usePropositions, useSports, useGameEntries, useCreateGameEntry, useGameMaxPayouts, usePlaceEntryFlow, useEvaluateRule, useCalculatePayout, useEntryPreview, } from './hooks';
|