@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
@@ -0,0 +1,62 @@
1
+ import { default as React } from 'react';
2
+ import { EntryFeatureClient, EntryRuleAction, GameEntry, Proposition } from '../types';
3
+ import { RenderTeamLogo } from '../../shared/types';
4
+ import { BladeTheme } from '../utils/themes';
5
+ import { EntryRuleId, EntryRuleResult } from '../../shared/entry-rules';
6
+ /** A game feature the player opened from an entry card. */
7
+ export type EntryRuleView = {
8
+ rule: 'double_down' | 'late_swap';
9
+ entry: GameEntry;
10
+ drop: Proposition;
11
+ dropAnswer?: 'yes' | 'no';
12
+ } | {
13
+ rule: 'press';
14
+ entry: GameEntry;
15
+ winnings: number;
16
+ } | {
17
+ rule: 'second_thoughts';
18
+ entry: GameEntry;
19
+ picks: {
20
+ prop: Proposition;
21
+ answer?: 'yes' | 'no';
22
+ }[];
23
+ } | {
24
+ rule: 'hot_hand';
25
+ entry: GameEntry;
26
+ };
27
+ export declare const RULE_EYEBROW: React.CSSProperties;
28
+ /**
29
+ * The feature's mark: its glyph in the accent on a primary tile, like the game emblems.
30
+ * `explain` makes it the way in to the feature's explainer: a hover lift and ring, a `?` badge, and a tap opens it.
31
+ */
32
+ export declare function RuleTile({ theme, rule, size, explain }: {
33
+ theme: BladeTheme;
34
+ rule: EntryRuleId;
35
+ size?: number;
36
+ explain?: boolean;
37
+ }): import("react/jsx-runtime").JSX.Element;
38
+ /** What a feature does, in the How-to-Play guide's shape: the mark and one line, three numbered steps, what it costs. */
39
+ export declare function RuleExplainer({ theme, rule }: {
40
+ theme: BladeTheme;
41
+ rule: EntryRuleId;
42
+ }): import("react/jsx-runtime").JSX.Element;
43
+ /** One pick as a row: what was called and the call. */
44
+ export declare function RulePickRow({ theme, prop, answer, struck }: {
45
+ theme: BladeTheme;
46
+ prop: Proposition;
47
+ answer?: 'yes' | 'no';
48
+ struck?: boolean;
49
+ }): import("react/jsx-runtime").JSX.Element;
50
+ /**
51
+ * The picks screen, pointed at a game feature: the Shelf picks list and a checkout dock. BLADE quotes
52
+ * the exact stake and payout for the picks as they stand; the button arms, then accepts that quote.
53
+ */
54
+ export declare function EntryRulePicks({ view, pool, theme, client, renderTeamLogo, onBack, onDone }: {
55
+ view: EntryRuleView;
56
+ pool: Proposition[];
57
+ theme: BladeTheme;
58
+ client: EntryFeatureClient | null;
59
+ renderTeamLogo?: RenderTeamLogo;
60
+ onBack: () => void;
61
+ onDone: (action: EntryRuleAction, result: EntryRuleResult) => void;
62
+ }): 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, className, 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, className, renderTeamLogo, filterSport, onEntryRule, entryFeatureClient, }: GameEntriesProps): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ export interface GameShowcaseCatalogueProps extends CallGameCatalogueProps {
6
6
  onlyListedGames?: boolean;
7
7
  /** Leave out the hero image. */
8
8
  disableImage?: boolean;
9
+ showTierFilter?: boolean;
9
10
  }
10
11
  /** A hero-led carousel of games with an all-games strip and a dividends view. Browsing is local; Press to play commits. */
