@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,19 @@
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
+ * Native `<dialog>` carries the backdrop, focus trap and Esc-to-close.
11
+ */
12
+ export interface EventSwipeModalProps {
13
+ /** The fixture's answerable questions, in card order. */
14
+ propositions: Proposition[];
15
+ /** Fixture label shown above the deck. */
16
+ title: string;
17
+ onClose: () => void;
18
+ }
19
+ export declare function EventSwipeModal({ propositions, title, onClose }: EventSwipeModalProps): import("react/jsx-runtime").JSX.Element;
@@ -19,6 +19,14 @@ export declare function GamePageHeader({ eyebrow, iconUrl, gameName, tagline, cl
19
19
  tagline?: string | null;
20
20
  className?: string;
21
21
  }): import("react/jsx-runtime").JSX.Element;
22
+ /**
23
+ * The sport step of a game's setup page — the one place in the flow the sport
24
+ * is chosen. Renders nothing when the game has a single sport, which is what
25
+ * lets those games skip the step entirely.
26
+ */
27
+ export declare function GameSportRow({ className }: {
28
+ className?: string;
29
+ }): import("react/jsx-runtime").JSX.Element;
22
30
  /**
23
31
  * A set of equal-weight options — ladders, dividends, nets. One snapping row on
24
32
  * a phone (a 2-up grid cost four rows), the usual grid from `sm` up.
@@ -27,3 +27,10 @@ export declare function LockIcon({ size, color, className, }: {
27
27
  color?: string;
28
28
  className?: string;
29
29
  }): import("react/jsx-runtime").JSX.Element;
30
+ export declare function StarIcon({ size, color, filled, className, }: {
31
+ size?: number;
32
+ color?: string;
33
+ /** Solid for a pinned favourite, outline for one you can pin. */
34
+ filled?: boolean;
35
+ className?: string;
36
+ }): 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,12 @@ 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
+ enableSportFavourites?: boolean;
69
84
  filterSport?: string;
70
85
  initialSport?: string;
71
86
  initialEventId?: string;
