@simple-parlay/components 1.30.6-pre → 1.30.6-pre.11
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/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +653 -451
- package/dist/react/components/CallGameCatalogue.d.ts +4 -0
- package/dist/react/components/CallPayoutTable.d.ts +12 -0
- package/dist/react/components/CallTicketBuilder.d.ts +3 -0
- package/dist/react/components/CorrelationChoicesSkeleton.d.ts +4 -0
- package/dist/react/components/CorrelationPricingDebug.d.ts +2 -0
- package/dist/react/components/CorrelationPropPlaceholder.d.ts +13 -0
- package/dist/react/components/DenseGameCatalogue.d.ts +2 -0
- package/dist/react/components/DenseUi.d.ts +30 -0
- package/dist/react/components/EntriesPage.d.ts +0 -4
- package/dist/react/components/EntrySubmission.d.ts +1 -1
- package/dist/react/components/EventSwipeModal.d.ts +4 -0
- package/dist/react/components/GameCardParts.d.ts +28 -0
- package/dist/react/components/GameModeCard.d.ts +37 -6
- package/dist/react/components/GamePage.d.ts +3 -1
- package/dist/react/components/GameSelector.d.ts +1 -19
- package/dist/react/components/GameSetupPage.d.ts +6 -2
- package/dist/react/components/GameShelfCatalogue.d.ts +2 -0
- package/dist/react/components/GameShowcaseCatalogue.d.ts +11 -0
- package/dist/react/components/GameSkeletons.d.ts +24 -0
- package/dist/react/components/GameVariantCatalogue.d.ts +6 -0
- package/dist/react/components/HowToPlayButton.d.ts +5 -2
- package/dist/react/components/LoadingIndicators.d.ts +27 -10
- package/dist/react/components/MatchRail.d.ts +52 -0
- package/dist/react/components/MatchTopBar.d.ts +19 -0
- package/dist/react/components/MultiLegTable.d.ts +5 -1
- package/dist/react/components/PageBackButton.d.ts +35 -6
- package/dist/react/components/PageSkeletons.d.ts +24 -0
- package/dist/react/components/PickGroupSection.d.ts +37 -0
- package/dist/react/components/PickerBrand.d.ts +0 -5
- package/dist/react/components/PicksSkeletons.d.ts +30 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +75 -6
- package/dist/react/components/PlaybookChooser.d.ts +7 -0
- package/dist/react/components/PropositionFilters.d.ts +2 -1
- package/dist/react/components/PropositionParts.d.ts +38 -0
- package/dist/react/components/QuickPickButton.d.ts +26 -1
- package/dist/react/components/QuickPickMenu.d.ts +19 -1
- package/dist/react/components/SafetyNetPage.d.ts +4 -1
- package/dist/react/components/ScrollShelf.d.ts +5 -1
- package/dist/react/components/SelectionReview.d.ts +1 -1
- package/dist/react/components/SelectionsPage.d.ts +7 -2
- package/dist/react/components/ShelfKit.d.ts +43 -0
- package/dist/react/components/SportRail.d.ts +13 -7
- package/dist/react/components/SportSelector.d.ts +2 -24
- package/dist/react/components/SuccessPage.d.ts +4 -2
- package/dist/react/components/SwipeDeck.d.ts +32 -3
- package/dist/react/components/YesNoMultiLogo.d.ts +13 -0
- package/dist/react/components/_primitives/index.d.ts +54 -13
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +46 -19
- package/dist/react/index.mjs +653 -451
- package/dist/react/utils/dom.d.ts +7 -0
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/themes.d.ts +1 -1
- package/dist/react-native/components/CallGameCatalogue.d.ts +17 -0
- package/dist/react-native/components/CallPayoutTable.d.ts +12 -0
- package/dist/react-native/components/CallTicketBuilder.d.ts +33 -0
- package/dist/react-native/components/CorrelationChoicesSkeleton.d.ts +3 -0
- package/dist/react-native/components/CorrelationPricingDebug.d.ts +2 -0
- package/dist/react-native/components/CorrelationPropPlaceholder.d.ts +7 -0
- package/dist/react-native/components/DenseGameCatalogue.d.ts +2 -0
- package/dist/react-native/components/DenseUi.d.ts +52 -0
- package/dist/react-native/components/EntrySubmission.d.ts +1 -1
- package/dist/react-native/components/EventSwipeModal.d.ts +5 -0
- package/dist/react-native/components/GameCardParts.d.ts +29 -0
- package/dist/react-native/components/GameModeCard.d.ts +34 -5
- package/dist/react-native/components/GamePage.d.ts +4 -1
- package/dist/react-native/components/GameSelector.d.ts +1 -20
- package/dist/react-native/components/GameSetupPage.d.ts +5 -14
- package/dist/react-native/components/GameShelfCatalogue.d.ts +2 -0
- package/dist/react-native/components/GameSkeletons.d.ts +23 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +5 -2
- package/dist/react-native/components/LoadingIndicators.d.ts +23 -11
- package/dist/react-native/components/MatchRail.d.ts +57 -0
- package/dist/react-native/components/MatchTopBar.d.ts +17 -0
- package/dist/react-native/components/MultiLegTable.d.ts +5 -1
- package/dist/react-native/components/PageBackButton.d.ts +32 -9
- package/dist/react-native/components/PageSkeletons.d.ts +23 -0
- package/dist/react-native/components/PickGroupSection.d.ts +37 -0
- package/dist/react-native/components/PickerBrand.d.ts +0 -4
- package/dist/react-native/components/PicksSkeletons.d.ts +31 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +68 -6
- package/dist/react-native/components/PlaybookChooser.d.ts +7 -0
- package/dist/react-native/components/PropositionFilters.d.ts +2 -1
- package/dist/react-native/components/PropositionParts.d.ts +35 -0
- package/dist/react-native/components/QuickPickButton.d.ts +26 -1
- package/dist/react-native/components/QuickPickMenu.d.ts +20 -1
- package/dist/react-native/components/SafetyNetPage.d.ts +4 -1
- package/dist/react-native/components/ScrollShelf.d.ts +8 -1
- package/dist/react-native/components/SelectionReview.d.ts +1 -1
- package/dist/react-native/components/SelectionsPage.d.ts +6 -2
- package/dist/react-native/components/ShelfKit.d.ts +62 -0
- package/dist/react-native/components/SportRail.d.ts +13 -7
- package/dist/react-native/components/SportSelector.d.ts +2 -29
- package/dist/react-native/components/SuccessPage.d.ts +4 -2
- package/dist/react-native/components/SwipeDeck.d.ts +37 -3
- package/dist/react-native/components/YesNoMultiLogo.d.ts +12 -0
- package/dist/react-native/components/_primitives/index.d.ts +93 -12
- package/dist/react-native/index.cjs +1 -0
- package/dist/react-native/index.d.ts +46 -19
- package/dist/react-native/index.mjs +561 -437
- package/dist/react-native/utils/index.d.ts +1 -1
- package/dist/react-native/utils/themes.d.ts +1 -1
- package/dist/shared/api-client.d.ts +4 -3
- package/dist/shared/button-ui.d.ts +62 -0
- package/dist/shared/call-presentation.d.ts +28 -0
- package/dist/shared/canvas.d.ts +14 -0
- package/dist/shared/correlation-steering.d.ts +56 -0
- package/dist/shared/date-filters.d.ts +0 -22
- package/dist/shared/dense-ui.d.ts +54 -0
- package/dist/shared/entry-progress.d.ts +38 -0
- package/dist/shared/game-artwork.d.ts +63 -0
- package/dist/shared/game-flow.d.ts +34 -1
- package/dist/shared/game-icons.d.ts +8 -4
- package/dist/shared/game-library.d.ts +58 -0
- package/dist/shared/game-set-bet.d.ts +0 -1
- package/dist/shared/game-shelf-artwork.d.ts +3 -0
- package/dist/shared/game-shelf-presentation.d.ts +79 -0
- package/dist/shared/game-variants.d.ts +5 -0
- package/dist/shared/hooks.d.ts +8 -8
- package/dist/shared/how-to-play-html.d.ts +1 -1
- package/dist/shared/how-to-play-logo.d.ts +1 -1
- package/dist/shared/menu-placement.d.ts +26 -0
- package/dist/shared/mirror.d.ts +55 -5
- package/dist/shared/picker-brand.d.ts +22 -6
- package/dist/shared/playbook.d.ts +29 -0
- package/dist/shared/selection-actions.d.ts +82 -4
- package/dist/shared/selection-caps.d.ts +124 -0
- package/dist/shared/selection-variants.d.ts +10 -1
- package/dist/shared/shelf-covers.d.ts +92 -0
- package/dist/shared/shelf-ui.d.ts +47 -0
- package/dist/shared/swipe-deck.d.ts +11 -1
- package/dist/shared/themes.d.ts +70 -8
- package/dist/shared/tokens.d.ts +7 -0
- package/dist/shared/types.d.ts +49 -3
- package/dist/shared/ui-system.d.ts +70 -0
- package/dist/shared/ui-variant.d.ts +16 -0
- package/dist/shared/use-call-payouts.d.ts +8 -0
- package/dist/shared/utils.d.ts +20 -7
- package/package.json +7 -8
- package/dist/index.js +0 -1
- package/dist/react/components/GameSetBetPage.d.ts +0 -21
- package/dist/react/components/LadderPage.d.ts +0 -21
- package/dist/react/components/MirrorPage.d.ts +0 -21
- package/dist/react/components/PerfectPickPage.d.ts +0 -22
- package/dist/react/components/PickYourDividendPage.d.ts +0 -21
- package/dist/react/components/RuleSetupPage.d.ts +0 -27
- package/dist/react/components/SixAgainPage.d.ts +0 -16
- package/dist/react/index.js +0 -1
- package/dist/react/utils/design.d.ts +0 -55
- package/dist/react-native/components/GameSetBetPage.d.ts +0 -19
- package/dist/react-native/components/LadderPage.d.ts +0 -19
- package/dist/react-native/components/MirrorPage.d.ts +0 -19
- package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
- package/dist/react-native/components/PickYourDividendPage.d.ts +0 -19
- package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
- package/dist/react-native/components/SixAgainPage.d.ts +0 -14
- package/dist/react-native/index.js +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BladeTheme } from './themes';
|
|
2
|
+
/**
|
|
3
|
+
* Game Shelf covers drawn from the game's own SVG mark instead of the bundled illustrations. `brand` is the designer's
|
|
4
|
+
* art: the YESNO signature stacked tiles (teal at 100 / 55 / 30%) carrying the mark in paper and citron, on stone —
|
|
5
|
+
* the 72_YESNO_Game_Set_Bet_Mark and app-icon system. `mark`, `stacked` and `tile` draw the mark itself on a colour
|
|
6
|
+
* ground. Shared by web and native: this builds the SVG and the geometry, each platform only puts them on screen.
|
|
7
|
+
*/
|
|
8
|
+
export type ShelfCoverStyle = NonNullable<NonNullable<BladeTheme['shelf']>['coverStyle']>;
|
|
9
|
+
export type DrawnCoverStyle = Exclude<ShelfCoverStyle, 'art' | 'brand'>;
|
|
10
|
+
export declare const SHELF_COVER_STYLES: readonly ShelfCoverStyle[];
|
|
11
|
+
export declare const SHELF_COVER_STYLE_LABELS: Record<ShelfCoverStyle, string>;
|
|
12
|
+
export declare function parseShelfCoverStyle(value: string | null | undefined): ShelfCoverStyle | undefined;
|
|
13
|
+
/** The brand art's fixed palette: a product mark, like the YESNO logo tiles, not theme shape. */
|
|
14
|
+
export declare const BRAND_COVER: {
|
|
15
|
+
readonly ground: "#DDD9D2";
|
|
16
|
+
readonly ink: "#0F4C5C";
|
|
17
|
+
readonly tile: "#0F4C5C";
|
|
18
|
+
readonly mark: "#FAFAF7";
|
|
19
|
+
readonly accent: "#DFFF1A";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Grounds for the mark / stacked / tile covers, by icon id. Each holds the default cover ink (#111b36) at 4.5:1 or
|
|
23
|
+
* better under an 18px name, and leaves the light mark and its ink echo both readable.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DRAWN_COVER_COLORS: Record<string, string>;
|
|
26
|
+
/** Category banner grounds for the same styles, from the same palette. */
|
|
27
|
+
export declare const DRAWN_CATEGORY_COLORS: Record<string, string>;
|
|
28
|
+
/** The light half of every drawn mark. */
|
|
29
|
+
export declare const COVER_PAPER = "#fafaf7";
|
|
30
|
+
/** A square, in fractions of its container's width. */
|
|
31
|
+
export interface ArtBox {
|
|
32
|
+
left: number;
|
|
33
|
+
top: number;
|
|
34
|
+
size: number;
|
|
35
|
+
}
|
|
36
|
+
/** A tile behind the mark (the stacked tiles, the press-to-play tile and its shadow); `radius` in fractions of the art box. */
|
|
37
|
+
export interface CoverTile extends ArtBox {
|
|
38
|
+
radius: number;
|
|
39
|
+
color: string;
|
|
40
|
+
opacity: number;
|
|
41
|
+
}
|
|
42
|
+
/** An SVG drawn in the art box. */
|
|
43
|
+
export interface CoverLayer extends ArtBox {
|
|
44
|
+
xml: string;
|
|
45
|
+
opacity?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface DrawnCover {
|
|
48
|
+
/** Where the art sits on a game cover, in fractions of the cover's width. Banners place it themselves. */
|
|
49
|
+
box: ArtBox;
|
|
50
|
+
/** Full-surface SVG behind everything else (the tile style's faded pattern). */
|
|
51
|
+
pattern?: string;
|
|
52
|
+
/** Back to front, in fractions of the art box. */
|
|
53
|
+
tiles: CoverTile[];
|
|
54
|
+
/** The mark, in fractions of the art box. */
|
|
55
|
+
layers: CoverLayer[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Bake colours into an icon's markup: `currentColor` → `ink`, the icon accent → `accent`.
|
|
59
|
+
* `outline` edges every part without a stroke of its own, outside its fill: invisible on the ink
|
|
60
|
+
* body, but it's what holds a light part (a "%", a rung, a seam) against a light ground.
|
|
61
|
+
*/
|
|
62
|
+
export declare function tintIcon(raw: string, ink: string, accent: string, { outline }?: {
|
|
63
|
+
outline?: string;
|
|
64
|
+
}): string;
|
|
65
|
+
/**
|
|
66
|
+
* The mark repeated small and tilted, fading out before the name: `down` on a cover (name at the
|
|
67
|
+
* bottom), `left` on a banner (name on the left). `id` must be unique on the page.
|
|
68
|
+
*/
|
|
69
|
+
export declare function coverPatternXml(raw: string, ink: string, id: string, fade?: 'down' | 'left'): string;
|
|
70
|
+
/**
|
|
71
|
+
* The mark itself on a colour ground, above the name and under the tier chip:
|
|
72
|
+
* - mark: the mark in ink, its accent in paper, every part edged in ink.
|
|
73
|
+
* - stacked: the same mark over a solid echo of itself at a third strength, offset like the brand's stacked tiles.
|
|
74
|
+
* - tile: the press-to-play tile (ink, a hard shadow, the mark in the cover's own colour with a paper accent) on a faded
|
|
75
|
+
* pattern of the mark. Not the theme accent: YESNO's citron reads as a stray green on these grounds.
|
|
76
|
+
* Every style keeps the mark's body in ink (or on the ink tile): a light body on these light grounds can't reach 3:1,
|
|
77
|
+
* and the ink edge is what keeps the light parts readable.
|
|
78
|
+
*/
|
|
79
|
+
export declare function drawnCover(style: DrawnCoverStyle, raw: string, { ink, ground, id, fade }: {
|
|
80
|
+
ink: string;
|
|
81
|
+
ground: string;
|
|
82
|
+
id: string;
|
|
83
|
+
fade?: 'down' | 'left';
|
|
84
|
+
}): DrawnCover;
|
|
85
|
+
/**
|
|
86
|
+
* The designer's stacked mark, measured off 72_YESNO_Game_Set_Bet_Mark: 220 tiles (rx 44) stepping +25/+25 in a
|
|
87
|
+
* 270 box, the back two at 30% and 55%. The mark fills the front tile like the app icon's: a game's in paper with
|
|
88
|
+
* its citron accent; a single-colour glyph (a category's) all in citron, like the lockups' pills.
|
|
89
|
+
*/
|
|
90
|
+
export declare function brandCover(raw: string, ink?: string, accent?: string): DrawnCover;
|
|
91
|
+
/** Web: an icon's markup sized to fill its box, for drawing inline (lettering then takes the page's fonts). */
|
|
92
|
+
export declare function fillBox(xml: string): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game Shelf's one set of measurements. Every Shelf page builds from these, through
|
|
3
|
+
* the ShelfKit components (web + RN), so the screens read as one product:
|
|
4
|
+
* light pages, white cards, one button set, one selected state, one action bar.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SHELF_UI: {
|
|
7
|
+
readonly radius: {
|
|
8
|
+
readonly control: 12;
|
|
9
|
+
readonly card: 16;
|
|
10
|
+
readonly sheet: 24;
|
|
11
|
+
};
|
|
12
|
+
/** Primary / secondary buttons: 52 tall, 44 for the compact size. */
|
|
13
|
+
readonly button: {
|
|
14
|
+
readonly height: 52;
|
|
15
|
+
readonly compact: 44;
|
|
16
|
+
};
|
|
17
|
+
/** Chips, filters, tabs and options; 52 when they carry a second line. */
|
|
18
|
+
readonly option: {
|
|
19
|
+
readonly height: 44;
|
|
20
|
+
readonly tall: 52;
|
|
21
|
+
};
|
|
22
|
+
readonly card: {
|
|
23
|
+
readonly pad: 16;
|
|
24
|
+
};
|
|
25
|
+
readonly dock: {
|
|
26
|
+
readonly pad: 12;
|
|
27
|
+
readonly gap: 8;
|
|
28
|
+
readonly offset: 12;
|
|
29
|
+
};
|
|
30
|
+
readonly pip: {
|
|
31
|
+
readonly height: 6;
|
|
32
|
+
readonly radius: 3;
|
|
33
|
+
readonly gap: 4;
|
|
34
|
+
};
|
|
35
|
+
/** Between cards, and from the page header to the first card. */
|
|
36
|
+
readonly gap: 12;
|
|
37
|
+
readonly headerGap: 16;
|
|
38
|
+
readonly type: {
|
|
39
|
+
readonly money: 26;
|
|
40
|
+
readonly listMoney: 18;
|
|
41
|
+
readonly bandMoney: 22;
|
|
42
|
+
readonly label: 14;
|
|
43
|
+
readonly muted: 13;
|
|
44
|
+
readonly tag: 12;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type ShelfPipState = 'right' | 'miss' | 'open';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Proposition } from './types';
|
|
2
2
|
export type FlyDirection = 'right' | 'left' | 'up';
|
|
3
|
+
/**
|
|
4
|
+
* How the swipe deck looks. `stack` is the card pile with Yes/No/Skip stamps;
|
|
5
|
+
* `run` is one card at a time over big Yes/No pads, with the picks numbered
|
|
6
|
+
* down a column beside it.
|
|
7
|
+
*/
|
|
8
|
+
export type SwipeVariant = 'stack' | 'run';
|
|
3
9
|
/** How many cards the deck renders in the stack at once. */
|
|
4
10
|
export declare const VISIBLE_DEPTH = 3;
|
|
5
11
|
export interface SwipeDeckState {
|
|
@@ -14,9 +20,13 @@ export interface SwipeDeckState {
|
|
|
14
20
|
} | null;
|
|
15
21
|
resolve: (id: number, answer: 'yes' | 'no' | null) => void;
|
|
16
22
|
undo: () => void;
|
|
23
|
+
/** Whether {@link recall} can bring this pick back — it has to be answered and in this deck's pool. */
|
|
24
|
+
canRecall: (id: number) => boolean;
|
|
25
|
+
/** Clears a pick and puts its card back on top, to be answered again. */
|
|
26
|
+
recall: (id: number) => void;
|
|
17
27
|
}
|
|
18
28
|
/**
|
|
19
29
|
* The platform-free half of the swipe deck — queue, visible stack, and what
|
|
20
30
|
* skip/answer/undo do. The twins wrap it with their own gesture layers.
|
|
21
31
|
*/
|
|
22
|
-
export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void): SwipeDeckState;
|
|
32
|
+
export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void, isBlocked?: (prop: Proposition) => boolean): SwipeDeckState;
|
package/dist/shared/themes.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme types and color data shared between React and React Native.
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific helpers (CSS custom properties on web, font fallbacks
|
|
5
|
-
* on RN) live in their respective utils/themes.ts files and re-export
|
|
6
|
-
* everything from here.
|
|
7
|
-
*/
|
|
8
1
|
export declare function themeHeading(t: BladeTheme): string;
|
|
9
2
|
export declare function themeLabel(t: BladeTheme): string;
|
|
10
3
|
export declare function themeValue(t: BladeTheme): string;
|
|
@@ -14,9 +7,30 @@ export declare function themeValue(t: BladeTheme): string;
|
|
|
14
7
|
* allowed. Point the Yes/No control at these, never at brand or status tokens.
|
|
15
8
|
*/
|
|
16
9
|
export declare const PRODUCT_YES = "#00C853";
|
|
17
|
-
export declare const PRODUCT_NO = "#
|
|
10
|
+
export declare const PRODUCT_NO = "#D32F2F";
|
|
11
|
+
/** Dark ink for text on a light product fill — 5.4:1 on PRODUCT_YES, where white is only 2.2:1. */
|
|
12
|
+
export declare const PRODUCT_INK = "#123B45";
|
|
18
13
|
export declare function themeProductYes(t: BladeTheme): string;
|
|
19
14
|
export declare function themeProductNo(t: BladeTheme): string;
|
|
15
|
+
/** Text on a Yes/No product fill: white, or PRODUCT_INK when the fill is light. */
|
|
16
|
+
export declare function productTextOn(fill: string): string;
|
|
17
|
+
export type FontWeightValue = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
18
|
+
export type FontFaces = Partial<Record<FontWeightValue, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* The font file for a family at a weight, from `theme.fonts.faces`, picked
|
|
21
|
+
* the way CSS matches weights: 400–500 look up to 500, then down, then up;
|
|
22
|
+
* lighter looks down first; heavier looks up first. Undefined when the
|
|
23
|
+
* family has no faces listed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fontFace(theme: BladeTheme | undefined, family: string | undefined, weight: string | number | undefined): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The theme for content drawn straight on the host page rather than inside a
|
|
28
|
+
* card. The same theme on a light page; on a `canvas` page its inks become
|
|
29
|
+
* the on-canvas ones and `primary` becomes the brand accent (selected tabs,
|
|
30
|
+
* dots, back-link hover), so nothing paints dark-on-dark. Cards inside such
|
|
31
|
+
* content take the normal theme.
|
|
32
|
+
*/
|
|
33
|
+
export declare function canvasTheme(t: BladeTheme): BladeTheme;
|
|
20
34
|
export declare function themeAccent(t: BladeTheme): string;
|
|
21
35
|
export declare function themeBrandChip(t: BladeTheme): string;
|
|
22
36
|
export declare function accentOnSurface(surface: string, accent: string | undefined, fallback: string): string;
|
|
@@ -78,6 +92,18 @@ export interface BladeTheme {
|
|
|
78
92
|
surface?: string;
|
|
79
93
|
surfaceElevated?: string;
|
|
80
94
|
borderSubtle?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The host page the components sit on, when it isn't a light page — e.g.
|
|
97
|
+
* a dark brand background with content in white cards. Whatever is drawn
|
|
98
|
+
* straight on it (page titles, labels, quiet buttons, selected tabs) uses
|
|
99
|
+
* `canvasTheme(theme)`; cards keep `background`. Unset: a light page.
|
|
100
|
+
* Not `shelf.canvas`, which is the Shelf system's own panel colour.
|
|
101
|
+
*/
|
|
102
|
+
canvas?: string;
|
|
103
|
+
/** Text and icons straight on `canvas`. Default: white or `text`, whichever reads. */
|
|
104
|
+
onCanvas?: string;
|
|
105
|
+
/** Secondary text straight on `canvas`. Default: `onCanvas` at 72%. */
|
|
106
|
+
onCanvasMuted?: string;
|
|
81
107
|
text: string;
|
|
82
108
|
textAlt?: string;
|
|
83
109
|
textAltMuted?: string;
|
|
@@ -92,6 +118,35 @@ export interface BladeTheme {
|
|
|
92
118
|
buttonSecondaryHover: string;
|
|
93
119
|
buttonSecondaryText: string;
|
|
94
120
|
};
|
|
121
|
+
/** Optional Game Shelf skin. Omitted values follow the normal theme colors. */
|
|
122
|
+
shelf?: {
|
|
123
|
+
canvas?: string;
|
|
124
|
+
onCanvas?: string;
|
|
125
|
+
surface?: string;
|
|
126
|
+
text?: string;
|
|
127
|
+
muted?: string;
|
|
128
|
+
accent?: string;
|
|
129
|
+
button?: string;
|
|
130
|
+
buttonText?: string;
|
|
131
|
+
coverText?: string;
|
|
132
|
+
coverColors?: Record<string, string>;
|
|
133
|
+
/** Cover colour for games without artwork, by tier id (signature / premier / exclusive). */
|
|
134
|
+
tierColors?: Record<string, string>;
|
|
135
|
+
/** Replacement artwork by game icon id — Shelf covers and Showcase tiles; null hides the bundled Shelf cover. */
|
|
136
|
+
artwork?: Record<string, string | null>;
|
|
137
|
+
/**
|
|
138
|
+
* How Shelf covers and category banners are drawn. `brand` (default): no illustrations — every game cover is the
|
|
139
|
+
* YESNO stacked tiles carrying the game's mark on stone, and every category banner its glyph. `art`: the
|
|
140
|
+
* illustrations, with a game that has none drawn in `brand`. `mark` / `stacked` / `tile`: the mark itself on a
|
|
141
|
+
* colour ground — big, over a solid echo, or on a press-to-play tile over a faded pattern of it.
|
|
142
|
+
*/
|
|
143
|
+
coverStyle?: 'art' | 'brand' | 'mark' | 'stacked' | 'tile';
|
|
144
|
+
/** Replacement Showcase hero image by category (sports / racing / prediction / fantasy); null hides it. */
|
|
145
|
+
heroArtwork?: Record<string, string | null>;
|
|
146
|
+
categoryColors?: Record<string, string>;
|
|
147
|
+
/** Replacement category artwork; null hides the bundled image. */
|
|
148
|
+
categoryArtwork?: Record<string, string | null>;
|
|
149
|
+
};
|
|
95
150
|
brand?: {
|
|
96
151
|
chip?: string;
|
|
97
152
|
text?: string;
|
|
@@ -102,6 +157,13 @@ export interface BladeTheme {
|
|
|
102
157
|
body: string;
|
|
103
158
|
heading?: string;
|
|
104
159
|
mono?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Fonts loaded one file per weight, as Expo loads them
|
|
162
|
+
* (`{ Roboto: { 400: 'Roboto_400Regular', 700: 'Roboto_700Bold' } }`),
|
|
163
|
+
* keyed by the family named in body/heading. React Native picks the
|
|
164
|
+
* nearest loaded weight by CSS rules; web ignores it.
|
|
165
|
+
*/
|
|
166
|
+
faces?: Record<string, FontFaces>;
|
|
105
167
|
};
|
|
106
168
|
spacing?: {
|
|
107
169
|
sm: string;
|
package/dist/shared/tokens.d.ts
CHANGED
|
@@ -46,6 +46,13 @@ export interface ResolvedTokens {
|
|
|
46
46
|
export declare const EASING_STANDARD = "cubic-bezier(0.2, 0, 0, 1)";
|
|
47
47
|
export declare const DURATION_FAST = 160;
|
|
48
48
|
export declare const DURATION_STD = 220;
|
|
49
|
+
/**
|
|
50
|
+
* A component's designed corner radius, moved onto the host theme's radius
|
|
51
|
+
* scale — the same slots `resolveTokens` uses: ~8px → sm, ~12px → md,
|
|
52
|
+
* 14px and up → lg, 999 (pill) → full. Small details (6px and under) keep
|
|
53
|
+
* their own radius, as does a theme without `borderRadius`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function themeRadius(theme: BladeTheme | undefined, px: number): number;
|
|
49
56
|
export declare function resolveTokens(theme: BladeTheme): ResolvedTokens;
|
|
50
57
|
/**
|
|
51
58
|
* Soft, themed elevation for a card/menu that lifts off the page. Single source
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { GameVariant } from './game-variants';
|
|
2
|
+
import { UiVariant } from './ui-variant';
|
|
1
3
|
import { ReactNode } from 'react';
|
|
2
4
|
import { SelectionVariant } from './selection-variants';
|
|
3
5
|
import { BladeTheme, BladeThemeSet, ColorScheme } from './themes';
|
|
@@ -28,6 +30,8 @@ export interface RuleExpressionObject {
|
|
|
28
30
|
validated?: boolean;
|
|
29
31
|
expression: string;
|
|
30
32
|
}
|
|
33
|
+
/** The game categories BLADE files a game under. */
|
|
34
|
+
export type GameCategory = 'sports' | 'casino' | 'racing' | 'prediction' | 'fantasy';
|
|
31
35
|
export interface Game {
|
|
32
36
|
id: number;
|
|
33
37
|
game_name: string;
|
|
@@ -67,6 +71,12 @@ export interface Game {
|
|
|
67
71
|
};
|
|
68
72
|
};
|
|
69
73
|
operator_margin?: number;
|
|
74
|
+
/**
|
|
75
|
+
* BLADE's quote-rounding switch: when true (or absent) quotes round to the
|
|
76
|
+
* nearest `payout_structure.round_to` (default $1); explicit false means the
|
|
77
|
+
* backend quotes exact and blade must not re-round.
|
|
78
|
+
*/
|
|
79
|
+
round_payouts?: boolean;
|
|
70
80
|
jackpot_enabled?: boolean;
|
|
71
81
|
jackpot_amount?: number;
|
|
72
82
|
jackpot_limit?: number | null;
|
|
@@ -77,6 +87,7 @@ export interface Game {
|
|
|
77
87
|
/** Boolean alias for APIs that expose selection scope as a flag. */
|
|
78
88
|
require_same_event?: boolean;
|
|
79
89
|
require_distinct_events?: boolean;
|
|
90
|
+
sgm_mode?: 'off' | 'any' | 'limited' | 'limited_2p';
|
|
80
91
|
allocations?: GameAllocation[];
|
|
81
92
|
rule_expression?: string | RuleExpressionObject | null;
|
|
82
93
|
min_bet?: number | null;
|
|
@@ -180,6 +191,8 @@ export interface GameEntry {
|
|
|
180
191
|
selections?: Record<number, 'yes' | 'no'>;
|
|
181
192
|
pending: boolean;
|
|
182
193
|
winning?: number;
|
|
194
|
+
/** Raw API field for the payout; normalised into `winning` by the client. */
|
|
195
|
+
win_amount?: number;
|
|
183
196
|
expected_correct?: number;
|
|
184
197
|
bet_amount?: number;
|
|
185
198
|
stake?: number;
|
|
@@ -242,7 +255,7 @@ export interface PlaceEntryFlowProps {
|
|
|
242
255
|
onBeforeSubmit?: (betAmount: number) => void | Promise<void>;
|
|
243
256
|
onCancel?: () => void;
|
|
244
257
|
initialGameId?: number;
|
|
245
|
-
gameCategory?:
|
|
258
|
+
gameCategory?: GameCategory;
|
|
246
259
|
jurisdiction?: string;
|
|
247
260
|
/** Supply demo/test data instead of hitting the API */
|
|
248
261
|
demoGames?: Game[];
|
|
@@ -264,6 +277,7 @@ export interface PlaceEntryFlowProps {
|
|
|
264
277
|
* Proposition layout for every selection screen in the flow. Omit for the
|
|
265
278
|
* packaged matchup list, which stays the default.
|
|
266
279
|
*/
|
|
280
|
+
uiVariant?: UiVariant;
|
|
267
281
|
selectionVariant?: SelectionVariant;
|
|
268
282
|
/** Drop the per-fixture swipe deck offered by the variant layouts. @default false */
|
|
269
283
|
disableEventSwipe?: boolean;
|
|
@@ -280,6 +294,15 @@ export interface PlaceEntryFlowProps {
|
|
|
280
294
|
howToPlayMarkdown?: string | null;
|
|
281
295
|
}
|
|
282
296
|
export interface GameSelectorProps {
|
|
297
|
+
/** Game discovery layout; overrides the UI system's default. Web renders cards, split, compare, shelf and showcase; native renders shelf and falls back to the system's layout for the rest. */
|
|
298
|
+
gameVariant?: GameVariant;
|
|
299
|
+
/** Showcase: `games` is already a curated set, so leave out the dimmed tiles for games not on offer. */
|
|
300
|
+
onlyListedGames?: boolean;
|
|
301
|
+
/** Showcase: leave out the hero image at the top. */
|
|
302
|
+
disableImage?: boolean;
|
|
303
|
+
/** @deprecated Layouts no longer draw their own header; back lives in the page header (`GamePageTitle` / `PageHeader`). */
|
|
304
|
+
onBack?: () => void;
|
|
305
|
+
uiVariant?: UiVariant;
|
|
283
306
|
games: Game[];
|
|
284
307
|
selectedGame: Game | null;
|
|
285
308
|
onSelectGame: (game: Game) => void;
|
|
@@ -297,6 +320,8 @@ export interface GameSelectorProps {
|
|
|
297
320
|
/** Called when a proposition count option is picked (can be used to auto-advance) */
|
|
298
321
|
onPropositionCountSelected?: () => void;
|
|
299
322
|
onQuickPickGame?: (game: Game, count: number) => void;
|
|
323
|
+
/** Show quick-pick tiles while their required selection pool is loading. */
|
|
324
|
+
quickPickLoading?: boolean;
|
|
300
325
|
/** Max payout data per game ID (from /max-payout endpoint) */
|
|
301
326
|
maxPayouts?: Record<number, TopPayoutsResponse>;
|
|
302
327
|
}
|
|
@@ -305,7 +330,8 @@ export interface SportSelectorProps {
|
|
|
305
330
|
propositions: Proposition[];
|
|
306
331
|
selections: Record<number, 'yes' | 'no'>;
|
|
307
332
|
onToggleSelection: (id: number, answer: 'yes' | 'no') => void;
|
|
308
|
-
|
|
333
|
+
/** Next step: the list's auto-advance, its QuickPick and its footer button. Optional when the page around it owns those. */
|
|
334
|
+
onNext?: () => void;
|
|
309
335
|
onBack: () => void;
|
|
310
336
|
loading?: boolean;
|
|
311
337
|
error?: string | null;
|
|
@@ -313,7 +339,7 @@ export interface SportSelectorProps {
|
|
|
313
339
|
colorScheme?: ColorScheme;
|
|
314
340
|
hideActions?: boolean;
|
|
315
341
|
initialSport?: string;
|
|
316
|
-
gameCategory?:
|
|
342
|
+
gameCategory?: GameCategory;
|
|
317
343
|
renderTeamLogo?: RenderTeamLogo;
|
|
318
344
|
/** Hide the Quick Pick button and count input. @default false */
|
|
319
345
|
disableQuickPick?: boolean;
|
|
@@ -326,6 +352,12 @@ export interface SportSelectorProps {
|
|
|
326
352
|
onPropositionCountChange?: (count: number) => void;
|
|
327
353
|
allowAnswerToggle?: boolean;
|
|
328
354
|
headerExtra?: ReactNode;
|
|
355
|
+
/**
|
|
356
|
+
* Sport rail for the header row. A node draws to the left of the filter and
|
|
357
|
+
* view controls; a function is handed those controls to place itself, which
|
|
358
|
+
* is how the rail keeps the full width for its track.
|
|
359
|
+
*/
|
|
360
|
+
railSlot?: ReactNode | ((actions: ReactNode) => ReactNode);
|
|
329
361
|
/**
|
|
330
362
|
* Which proposition layout to draw. Omitted (the default) is the packaged
|
|
331
363
|
* matchup list; the variants are YESNO's fixture-first designs. Falls back to
|
|
@@ -354,6 +386,11 @@ export interface EntrySubmissionProps {
|
|
|
354
386
|
winningCounts?: number[];
|
|
355
387
|
payouts?: Record<number, number>;
|
|
356
388
|
renderTeamLogo?: RenderTeamLogo;
|
|
389
|
+
/**
|
|
390
|
+
* Component legs of composite propositions, by id — lets a composite row
|
|
391
|
+
* name the fixture each leg is from. See SelectionReviewProps.componentById.
|
|
392
|
+
*/
|
|
393
|
+
componentById?: ReadonlyMap<number, Proposition> | null;
|
|
357
394
|
/** Show the free-text custom amount input. @default false */
|
|
358
395
|
showCustomAmount?: boolean;
|
|
359
396
|
/**
|
|
@@ -365,6 +402,8 @@ export interface EntrySubmissionProps {
|
|
|
365
402
|
/** Note shown beside the locked stake, e.g. "set by your dividend ladder". */
|
|
366
403
|
betAmountLockedNote?: string;
|
|
367
404
|
canSubmit?: boolean;
|
|
405
|
+
/** The first press of the two-stage submit landed — the button reads "Confirm entry". */
|
|
406
|
+
confirming?: boolean;
|
|
368
407
|
/**
|
|
369
408
|
* When false, the bet amount and Place Entry cards are replaced by a log-in
|
|
370
409
|
* prompt — pressing it calls `onSubmit`. @default true
|
|
@@ -389,6 +428,13 @@ export interface SelectionReviewProps {
|
|
|
389
428
|
gameName?: string;
|
|
390
429
|
potentialPayout?: number;
|
|
391
430
|
defaultExpanded?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Component legs of composite propositions, by id. Supply it and a composite
|
|
433
|
+
* row names the fixture each leg comes from — without it a cross-event
|
|
434
|
+
* composite reads as one run-on sentence with no clue the halves are from
|
|
435
|
+
* different games. `usePlaceEntry().compositeComponentById` provides it.
|
|
436
|
+
*/
|
|
437
|
+
componentById?: ReadonlyMap<number, Proposition> | null;
|
|
392
438
|
addMorePicks?: {
|
|
393
439
|
remaining: number;
|
|
394
440
|
max: number;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { UiVariant } from './ui-variant';
|
|
2
|
+
export interface UiSystemPages {
|
|
3
|
+
games: 'kit' | 'playbook' | 'call' | 'shelf' | 'dense';
|
|
4
|
+
picks: 'kit' | 'shelf' | 'call' | 'dense';
|
|
5
|
+
setup: 'kit' | 'ticket' | 'dense';
|
|
6
|
+
}
|
|
7
|
+
export interface PageHeaderSpec {
|
|
8
|
+
/**
|
|
9
|
+
* stacked — title, then a ← context row beneath it.
|
|
10
|
+
* toolbar — round back button + context eyebrow above a display title.
|
|
11
|
+
* bar — one compact ruled row: back, title, actions.
|
|
12
|
+
*/
|
|
13
|
+
layout: 'stacked' | 'toolbar' | 'bar';
|
|
14
|
+
/** Title px on phones, then from 640px. */
|
|
15
|
+
size: readonly [number, number];
|
|
16
|
+
weight: 700 | 800 | 850;
|
|
17
|
+
/** Letter-spacing in em. */
|
|
18
|
+
tracking: number;
|
|
19
|
+
lineHeight: number;
|
|
20
|
+
}
|
|
21
|
+
export interface YesNoSpec {
|
|
22
|
+
fill: 'product' | 'primary' | 'button';
|
|
23
|
+
/** Metrics that replace the xs/sm/md size ramp. */
|
|
24
|
+
box?: {
|
|
25
|
+
minHeight: number;
|
|
26
|
+
minWidth: number;
|
|
27
|
+
padX: number;
|
|
28
|
+
padY: number;
|
|
29
|
+
radius: number;
|
|
30
|
+
fontSize: number;
|
|
31
|
+
weight: 700 | 750;
|
|
32
|
+
};
|
|
33
|
+
/** A ✓ before the selected label. */
|
|
34
|
+
check?: boolean;
|
|
35
|
+
/** Tiny "Selected" caption under the selected label. */
|
|
36
|
+
caption?: boolean;
|
|
37
|
+
/** Dim disabled sides (default true). */
|
|
38
|
+
dimDisabled?: boolean;
|
|
39
|
+
/** The read-only Yes/No tag: capitals (default) or sentence case. */
|
|
40
|
+
tagCase?: 'upper' | 'sentence';
|
|
41
|
+
}
|
|
42
|
+
/** The match scroll bar on the picks screen: fixture chips between previous / next buttons. */
|
|
43
|
+
export interface MatchRailSpec {
|
|
44
|
+
/** Chip and button corner radius in px; 999 is a pill. */
|
|
45
|
+
radius: number;
|
|
46
|
+
/** The selected chip fills with the theme's button colour or its primary. */
|
|
47
|
+
fill: 'button' | 'primary';
|
|
48
|
+
/** Pick count after the label: inline "· 2", or a round badge. */
|
|
49
|
+
count: 'inline' | 'badge';
|
|
50
|
+
}
|
|
51
|
+
export interface UiSystem {
|
|
52
|
+
label: string;
|
|
53
|
+
pages: UiSystemPages;
|
|
54
|
+
pageHeader: PageHeaderSpec;
|
|
55
|
+
yesNo: YesNoSpec;
|
|
56
|
+
matchRail: MatchRailSpec;
|
|
57
|
+
/**
|
|
58
|
+
* yesno — the green/red split button with a QUICKPICK caption.
|
|
59
|
+
* solid — one filled button: bolt mark + "QuickPick", a chevron when it opens a count menu.
|
|
60
|
+
* deck — a small deck of picks: the game icons' stacked tiles, an accent bolt tile and a line saying what it will do.
|
|
61
|
+
*/
|
|
62
|
+
quickPick: 'yesno' | 'solid' | 'deck';
|
|
63
|
+
/** Sport selector: the pill-track segmented control, or the match rail's chips. */
|
|
64
|
+
sportRail: 'segmented' | 'chips';
|
|
65
|
+
}
|
|
66
|
+
export declare const UI_SYSTEMS: Record<UiVariant, UiSystem>;
|
|
67
|
+
export declare function uiSystem(variant: UiVariant | undefined): UiSystem;
|
|
68
|
+
export declare function useUiSystem(): UiSystem;
|
|
69
|
+
/** Systems whose picks screen is the Game Shelf one: fixture tabs, inline Yes/No, one-row dock. */
|
|
70
|
+
export declare function usesShelfPicks(value: unknown): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BladeTheme } from './themes';
|
|
2
|
+
/** Presentation only. Omit to preserve the original component library UI. */
|
|
3
|
+
export type DenseUiVariant = 'playboard' | 'matchbook' | 'game-deck';
|
|
4
|
+
export type UiVariant = 'default' | 'playbook' | 'call' | 'shelf' | DenseUiVariant;
|
|
5
|
+
export declare const UI_VARIANTS: readonly UiVariant[];
|
|
6
|
+
export declare const UI_VARIANT_LABELS: Record<UiVariant, string>;
|
|
7
|
+
export declare function isDenseUiVariant(value: unknown): value is DenseUiVariant;
|
|
8
|
+
export declare function parseUiVariant(value: unknown): UiVariant;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated UI systems no longer change theming — they only swap components.
|
|
11
|
+
* Pass a theme yourself; this returns the palette a system used to force, or
|
|
12
|
+
* undefined.
|
|
13
|
+
*/
|
|
14
|
+
export declare function uiVariantTheme(variant: UiVariant, colorScheme?: 'light' | 'dark'): BladeTheme | undefined;
|
|
15
|
+
export declare const UiVariantContext: import('react').Context<UiVariant>;
|
|
16
|
+
export declare function useUiVariant(): UiVariant;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Game, EntryPreviewRequest, EntryPreviewResponse } from './types';
|
|
2
|
+
import { CallPayoutView } from './call-presentation';
|
|
3
|
+
export type PreviewCallPayouts = (gameId: number, request: EntryPreviewRequest) => Promise<EntryPreviewResponse>;
|
|
4
|
+
/** Reuse the review endpoint: configured estimates never overwrite a live quote. */
|
|
5
|
+
export declare function useCallPayouts(preview: PreviewCallPayouts | undefined, game: Game | null, count: number, stake: number, expectedCorrect: number, ruleId: number | null | undefined, fallback: CallPayoutView | null): {
|
|
6
|
+
view: CallPayoutView | null;
|
|
7
|
+
estimated: boolean;
|
|
8
|
+
};
|
package/dist/shared/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Game, GamePermittedRule, Proposition, QuickPickResult } from './types';
|
|
2
|
-
export declare const DEFAULT_STAKE =
|
|
1
|
+
import { Game, GamePermittedRule, Proposition, QuickPickResult, GameCategory } from './types';
|
|
2
|
+
export declare const DEFAULT_STAKE = 20;
|
|
3
3
|
export declare function stripColumns(count: number, containerWidth: number): number;
|
|
4
4
|
export declare function resolvePrice(price: number | string | {
|
|
5
5
|
amount: number | string;
|
|
@@ -7,14 +7,19 @@ export declare function resolvePrice(price: number | string | {
|
|
|
7
7
|
} | null | undefined): number;
|
|
8
8
|
export declare function toNumber(value: unknown): number;
|
|
9
9
|
export declare function toBool(value: unknown): boolean;
|
|
10
|
-
export
|
|
10
|
+
export interface YesNoLabels {
|
|
11
|
+
yes: string;
|
|
12
|
+
no: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_YES_NO_LABELS: YesNoLabels;
|
|
15
|
+
export declare function formatYesNo(value: string, labels?: YesNoLabels): string;
|
|
11
16
|
export declare function formatCurrency(value: number): string;
|
|
12
17
|
export declare function formatDate(date: Date | string): string;
|
|
13
18
|
export declare function groupPropositionsBySport(propositions: Proposition[]): Record<string, Proposition[]>;
|
|
14
19
|
export declare function getPropositionSportKey(prop: Proposition, pool?: Proposition[]): string;
|
|
15
20
|
export declare function collectPropositionSportKeys(propositions: Proposition[]): string[];
|
|
16
21
|
export declare function groupPropositionsByCategory(propositions: Proposition[]): Record<string, Proposition[]>;
|
|
17
|
-
export type EntryCategory =
|
|
22
|
+
export type EntryCategory = GameCategory;
|
|
18
23
|
export declare const ENTRY_CATEGORY_ORDER: EntryCategory[];
|
|
19
24
|
export declare function getPropositionEntryCategory(prop: Proposition): EntryCategory;
|
|
20
25
|
/**
|
|
@@ -58,13 +63,18 @@ export declare function getJackpotInfo(game: Game): {
|
|
|
58
63
|
limit: number;
|
|
59
64
|
progressive: boolean;
|
|
60
65
|
};
|
|
61
|
-
export declare function isRacingCategory(gameCategory?:
|
|
66
|
+
export declare function isRacingCategory(gameCategory?: GameCategory, propositions?: Proposition[], sportBaseKey?: string | null): boolean;
|
|
62
67
|
export declare function getSportDisplayName(sport: string, sportBaseKey?: string | null): string;
|
|
63
68
|
/** Host-supplied UI labels keyed by sport key (e.g. `basketball_nba` → `NBA`). */
|
|
64
69
|
export type SportDisplayNameOverrides = Record<string, string>;
|
|
65
70
|
/** Host-supplied UI labels keyed by entry category (e.g. `sports`, `casino`, `racing`). */
|
|
66
71
|
export type CategoryDisplayNameOverrides = Record<string, string>;
|
|
67
72
|
export declare function resolveSportDisplayName(sport: string, overrides?: SportDisplayNameOverrides | null, sportBaseKey?: string | null): string;
|
|
73
|
+
export declare function resolveSportLabel(sport: string, sources: {
|
|
74
|
+
overrides?: SportDisplayNameOverrides | null;
|
|
75
|
+
summaryLabel?: string | null;
|
|
76
|
+
sportBaseKey?: string | null;
|
|
77
|
+
}): string;
|
|
68
78
|
export declare function resolveCategoryDisplayName(category: string, overrides?: CategoryDisplayNameOverrides | null): string;
|
|
69
79
|
/**
|
|
70
80
|
* Filter propositions to only those allowed by a game's constraints.
|
|
@@ -109,10 +119,11 @@ export declare function isGameAvailableToday(game: Game, now?: Date): boolean;
|
|
|
109
119
|
export declare function getAvailableDaysLabel(game: Game): string | null;
|
|
110
120
|
export declare function contrastTextColour(bgColor: string | undefined | null, lightText?: string, darkText?: string): string;
|
|
111
121
|
export declare function readableColor(bg: string | undefined | null, desired: string | undefined | null, fallback: string, minRatio?: number): string;
|
|
112
|
-
|
|
122
|
+
export declare function predictionTopic(p: Proposition): string | undefined;
|
|
123
|
+
/** Group propositions by matchup (home_team vs away_team); prediction questions by topic. */
|
|
113
124
|
export declare function groupByMatchup(props: Proposition[]): Record<string, Proposition[]>;
|
|
114
125
|
export declare function groupByRace(props: Proposition[]): Record<string, Proposition[]>;
|
|
115
|
-
export declare function groupPropositionsForDisplay(props: Proposition[], gameCategory?:
|
|
126
|
+
export declare function groupPropositionsForDisplay(props: Proposition[], gameCategory?: GameCategory, sportBaseKey?: string | null): Record<string, Proposition[]>;
|
|
116
127
|
/**
|
|
117
128
|
* Group picks under the event they belong to, keeping pick order. The key is
|
|
118
129
|
* the "A vs B" matchup, the race name, or `null` for props with no event.
|
|
@@ -130,3 +141,5 @@ export declare function getPayoutForCount(game: Game, count: number, price: numb
|
|
|
130
141
|
* Returns the picks without side effects — callers apply them via onToggleSelection.
|
|
131
142
|
*/
|
|
132
143
|
export declare function generateQuickPick(propositions: Proposition[], totalToAnswer: number): QuickPickResult;
|
|
144
|
+
/** Holds the host page still under one of our modals; returns the release. Web only. */
|
|
145
|
+
export declare function lockPageScroll(doc: Document): () => void;
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simple-parlay/components",
|
|
3
|
-
"version": "1.30.6-pre",
|
|
3
|
+
"version": "1.30.6-pre.11",
|
|
4
4
|
"description": "UI components, hooks, and utilities for React and React Native",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.mjs",
|
|
13
|
-
"require": "./dist/index.
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
15
|
"./react": {
|
|
16
16
|
"types": "./dist/react/index.d.ts",
|
|
17
17
|
"import": "./dist/react/index.mjs",
|
|
18
|
-
"require": "./dist/react/index.
|
|
18
|
+
"require": "./dist/react/index.cjs"
|
|
19
19
|
},
|
|
20
20
|
"./react-native": {
|
|
21
21
|
"types": "./dist/react-native/index.d.ts",
|
|
22
22
|
"import": "./dist/react-native/index.mjs",
|
|
23
|
-
"require": "./dist/react-native/index.
|
|
23
|
+
"require": "./dist/react-native/index.cjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
@@ -48,9 +48,7 @@
|
|
|
48
48
|
"test:e2e:ui": "playwright test --ui",
|
|
49
49
|
"test:visual": "playwright test --config playwright.visual.config.ts",
|
|
50
50
|
"dev:expo": "npm run start --prefix dev-expo",
|
|
51
|
-
"prepublishOnly": "npm run build"
|
|
52
|
-
"generate:how-to-play-logo": "node scripts/embed-how-to-play-logo.mjs",
|
|
53
|
-
"generate:game-icons": "node scripts/embed-game-icons.mjs"
|
|
51
|
+
"prepublishOnly": "npm run build"
|
|
54
52
|
},
|
|
55
53
|
"keywords": [
|
|
56
54
|
"components",
|
|
@@ -91,6 +89,7 @@
|
|
|
91
89
|
"msw": "^2.12.10",
|
|
92
90
|
"react": "^18.2.0",
|
|
93
91
|
"react-dom": "^18.2.0",
|
|
92
|
+
"react-native": "^0.86.2",
|
|
94
93
|
"react-native-svg": "^15.15.4",
|
|
95
94
|
"react-native-web": "^0.21.2",
|
|
96
95
|
"terser": "^5.46.1",
|