@simple-parlay/components 2.1.0 → 2.2.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.
Files changed (33) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +687 -658
  4. package/dist/react/components/EntryRulePicks.d.ts +62 -0
  5. package/dist/react/components/GameEntries.d.ts +1 -1
  6. package/dist/react/components/GameShowcaseCatalogue.d.ts +2 -1
  7. package/dist/react/components/PlaceEntryProvider.d.ts +11 -2
  8. package/dist/react/components/SelectionVariantList.d.ts +18 -0
  9. package/dist/react/components/ShelfKit.d.ts +1 -1
  10. package/dist/react/components/YesNoMultiLogo.d.ts +5 -2
  11. package/dist/react/components/_primitives/index.d.ts +4 -2
  12. package/dist/react/index.cjs +1 -1
  13. package/dist/react/index.d.ts +2 -0
  14. package/dist/react/index.mjs +687 -658
  15. package/dist/react/types/index.d.ts +1 -1
  16. package/dist/react-native/components/EntryRulePicks.d.ts +66 -0
  17. package/dist/react-native/components/GameEntries.d.ts +1 -1
  18. package/dist/react-native/components/HowToPlayButton.d.ts +5 -0
  19. package/dist/react-native/components/PlaceEntryProvider.d.ts +11 -2
  20. package/dist/react-native/components/SelectionVariantList.d.ts +40 -0
  21. package/dist/react-native/components/ShelfKit.d.ts +1 -1
  22. package/dist/react-native/components/_primitives/index.d.ts +3 -1
  23. package/dist/react-native/index.cjs +1 -1
  24. package/dist/react-native/index.d.ts +2 -0
  25. package/dist/react-native/index.mjs +543 -517
  26. package/dist/react-native/types/index.d.ts +1 -1
  27. package/dist/shared/api-client.d.ts +7 -1
  28. package/dist/shared/entry-features.d.ts +34 -0
  29. package/dist/shared/entry-rules.d.ts +178 -0
  30. package/dist/shared/shelf-covers.d.ts +0 -2
  31. package/dist/shared/shelf-ui.d.ts +2 -1
  32. package/dist/shared/types.d.ts +90 -0
  33. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { PlaceEntryFlowProps as SharedPlaceEntryFlowProps, GameEntriesProps as SharedGameEntriesProps } from '../../shared/types';
2
- export type { BladeTheme, BladeThemeSet, ColorScheme, ScreenSize, RuleExpressionObject, Game, GameAllocation, SportSummary, Proposition, GameEntry, GameSelectorProps, EntrySubmissionProps, SelectionReviewProps, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, TopPayoutEntry, TopPayoutsResponse, ResolvedEntryData, ShareData, PendingBet, QuickPickResult, } from '../../shared/types';
2
+ export type { GameFeatureId, EntryRuleAction, EntryFeatureClient, EntryFeatureOffer, EntryFeatureQuote, EntryFeatureQuoteInput, BladeTheme, BladeThemeSet, ColorScheme, ScreenSize, RuleExpressionObject, Game, GameAllocation, SportSummary, Proposition, GameEntry, GameSelectorProps, EntrySubmissionProps, SelectionReviewProps, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, TopPayoutEntry, TopPayoutsResponse, ResolvedEntryData, ShareData, PendingBet, QuickPickResult, } from '../../shared/types';
3
3
  export interface PlaceEntryFlowProps extends SharedPlaceEntryFlowProps {
4
4
  className?: string;
5
5
  }