11
- export declare function GameShowcaseCatalogue({ games, theme, onPlay, maxPayouts, quickPickLoading, onlyListedGames, disableImage }: GameShowcaseCatalogueProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function GameShowcaseCatalogue({ games, theme, onPlay, maxPayouts, quickPickLoading, onlyListedGames, disableImage, showTierFilter }: GameShowcaseCatalogueProps): import("react/jsx-runtime").JSX.Element;
@@ -3,10 +3,11 @@ 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 { BladeApiClient } from '../utils/api-client';
8
9
  import { YesNoLabels, EntryCategory } from '../../shared/utils';
9
- import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
10
+ import { Game, Proposition, SportSummary, GameEntry, GameEntriesProps, TopPayoutsResponse, ShareData, ScreenSize } from '../types';
10
11
  import { BladeTheme, BladeThemeSet, ColorScheme } from '../utils/themes';
11
12
  import { SportDisplayNameOverrides, CategoryDisplayNameOverrides } from '../utils';
12
13
  import { RenderTeamLogo, RenderPropositionSilk, GamePermittedRule, GameCategory } from '../../shared/types';
@@ -124,6 +125,8 @@ export interface PlaceEntryContextValue {
124
125
  renderPropositionSilk?: RenderPropositionSilk;
125
126
  /** Optional presentation. Existing UI remains the default. */
126
127
  uiVariant?: UiVariant;
128
+ /** The resolved UI_SYSTEMS entry for `uiVariant`; the game library draws its setup pages from it. */
129
+ uiSystemSpec: UiSystem;
127
130
  /** Proposition layout override; undefined follows the UI variant. */
128
131
  selectionVariant?: SelectionVariant;
129
132
  /** Optional game discovery layout, independent of uiVariant. `cards`, `split` and `compare` are web-only; native renders `shelf`. */
@@ -134,6 +137,10 @@ export interface PlaceEntryContextValue {
134
137
  swipeVariant?: SwipeVariant;
135
138
  enableSportFavourites?: boolean;
136
139
  filterSport?: string;
140
+ /** Called when the player uses a game feature (Double Down, Press, Late Swap) on an entry. */
141
+ onEntryRule?: GameEntriesProps['onEntryRule'];
142
+ /** Overrides the BLADE calls behind game features (the playground's demo pricer). */
143
+ entryFeatureClient?: GameEntriesProps['entryFeatureClient'];
137
144
  initialSport?: string;
138
145
  initialEventId?: string;
139
146
  initialEventLabel?: string;
@@ -193,6 +200,8 @@ export interface PlaceEntryProviderProps {
193
200
  jurisdiction?: string;
194
201
  initialGameId?: number;
195
202
  filterSport?: string;
203
+ onEntryRule?: GameEntriesProps['onEntryRule'];
204
+ entryFeatureClient?: GameEntriesProps['entryFeatureClient'];
196
205
  initialSport?: string;
197
206
  initialEventId?: string;
198
207
  initialEventLabel?: string;
@@ -225,4 +234,4 @@ export interface PlaceEntryProviderProps {
225
234
  /** Map entry categories to UI labels. */
226
235
  categoryDisplayNames?: CategoryDisplayNameOverrides;
227
236
  }
228
- export declare function PlaceEntryProvider({ gameLibrary, apiClient: suppliedApiClient, scopePropositionsToSport, 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;
237
+ export declare function PlaceEntryProvider({ gameLibrary, apiClient: suppliedApiClient, scopePropositionsToSport, 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,23 @@ import { Proposition } from '../types';
2
2
  import { BladeTheme } from '../utils/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.
8
+ *
9
+ * It draws only the list body. Filters, quick pick, the header and the action
10
+ * bar stay with `SportSelector`, and the propositions arrive already filtered
11
+ * and already grouped, so a variant can never disagree with the default list
12
+ * about what is on offer.
13
+ */
14
+ /** Question type per layout — the reference site's own ramp, not the packaged one. */
15
+ export declare const QUESTION_TYPE: {
16
+ readonly split: "text-[13px] leading-snug";
17
+ readonly compact: "text-[11px] leading-snug";
18
+ readonly shelf: "text-[14px] font-medium leading-snug";
19
+ readonly dense: "text-[16px] font-semibold leading-snug";
20
+ readonly call: "text-[15px] font-semibold leading-relaxed";
21
+ };
5
22
  export interface SelectionVariantListProps {
6
23
  variant: SelectionVariant;
7
24
  /** Already filtered and grouped by `groupPropositionsForDisplay`. */
@@ -18,3 +35,4 @@ export interface SelectionVariantListProps {
18
35
  disableEventSwipe?: boolean;
19
36
  }
20
37
  export declare function SelectionVariantList({ variant, groups, racing, selections, onToggleSelection, atMax, theme, renderTeamLogo, componentById, disableEventSwipe, }: SelectionVariantListProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare const SHELF_ROW_CSS = ".blade-shelf-row{grid-template-columns:minmax(0,1fr) auto}@container (max-width:439px){.blade-shelf-row{grid-template-columns:minmax(0,1fr)}.blade-shelf-row .blade-shelf-answers>div{width:100%}.blade-shelf-row .blade-shelf-answers button{flex:1}}";
@@ -23,7 +23,7 @@ type OptionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'>
23
23
  };
24
24
  /** Every chip, filter, tab and option: teal with light text when chosen, white with a hairline when not. */
25
25
  export declare function ShelfOption({ theme: themeProp, selected, sub, children, disabled, type, style, onMouseEnter, onMouseLeave, onPointerDown, onPointerUp, onFocus, onBlur, ...rest }: OptionProps): import("react/jsx-runtime").JSX.Element;
26
- /** One progress mark per pick: right fills teal, a miss is outlined, still to play is a hairline grey. */
26
+ /** 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. */
27
27
  export declare function ShelfPips({ theme: themeProp, states, label, style }: {
28
28
  theme?: BladeTheme;
29
29
  states: readonly ShelfPipState[];
@@ -1,6 +1,9 @@
1
+ import { BladeTheme } from '../utils/themes';
1
2
  export interface YesNoMultiLogoProps {
2
3
  /** Wordmark font size in px; the tiles and pipe scale with it. @default 22 */
3
4
  size?: number;
5
+ color?: string;
6
+ theme?: BladeTheme;
4
7
  className?: string;
5
8
  }
6
9
  /**
@@ -8,6 +11,6 @@ export interface YesNoMultiLogoProps {
8
11
  * Drawn in type and shapes from the brand master (62_YESNO_Multi_Horizontal.svg) so it
9
12
  * follows the theme ink. RN twin: src/react-native/components/YesNoMultiLogo.tsx.
10
13
  */
11
- export declare function YesNoMultiLogo({ size, className }: YesNoMultiLogoProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function YesNoMultiLogo({ size, color, theme: themeProp, className }: YesNoMultiLogoProps): import("react/jsx-runtime").JSX.Element;
12
15
  /** The page sign-off every page ends with: the logo, small and quiet, centred under the content. */
13
- export declare function YesNoMultiFooter(): import("react/jsx-runtime").JSX.Element;
16
+ export declare function YesNoMultiFooter({ color, theme }?: Pick<YesNoMultiLogoProps, 'color' | 'theme'>): import("react/jsx-runtime").JSX.Element;
@@ -81,7 +81,8 @@ export declare const PressCard: React.ForwardRefExoticComponent<PressCardProps &
81
81
  export type IconButtonProps = Omit<ButtonProps, 'variant' | 'size' | 'block'> & {
82
82
  'aria-label': string;
83
83
  size?: number;
84
- tone?: 'default' | 'danger';
84
+ tone?: 'default' | 'danger'; /** The glyph alone: no disc or ring; hover recolours it. */
85
+ bare?: boolean;
85
86
  };
86
87
  /**
87
88
  * Icon-only button (back, close, remove, previous / next): a round disc with a
@@ -92,7 +93,8 @@ export type IconButtonProps = Omit<ButtonProps, 'variant' | 'size' | 'block'> &
92
93
  export declare const IconButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "variant" | "size" | "block"> & {
93
94
  'aria-label': string;
94
95
  size?: number;
95
- tone?: "default" | "danger";
96
+ tone?: "default" | "danger"; /** The glyph alone: no disc or ring; hover recolours it. */
97
+ bare?: boolean;
96
98
  } & React.RefAttributes<HTMLButtonElement>>;
97
99
  export interface TextProps {
98
100
  theme: BladeTheme;