@@ -122,6 +137,10 @@ export interface PlaceEntryProviderProps {
122
137
  sportBaseKey?: string;
123
138
  disableQuickPick?: boolean;
124
139
  renderTeamLogo?: RenderTeamLogo;
140
+ renderPropositionSilk?: RenderPropositionSilk;
141
+ selectionVariant?: SelectionVariant;
142
+ disableEventSwipe?: boolean;
143
+ enableSportFavourites?: boolean;
125
144
  onEntryPlaced?: (entry: GameEntry) => void;
126
145
  onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
127
146
  onCancel?: () => void;
@@ -135,4 +154,4 @@ export interface PlaceEntryProviderProps {
135
154
  /** Map entry categories to UI labels. */
136
155
  categoryDisplayNames?: CategoryDisplayNameOverrides;
137
156
  }
138
- 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;
157
+ 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,21 @@
1
+ import { default as React } from 'react';
2
+ import { BladeTheme } from '../types';
3
+ export interface ScrollShelfProps {
4
+ theme: BladeTheme;
5
+ /** Re-measure when the row's contents change. */
6
+ itemCount?: number;
7
+ /** Extra padding inside the scroller — cards need room for their shadow. */
8
+ contentClassName?: string;
9
+ className?: string;
10
+ /**
11
+ * `dragged()` is true right after a mouse drag-scroll, so item click handlers
12
+ * can bail instead of firing at the end of a swipe.
13
+ */
14
+ children: (dragged: () => boolean) => React.ReactNode;
15
+ }
16
+ /**
17
+ * The horizontal shelf every picker row sits in: drag to scroll with a mouse,
18
+ * edge fades that say "more this way", and mouse-only arrow discs. Shared so
19
+ * the filter chips and the sport rail scroll identically.
20
+ */
21
+ export declare function ScrollShelf({ theme, itemCount, contentClassName, className, children, }: ScrollShelfProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { Proposition } from '../types';
2
+ import { BladeTheme } from '../utils/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;
@@ -21,7 +21,7 @@ export declare function SelectionsPageTitle({ className, onBack, onNext, hideAct
21
21
  onNext?: () => void;
22
22
  hideActions?: boolean;
23
23
  }): import("react/jsx-runtime").JSX.Element;
24
- /** Renders selection progress indicator. Must be inside `<PlaceEntryProvider>`. */
24
+ /** Renders the live bet slip. Must be inside `<PlaceEntryProvider>`. */
25
25
  export declare function SelectionsPageActions({ onNext, onBack, hideButtons, className, }: {
26
26
  onNext?: () => void;
27
27
  onBack?: () => void;
@@ -0,0 +1,16 @@
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
+ className?: string;
10
+ }
11
+ export declare function SixAgainPageTitle({ className, onBack, hideActions, }: {
12
+ className?: string;
13
+ onBack?: () => void;
14
+ hideActions?: boolean;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export declare function SixAgainPage({ onQuickPick, onPickYourOwn, onBack, hideTitle, config: configOverride, backLabel, className, }: SixAgainPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface SportRailProps {
3
+ /** Heading above the rail. Pass `null` to drop it. @default 'Pick your sport' */
4
+ label?: string | null;
5
+ /** Line under the heading. Pass `null` to drop it; omit for the default hint. */
6
+ sublabel?: string | null;
7
+ /** Custom renderer for the sport tile. */
8
+ renderSportLogo?: (sportKey: string) => React.ReactNode;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * The sport step, and the only place the sport is chosen: it sits on the game's
13
+ * setup page, after the game and before the picks. The game page never shows it
14
+ * — a sport picked up front just scopes the game list — and the selections show
15
+ * the sport read-only, with a Change that comes back here.
16
+ *
17
+ * Renders nothing at all when the sport is not a choice, which is every
18
+ * single-sport game.
19
+ */
20
+ export declare function SportRail({ label, sublabel, renderSportLogo, className }: SportRailProps): import("react/jsx-runtime").JSX.Element | null;
@@ -12,4 +12,21 @@ 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, textClass: textClassOverride, 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 classes — the variant layouts set their own. */
28
+ textClass?: string;
29
+ /** Replaces `colors.text` on the question itself, legs included. */
30
+ textColor?: string;
31
+ }): import("react/jsx-runtime").JSX.Element;
32
+ 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;
@@ -76,6 +76,8 @@ export interface YesNoButtonsProps {
76
76
  onYes?: (e: MouseEvent<HTMLButtonElement>) => void;
77
77
  onNo?: (e: MouseEvent<HTMLButtonElement>) => void;
78
78
  size?: YesNoSize;
79
+ /** Fill the row, each side taking half — the roomy card layouts want this. */
80
+ stretch?: boolean;
79
81
  disabled?: boolean;
80
82
  yesLabel?: string;
81
83
  noLabel?: string;
@@ -83,7 +85,7 @@ export interface YesNoButtonsProps {
83
85
  style?: CSSProperties;
84
86
  }
85
87
  /** The interactive Yes/No pair. Identical everywhere it is used. */
86
- export declare function YesNoButtons({ theme, value, onYes, onNo, size, disabled, yesLabel, noLabel, className, style, }: YesNoButtonsProps): import("react/jsx-runtime").JSX.Element;
88
+ export declare function YesNoButtons({ theme, value, onYes, onNo, size, stretch, disabled, yesLabel, noLabel, className, style, }: YesNoButtonsProps): import("react/jsx-runtime").JSX.Element;
87
89
  /** Read-only Yes/No chip — the settled answer, same product tokens. */
88
90
  export declare function YesNoTag({ theme, value, size, style, }: {
89
91
  theme: BladeTheme;
@@ -21,6 +21,12 @@ export { EventFilterBanner } from './components/EventFilterBanner';
21
21
  export type { EventFilterBannerProps } from './components/EventFilterBanner';
22
22
  export { SelectionsPage, SelectionsPageTitle, SelectionsPageActions } from './components/SelectionsPage';
23
23
  export type { SelectionsPageProps, SelectionsView } from './components/SelectionsPage';
24
+ export { SelectionVariantList } from './components/SelectionVariantList';
25
+ export type { SelectionVariantListProps } from './components/SelectionVariantList';
26
+ export { EventSwipeModal } from './components/EventSwipeModal';
27
+ export type { EventSwipeModalProps } from './components/EventSwipeModal';
28
+ export { SELECTION_VARIANTS, groupSelectionDays } from '../shared/selection-variants';
29
+ export type { SelectionVariant, SelectionDay, SelectionEvent } from '../shared/selection-variants';
24
30
  export { SwipeDeck, SwipeCard, SwipeCardFace } from './components/SwipeDeck';
25
31
  export type { SwipeDeckProps, SwipeCardProps, SwipeCardFaceProps, SwipeCardApi, FlyDirection, } from './components/SwipeDeck';
26
32
  export { useSwipeDeck, VISIBLE_DEPTH } from '../shared/swipe-deck';
@@ -31,6 +37,10 @@ export { SuccessPage, SuccessPageTitle, SuccessPageActions } from './components/
31
37
  export type { SuccessPageProps } from './components/SuccessPage';
32
38
  export { EntriesPage, EntriesPageTitle } from './components/EntriesPage';
33
39
  export type { EntriesPageProps } from './components/EntriesPage';
40
+ export { SportRail } from './components/SportRail';
41
+ export type { SportRailProps } from './components/SportRail';
42
+ export { ScrollShelf } from './components/ScrollShelf';
43
+ export type { ScrollShelfProps } from './components/ScrollShelf';
34
44
  export { SportPickerPage, SportPickerPageTitle, SportPickerPageActions } from './components/SportPickerPage';
35
45
  export type { SportPickerPageProps } from './components/SportPickerPage';
36
46
  export { EventPickerPage } from './components/EventPickerPage';
@@ -61,6 +71,10 @@ export { SafetyNetPage, SafetyNetPageTitle } from './components/SafetyNetPage';
61
71
  export type { SafetyNetPageProps } from './components/SafetyNetPage';
62
72
  export { getSafetyNetConfig, getSafetyNetPricing, isSafetyNetGame, safetyNetTicket, safetyNetCollect, EXTRA_SHOT_MIN_LEGS, DOUBLE_SHOT_MIN_LEGS, } from '../shared/safety-net';
63
73
  export type { SafetyNetConfig, SafetyNetMode, SafetyNetModeId, SafetyNetPricing, SafetyNetTicket, } from '../shared/safety-net';
74
+ export { SixAgainPage, SixAgainPageTitle } from './components/SixAgainPage';
75
+ export type { SixAgainPageProps } from './components/SixAgainPage';
76
+ 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';
77
+ export type { SixAgainConfig, SixAgainTicket, SixAgainBoost, SixAgainBoostId, SixAgainBoosts, } from '../shared/six-again';
64
78
  export { getGameFlow, getConfirmBoostCopy, isFixedCardExactGame, isOpenExactMultiGame } from '../shared/game-flow';
65
79
  export type { GameFlow, ConfirmBoostCopy } from '../shared/game-flow';
66
80
  export { GAME_TIER_LEVEL, GAME_TIER_TABS, resolveGameTierLevel, filterGamesByTierLevel, availableGameTierTabs, defaultGameTierId, } from '../shared/game-tiers';
@@ -75,7 +89,7 @@ export { BrandLockup } from './components/BrandLockup';
75
89
  export type { BrandLockupProps } from './components/BrandLockup';
76
90
  export { GameLogo } from './components/GameLogo';
77
91
  export type { GameLogoProps } from './components/GameLogo';
78
- export { YesNoCategoryLabel, CategoryIcon, ChevronRightIcon, LockIcon } from './components/PickerBrand';
92
+ export { YesNoCategoryLabel, CategoryIcon, ChevronRightIcon, LockIcon, StarIcon } from './components/PickerBrand';
79
93
  export type { Game, SportSummary, Proposition, GameEntry, RuleExpressionObject, PlaceEntryFlowProps, GameSelectorProps, EntrySubmissionProps, SelectionReviewProps, GameEntriesProps, ResolvedEntryData, ShareData, PendingBet, ScreenSize, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, } from './types';
80
94
  export { BladeApiClient } from './utils/api-client';
81
95
  export type { BladeApiClientConfig } from './utils/api-client';