@@ -0,0 +1,66 @@
1
+ import { EntryFeatureClient, EntryRuleAction, GameEntry, Proposition } from '../types';
2
+ import { RenderTeamLogo } from '../../shared/types';
3
+ import { BladeTheme } from '../utils/themes';
4
+ import { EntryRuleId, EntryRuleResult } from '../../shared/entry-rules';
5
+ /** A game feature the player opened from an entry card. */
6
+ export type EntryRuleView = {
7
+ rule: 'double_down' | 'late_swap';
8
+ entry: GameEntry;
9
+ drop: Proposition;
10
+ dropAnswer?: 'yes' | 'no';
11
+ } | {
12
+ rule: 'press';
13
+ entry: GameEntry;
14
+ winnings: number;
15
+ } | {
16
+ rule: 'second_thoughts';
17
+ entry: GameEntry;
18
+ picks: {
19
+ prop: Proposition;
20
+ answer?: 'yes' | 'no';
21
+ }[];
22
+ } | {
23
+ rule: 'hot_hand';
24
+ entry: GameEntry;
25
+ };
26
+ export declare const RULE_EYEBROW: {
27
+ readonly fontSize: 11;
28
+ readonly fontWeight: "800";
29
+ readonly letterSpacing: 1.54;
30
+ readonly textTransform: "uppercase";
31
+ };
32
+ /**
33
+ * The feature's mark: its glyph in the accent on a primary tile, like the game emblems.
34
+ * `explain` makes it the way in to the feature's explainer: a `?` badge, and a tap opens it. Web twin: RuleTile.
35
+ */
36
+ export declare function RuleTile({ theme, rule, size, explain }: {
37
+ theme: BladeTheme;
38
+ rule: EntryRuleId;
39
+ size?: number;
40
+ explain?: boolean;
41
+ }): import("react/jsx-runtime").JSX.Element;
42
+ /** What a feature does, in the How-to-Play guide's shape: the mark and one line, three numbered steps, an example payout. Web twin: RuleExplainer. */
43
+ export declare function RuleExplainer({ theme, rule }: {
44
+ theme: BladeTheme;
45
+ rule: EntryRuleId;
46
+ }): import("react/jsx-runtime").JSX.Element;
47
+ /** One pick as a row: what was called and the call. Web twin: RulePickRow. */
48
+ export declare function RulePickRow({ theme, prop, answer, struck }: {
49
+ theme: BladeTheme;
50
+ prop: Proposition;
51
+ answer?: 'yes' | 'no';
52
+ struck?: boolean;
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ /**
55
+ * The picks screen, pointed at a game feature: the Shelf picks list and a checkout dock. BLADE quotes
56
+ * the exact stake and payout for the picks as they stand; the button arms, then accepts that quote. Web twin: EntryRulePicks.
57
+ */
58
+ export declare function EntryRulePicks({ view, pool, theme, client, renderTeamLogo, onBack, onDone }: {
59
+ view: EntryRuleView;
60
+ pool: Proposition[];
61
+ theme: BladeTheme;
62
+ client: EntryFeatureClient | null;
63
+ renderTeamLogo?: RenderTeamLogo;
64
+ onBack: () => void;
65
+ onDone: (action: EntryRuleAction, result: EntryRuleResult) => void;
66
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { GameEntriesProps } from '../types';
2
- export declare function GameEntries({ apiUrl, apiKey, fetchImpl, getAuthHeaders, userId, demoEntries, demoGames, demoPropositions, onSelectEntry, theme: themeProp, colorScheme, renderTeamLogo, filterSport, }: GameEntriesProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function GameEntries({ apiUrl, apiKey, fetchImpl, getAuthHeaders, userId, demoEntries, demoGames, demoPropositions, onSelectEntry, theme: themeProp, colorScheme, renderTeamLogo, filterSport, onEntryRule, entryFeatureClient, }: GameEntriesProps): import("react/jsx-runtime").JSX.Element;
@@ -26,3 +26,8 @@ export interface HowToPlayButtonProps {
26
26
  headingFont?: string;
27
27
  }
28
28
  export declare function HowToPlayButton({ content, panel, theme, extra, title, label, variant, touchSize, colors, bodyFont, headingFont, }: HowToPlayButtonProps): import("react/jsx-runtime").JSX.Element | null;
29
+ /** The How-to-Play sheet on its own, for triggers other than the button (the game-feature tiles). Web twin: HowToPlayModal. */
30
+ export declare function HowToPlayModal({ open, onClose, title, content, panel, theme, extra, colors, bodyFont, headingFont, }: Omit<HowToPlayButtonProps, 'label' | 'variant' | 'touchSize'> & {
31
+ open: boolean;
32
+ onClose: () => void;
33
+ }): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,10 @@ import { GameLibrary } from '../../shared/game-library';
3
3
  import { GameFlow } from '../../shared/game-flow';
4
4
  import { PreviewCallPayouts } from '../../shared/use-call-payouts';
5
5
  import { UiVariant } from '../../shared/ui-variant';
6
+ import { UiSystem } from '../../shared/ui-system';
6
7
  import { default as React } from 'react';
7
8
  import { YesNoLabels, EntryCategory } from '../../shared/utils';
8
- import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
9
+ import { Game, Proposition, SportSummary, GameEntry, GameEntriesProps, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
9
10
  import { BladeTheme, BladeThemeSet, ColorScheme } from '../utils/themes';
10
11
  import { SportDisplayNameOverrides, CategoryDisplayNameOverrides } from '../utils';
11
12
  import { RenderTeamLogo, RenderPropositionSilk, GamePermittedRule, GameCategory } from '../../shared/types';
@@ -121,6 +122,8 @@ export interface PlaceEntryContextValue {
121
122
  renderPropositionSilk?: RenderPropositionSilk;
122
123
  /** Optional presentation. Existing UI remains the default. */
123
124
  uiVariant?: UiVariant;
125
+ /** The resolved UI_SYSTEMS entry for `uiVariant`; the game library draws its setup pages from it. */
126
+ uiSystemSpec: UiSystem;
124
127
  /** Proposition layout override; undefined follows the UI variant. */
125
128
  selectionVariant?: SelectionVariant;
126
129
  /** Game discovery layout; native supports `shelf`, with web-only layouts falling back. */
@@ -132,6 +135,10 @@ export interface PlaceEntryContextValue {
132
135
  /** Let players star a sport in the rail to pin it up front (per device). Off by default. */
133
136
  enableSportFavourites?: boolean;
134
137
  filterSport?: string;
138
+ /** Called when the player uses a game feature (Double Down, Press, Late Swap) on an entry. */
139
+ onEntryRule?: GameEntriesProps['onEntryRule'];
140
+ /** Overrides the BLADE calls behind game features (the playground's demo pricer). */
141
+ entryFeatureClient?: GameEntriesProps['entryFeatureClient'];
135
142
  initialSport?: string;
136
143
  initialEventId?: string;
137
144
  initialEventLabel?: string;
@@ -181,6 +188,8 @@ export interface PlaceEntryProviderProps {
181
188
  jurisdiction?: string;
182
189
  initialGameId?: number;
183
190
  filterSport?: string;
191
+ onEntryRule?: GameEntriesProps['onEntryRule'];
192
+ entryFeatureClient?: GameEntriesProps['entryFeatureClient'];
184
193
  initialSport?: string;
185
194
  initialEventId?: string;
186
195
  initialEventLabel?: string;
@@ -212,4 +221,4 @@ export interface PlaceEntryProviderProps {
212
221
  sportDisplayNames?: SportDisplayNameOverrides;
213
222
  categoryDisplayNames?: CategoryDisplayNameOverrides;
214
223
  }
215
- export declare function PlaceEntryProvider({ gameLibrary, showCorrelationDebug, 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, uiVariant, selectionVariant, gameVariant, disableEventSwipe, swipeVariant, enableSportFavourites, yesNoLabels, onEntryPlaced, onBeforeSubmit, entryReference, onCancel, onShare, onRecharge, onClearEventFilter, screenSize, howToPlayMarkdown: howToPlayMarkdownProp, sportDisplayNames, categoryDisplayNames, }: PlaceEntryProviderProps): import("react/jsx-runtime").JSX.Element;
224
+ export declare function PlaceEntryProvider({ gameLibrary, showCorrelationDebug, apiUrl, apiKey, fetchImpl, getAuthHeaders, userId, getUserBalance, children, theme: themeProp, colorScheme, demoGames, demoPropositions, demoEntries, demoMaxPayouts, gameCategory, jurisdiction, initialGameId, filterSport, onEntryRule, entryFeatureClient, initialSport, initialEventId, initialEventLabel, sportBaseKey, disableQuickPick, renderTeamLogo, renderPropositionSilk, uiVariant, selectionVariant, gameVariant, disableEventSwipe, swipeVariant, enableSportFavourites, yesNoLabels, onEntryPlaced, onBeforeSubmit, entryReference, onCancel, onShare, onRecharge, onClearEventFilter, screenSize, howToPlayMarkdown: howToPlayMarkdownProp, sportDisplayNames, categoryDisplayNames, }: PlaceEntryProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,44 @@ import { Proposition } from '../types';
2
2
  import { BladeTheme } from '../../shared/themes';
3
3
  import { SelectionVariant } from '../../shared/selection-variants';
4
4
  import { RenderTeamLogo } from '../../shared/types';
5
+ /**
6
+ * The fixture-first proposition layouts — YESNO's own designs, ported from the
7
+ * demo site and folded into the packaged selector. Twin of the web
8
+ * `SelectionVariantList`, same layouts and same tokens.
9
+ *
10
+ * It draws only the list body. Filters, quick pick, the header and the action
11
+ * bar stay with `SportSelector`, and the propositions arrive already filtered
12
+ * and already grouped, so a variant can never disagree with the default list
13
+ * about what is on offer.
14
+ */
15
+ /** Question type per layout — the reference site's own ramp, not the packaged one. */
16
+ export declare const QUESTION_TYPE: {
17
+ readonly split: {
18
+ readonly fontSize: 13;
19
+ readonly fontWeight: "400";
20
+ readonly lineHeight: 18;
21
+ };
22
+ readonly compact: {
23
+ readonly fontSize: 11;
24
+ readonly fontWeight: "400";
25
+ readonly lineHeight: 15;
26
+ };
27
+ readonly dense: {
28
+ readonly fontSize: 16;
29
+ readonly fontWeight: "600";
30
+ readonly lineHeight: 22;
31
+ };
32
+ readonly call: {
33
+ readonly fontSize: 15;
34
+ readonly fontWeight: "600";
35
+ readonly lineHeight: 23;
36
+ };
37
+ readonly shelf: {
38
+ readonly fontSize: 14;
39
+ readonly fontWeight: "500";
40
+ readonly lineHeight: 19;
41
+ };
42
+ };
5
43
  export interface SelectionVariantListProps {
6
44
  variant: SelectionVariant;
7
45
  /** Already filtered and grouped by `groupPropositionsForDisplay`. */
@@ -18,3 +56,5 @@ export interface SelectionVariantListProps {
18
56
  disableEventSwipe?: boolean;
19
57
  }
20
58
  export declare function SelectionVariantList({ variant, groups, racing, selections, onToggleSelection, atMax, theme, renderTeamLogo, componentById, disableEventSwipe, }: SelectionVariantListProps): import("react/jsx-runtime").JSX.Element;
59
+ /** Railed rows put Yes / No under the question on a card narrower than this. Web twin: SHELF_ROW_CSS. */
60
+ export declare const SHELF_STACK_BELOW = 440;
@@ -28,7 +28,7 @@ export interface ShelfOptionProps {
28
28
  }
29
29
  /** Every chip, filter, tab and option: teal with light text when chosen, white with a hairline when not. */
30
30
  export declare function ShelfOption({ theme: themeProp, selected, sub, disabled, onPress, accessibilityLabel, accessibilityRole, testID, style, children }: ShelfOptionProps): import("react/jsx-runtime").JSX.Element;
31
- /** One progress mark per pick: right fills teal, a miss is outlined, still to play is a hairline grey. */
31
+ /** One progress mark per pick: right fills teal, a miss is outlined, still to play is a hairline grey, a miss you can undo is the accent. */
32
32
  export declare function ShelfPips({ theme: themeProp, states, label, style }: {
33
33
  theme?: BladeTheme;
34
34
  states: readonly ShelfPipState[];
@@ -124,6 +124,8 @@ export interface IconButtonProps {
124
124
  size?: number;
125
125
  /** danger: the hover ring turns the error colour (remove a pick). */
126
126
  tone?: 'default' | 'danger';
127
+ /** The glyph alone: no disc or ring. */
128
+ bare?: boolean;
127
129
  /** Merged with the button's own disabled state: expanded for disclosures. */
128
130
  accessibilityState?: {
129
131
  expanded?: boolean;
@@ -140,7 +142,7 @@ export interface IconButtonProps {
140
142
  * footprint and reaches out to a 44 hit area with negative margins.
141
143
  * Web twin: `IconButton` in src/react/components/_primitives.
142
144
  */
143
- export declare function IconButton({ theme, accessibilityLabel, onPress, disabled, size, tone, accessibilityState, testID, style, children }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
145
+ export declare function IconButton({ theme, accessibilityLabel, onPress, disabled, size, tone, bare, accessibilityState, testID, style, children }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
144
146
  /** The icon colour inside an IconButton at rest (hover recolours the ring, not the glyph, on native). */
145
147
  export declare function iconButtonInk(theme: BladeTheme): string;
146
148
  export interface TextProps {