@simple-parlay/components 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +71 -0
- package/README.md +196 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +325 -0
- package/dist/react/components/BrandLockup.d.ts +18 -0
- package/dist/react/components/BrandLogo.d.ts +17 -0
- package/dist/react/components/CategoryPickerPage.d.ts +22 -0
- package/dist/react/components/ConfirmPage.d.ts +23 -0
- package/dist/react/components/EntriesPage.d.ts +19 -0
- package/dist/react/components/EntrySubmission.d.ts +2 -0
- package/dist/react/components/EventFilterBanner.d.ts +4 -0
- package/dist/react/components/EventPickerPage.d.ts +5 -0
- package/dist/react/components/GameEntries.d.ts +2 -0
- package/dist/react/components/GameLogo.d.ts +10 -0
- package/dist/react/components/GameModeCard.d.ts +34 -0
- package/dist/react/components/GamePage.d.ts +36 -0
- package/dist/react/components/GameSelector.d.ts +2 -0
- package/dist/react/components/GameSetBetPage.d.ts +21 -0
- package/dist/react/components/GameSetupPage.d.ts +27 -0
- package/dist/react/components/HowToPlayButton.d.ts +28 -0
- package/dist/react/components/HowToPlayPropsTable.d.ts +6 -0
- package/dist/react/components/HtmlContent.d.ts +5 -0
- package/dist/react/components/IconSvg.d.ts +11 -0
- package/dist/react/components/LadderPage.d.ts +21 -0
- package/dist/react/components/LoadingIndicators.d.ts +67 -0
- package/dist/react/components/MarkdownContent.d.ts +13 -0
- package/dist/react/components/MirrorPage.d.ts +21 -0
- package/dist/react/components/MultiLegTable.d.ts +40 -0
- package/dist/react/components/PageBackButton.d.ts +13 -0
- package/dist/react/components/PayoutCircles.d.ts +15 -0
- package/dist/react/components/PerfectPickPage.d.ts +22 -0
- package/dist/react/components/PickYourDividendPage.d.ts +21 -0
- package/dist/react/components/PickerBrand.d.ts +19 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +137 -0
- package/dist/react/components/PressToPlayTile.d.ts +14 -0
- package/dist/react/components/QuickPickButton.d.ts +11 -0
- package/dist/react/components/QuickPickMenu.d.ts +17 -0
- package/dist/react/components/RuleSetupPage.d.ts +27 -0
- package/dist/react/components/SelectionReview.d.ts +2 -0
- package/dist/react/components/SelectionsPage.d.ts +25 -0
- package/dist/react/components/SportPickerPage.d.ts +27 -0
- package/dist/react/components/SportSelector.d.ts +2 -0
- package/dist/react/components/SuccessPage.d.ts +27 -0
- package/dist/react/components/_primitives/index.d.ts +91 -0
- package/dist/react/hooks/index.d.ts +1 -0
- package/dist/react/index.d.ts +74 -0
- package/dist/react/index.js +1 -0
- package/dist/react/index.mjs +325 -0
- package/dist/react/types/index.d.ts +8 -0
- package/dist/react/utils/api-client.d.ts +2 -0
- package/dist/react/utils/design.d.ts +55 -0
- package/dist/react/utils/dummy-data.d.ts +1 -0
- package/dist/react/utils/index.d.ts +2 -0
- package/dist/react/utils/themes.d.ts +13 -0
- package/dist/react-native/components/BrandLockup.d.ts +17 -0
- package/dist/react-native/components/BrandLogo.d.ts +16 -0
- package/dist/react-native/components/CategoryPickerPage.d.ts +17 -0
- package/dist/react-native/components/ConfirmPage.d.ts +19 -0
- package/dist/react-native/components/EntriesPage.d.ts +14 -0
- package/dist/react-native/components/EntrySubmission.d.ts +2 -0
- package/dist/react-native/components/EventFilterBanner.d.ts +4 -0
- package/dist/react-native/components/EventPickerPage.d.ts +4 -0
- package/dist/react-native/components/GameEntries.d.ts +2 -0
- package/dist/react-native/components/GameLogo.d.ts +9 -0
- package/dist/react-native/components/GameModeCard.d.ts +33 -0
- package/dist/react-native/components/GamePage.d.ts +33 -0
- package/dist/react-native/components/GameSelector.d.ts +2 -0
- package/dist/react-native/components/GameSetBetPage.d.ts +19 -0
- package/dist/react-native/components/GameSetupPage.d.ts +26 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +17 -0
- package/dist/react-native/components/IconSvg.d.ts +9 -0
- package/dist/react-native/components/LadderPage.d.ts +19 -0
- package/dist/react-native/components/LoadingIndicators.d.ts +62 -0
- package/dist/react-native/components/MirrorPage.d.ts +19 -0
- package/dist/react-native/components/MultiLegTable.d.ts +37 -0
- package/dist/react-native/components/NativeMenuOverlay.d.ts +32 -0
- package/dist/react-native/components/PageBackButton.d.ts +25 -0
- package/dist/react-native/components/PayoutCircles.d.ts +14 -0
- package/dist/react-native/components/PerfectPickPage.d.ts +20 -0
- package/dist/react-native/components/PickYourDividendPage.d.ts +19 -0
- package/dist/react-native/components/PickerBrand.d.ts +18 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +129 -0
- package/dist/react-native/components/PressToPlayTile.d.ts +13 -0
- package/dist/react-native/components/QuickPickButton.d.ts +11 -0
- package/dist/react-native/components/QuickPickMenu.d.ts +17 -0
- package/dist/react-native/components/RuleSetupPage.d.ts +23 -0
- package/dist/react-native/components/SelectionReview.d.ts +2 -0
- package/dist/react-native/components/SelectionsPage.d.ts +22 -0
- package/dist/react-native/components/SportPickerPage.d.ts +20 -0
- package/dist/react-native/components/SportSelector.d.ts +2 -0
- package/dist/react-native/components/SuccessPage.d.ts +24 -0
- package/dist/react-native/components/_primitives/index.d.ts +93 -0
- package/dist/react-native/hooks/index.d.ts +1 -0
- package/dist/react-native/index.d.ts +72 -0
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/index.mjs +334 -0
- package/dist/react-native/types/index.d.ts +1 -0
- package/dist/react-native/utils/api-client.d.ts +2 -0
- package/dist/react-native/utils/dummy-data.d.ts +1 -0
- package/dist/react-native/utils/index.d.ts +2 -0
- package/dist/react-native/utils/themes.d.ts +5 -0
- package/dist/shared/api-client.d.ts +73 -0
- package/dist/shared/composite.d.ts +44 -0
- package/dist/shared/date-filters.d.ts +25 -0
- package/dist/shared/dummy-data.d.ts +9 -0
- package/dist/shared/game-flow.d.ts +39 -0
- package/dist/shared/game-icons.d.ts +10 -0
- package/dist/shared/game-set-bet.d.ts +48 -0
- package/dist/shared/game-tiers.d.ts +23 -0
- package/dist/shared/hooks.d.ts +100 -0
- package/dist/shared/how-to-play-html.d.ts +12 -0
- package/dist/shared/how-to-play-logo.d.ts +2 -0
- package/dist/shared/how-to-play-props-table.d.ts +21 -0
- package/dist/shared/how-to-play-styles.d.ts +2 -0
- package/dist/shared/ladder.d.ts +53 -0
- package/dist/shared/markdown.d.ts +24 -0
- package/dist/shared/mirror.d.ts +66 -0
- package/dist/shared/pick-your-dividend.d.ts +59 -0
- package/dist/shared/picker-brand.d.ts +11 -0
- package/dist/shared/rule-setup.d.ts +75 -0
- package/dist/shared/same-game-multi.d.ts +22 -0
- package/dist/shared/themes.d.ts +164 -0
- package/dist/shared/tokens.d.ts +64 -0
- package/dist/shared/types.d.ts +397 -0
- package/dist/shared/utils.d.ts +118 -0
- package/package.json +101 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Game } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* YESNO Mirror Standard — the Straight Mirror.
|
|
4
|
+
*
|
|
5
|
+
* "Get them all right, you win. All wrong, you win." The only multi that pays
|
|
6
|
+
* for being all right OR all wrong (per the YESNO Mirror Standard brief and
|
|
7
|
+
* pricing model). The player picks a leg count (4–12) and a stake on ONE
|
|
8
|
+
* screen; every leg is an independent 50/50 call. A card has 2^N equally
|
|
9
|
+
* likely outcomes and the ticket pays on exactly two of them — the clean
|
|
10
|
+
* sweep (N correct) and the perfect miss (0 correct) — both paying the SAME
|
|
11
|
+
* dividend. The split middle never pays.
|
|
12
|
+
*
|
|
13
|
+
* Pricing (suite-standard 21.875% margin): the prize budget is the stake less
|
|
14
|
+
* the margin, split equally across the two winning outcomes, so each side pays
|
|
15
|
+
* prize = stake × (1 − margin) × 2^(N−1)
|
|
16
|
+
* quoted EXACT — no rounding. Each extra leg exactly doubles the prize and the
|
|
17
|
+
* margin holds flat at every leg count (RTP 78.125%).
|
|
18
|
+
*/
|
|
19
|
+
/** Suite-standard operator margin for Mirror Standard. */
|
|
20
|
+
export declare const MIRROR_STANDARD_MARGIN = 0.21875;
|
|
21
|
+
/** A live prize quote for a stake/legs combination. */
|
|
22
|
+
export interface MirrorPrize {
|
|
23
|
+
legs: number;
|
|
24
|
+
stake: number;
|
|
25
|
+
/** What each winning side pays (all right, or all wrong) — the two are equal. */
|
|
26
|
+
prize: number;
|
|
27
|
+
/** Prize multiple on the stake, e.g. 25× at 6 legs / 21.875% margin. */
|
|
28
|
+
multiple: number;
|
|
29
|
+
/** Total outcomes on the card — 2^legs. */
|
|
30
|
+
totalOutcomes: number;
|
|
31
|
+
/** Winning outcomes — always the two clean sweeps. */
|
|
32
|
+
winningOutcomes: number;
|
|
33
|
+
/** Win chance denominator — 1 in `oddsOneIn` (= 2^(legs−1) at even odds). */
|
|
34
|
+
oddsOneIn: number;
|
|
35
|
+
}
|
|
36
|
+
export interface MirrorConfig {
|
|
37
|
+
/** Selectable leg counts, smallest first (official range 4–12). */
|
|
38
|
+
legOptions: number[];
|
|
39
|
+
/** Leg count preselected on entry. */
|
|
40
|
+
defaultLegs: number;
|
|
41
|
+
/** Stake preselected on entry (the $20 reference stake when allowed). */
|
|
42
|
+
defaultStake: number;
|
|
43
|
+
minStake: number;
|
|
44
|
+
maxStake: number | null;
|
|
45
|
+
/** Quick-amount stake buttons (brief bands $1–$50), filtered to limits. */
|
|
46
|
+
quickStakes: number[];
|
|
47
|
+
/** One-line hook shown under the lockup. */
|
|
48
|
+
tagline: string;
|
|
49
|
+
operatorMargin: number;
|
|
50
|
+
perLegProbability: number;
|
|
51
|
+
}
|
|
52
|
+
/** Whether a game is a Mirror (routes to the one-screen Straight Mirror builder). */
|
|
53
|
+
export declare function isMirrorGame(game: Game | null | undefined): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Price a Mirror ticket: what each winning side pays, exact to the cent.
|
|
56
|
+
*
|
|
57
|
+
* The prize is fixed at the fair 50/50 price — stake × (1 − margin) × 2^(N−1) —
|
|
58
|
+
* so it is independent of `perLegProbability`; a skewed leg probability only
|
|
59
|
+
* moves the effective margin and the win frequency, never the quoted dividend.
|
|
60
|
+
*/
|
|
61
|
+
export declare function mirrorPrize(stake: number, legs: number, opts?: {
|
|
62
|
+
operatorMargin?: number;
|
|
63
|
+
perLegProbability?: number;
|
|
64
|
+
}): MirrorPrize;
|
|
65
|
+
/** Resolve the ticket-builder config for a Mirror game. */
|
|
66
|
+
export declare function getMirrorConfig(game: Game | null | undefined): MirrorConfig | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Game } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Pick Your Dividend — the multi turned around.
|
|
4
|
+
*
|
|
5
|
+
* A series of fixed-dividend, all-or-nothing binary multis (per the YESNO
|
|
6
|
+
* Pick Your Dividend Series Maths pack): the player picks a SET dividend
|
|
7
|
+
* first, then the stake ladder is a difficulty dial — a small stake buys the
|
|
8
|
+
* long climb (12 legs), a bigger stake buys the short one (6 legs). The
|
|
9
|
+
* dividend never moves.
|
|
10
|
+
*
|
|
11
|
+
* Pricing (parlay fair-multiple engine, suite standard 21.875% margin):
|
|
12
|
+
* exact stake = dividend × 1.28 ÷ 2^legs
|
|
13
|
+
* Whole-dollar exact stakes ship as-is (21.875% margin). Fractional stakes
|
|
14
|
+
* are rounded DOWN by a factor of 0.96 to a clean shelf price, which sets
|
|
15
|
+
* that rung at an 18.62% margin. The dividend is never rounded — rounding
|
|
16
|
+
* lives in the stake by construction.
|
|
17
|
+
*/
|
|
18
|
+
/** Retail dividend tiers — "Seven set dividends, from $2,500 to $20,000". */
|
|
19
|
+
export declare const PYD_RETAIL_DIVIDENDS: number[];
|
|
20
|
+
/** Rungs offered per dividend, longest climb first (12 legs down to 6). */
|
|
21
|
+
export declare const PYD_LEG_RUNGS: number[];
|
|
22
|
+
/** Suite-standard margin basis for Pick Your Dividend. */
|
|
23
|
+
export declare const PYD_STANDARD_MARGIN = 0.21875;
|
|
24
|
+
/** One rung of a dividend's stake ladder. */
|
|
25
|
+
export interface PydRung {
|
|
26
|
+
legs: number;
|
|
27
|
+
/** Exact stake at the standard margin (may be fractional). */
|
|
28
|
+
exactStake: number;
|
|
29
|
+
/** Retail shelf stake actually charged. */
|
|
30
|
+
stake: number;
|
|
31
|
+
/** Operator margin on this rung (0.21875 standard, ~0.1862 discounted). */
|
|
32
|
+
margin: number;
|
|
33
|
+
/** Payout multiple: dividend ÷ stake. */
|
|
34
|
+
multiple: number;
|
|
35
|
+
/** Win chance denominator — 1 in `oddsOneIn`. */
|
|
36
|
+
oddsOneIn: number;
|
|
37
|
+
/** True when the shelf price was rounded down (the better-value rungs). */
|
|
38
|
+
discounted: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface PydDividendGame {
|
|
41
|
+
dividend: number;
|
|
42
|
+
rungs: PydRung[];
|
|
43
|
+
}
|
|
44
|
+
export interface PickYourDividendConfig {
|
|
45
|
+
dividends: PydDividendGame[];
|
|
46
|
+
defaultDividend: number;
|
|
47
|
+
defaultLegs: number;
|
|
48
|
+
tagline: string;
|
|
49
|
+
}
|
|
50
|
+
/** Whether a game routes to the Pick Your Dividend family page. */
|
|
51
|
+
export declare function isPickYourDividendGame(game: Game | null | undefined): boolean;
|
|
52
|
+
/** Price one rung of a dividend's stake ladder (matches the Series Maths grid). */
|
|
53
|
+
export declare function pydRung(dividend: number, legs: number, standardMargin?: number): PydRung;
|
|
54
|
+
/** Full stake ladder for one set dividend. */
|
|
55
|
+
export declare function pydLadder(dividend: number, legs?: number[]): PydDividendGame;
|
|
56
|
+
/** Resolve the family-page config for a Pick Your Dividend game. */
|
|
57
|
+
export declare function getPickYourDividendConfig(game: Game | null | undefined, overrides?: {
|
|
58
|
+
dividends?: number[];
|
|
59
|
+
}): PickYourDividendConfig | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PICKER_BRAND: {
|
|
2
|
+
readonly stone: "#DDD9D2";
|
|
3
|
+
readonly teal: "#0F4C5C";
|
|
4
|
+
readonly citron: "#DFFF1A";
|
|
5
|
+
};
|
|
6
|
+
export declare const SPORT_SHORT_CODES: Record<string, string>;
|
|
7
|
+
export declare function getCategoryTagline(category: string): string;
|
|
8
|
+
export declare function getSportShortCode(sport: string, sportBaseKey?: string | null, override?: string): string;
|
|
9
|
+
export declare function getSportPickerTagline(count: number, selectedCategory?: string | null): string;
|
|
10
|
+
export declare function getSportSummaryTagline(gamesToday: number, activeProps: number): string;
|
|
11
|
+
export declare function gameLogoTileFontSize(code: string): number;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Game } from './types';
|
|
2
|
+
export type RuleSetupMode = 'description' | 'selection';
|
|
3
|
+
/** Discriminates which rule page identity (emblem / accent / voice) to show. */
|
|
4
|
+
export type RuleKind = 'exact' | 'safety_net' | 'pick';
|
|
5
|
+
/** One payout tier for an option — e.g. "8/8 → $2,230 on a $20 bet". */
|
|
6
|
+
export interface DividendTier {
|
|
7
|
+
/** How many wrong picks this tier tolerates (0 = perfect). */
|
|
8
|
+
misses: number;
|
|
9
|
+
/** Outcome label, e.g. "8/8", "7/8". */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Payout multiplier on the stake for this outcome. */
|
|
12
|
+
multiplier: number;
|
|
13
|
+
/** Return for a $20 stake — matches the "$20 returns" convention used across the app. */
|
|
14
|
+
payout20: number;
|
|
15
|
+
}
|
|
16
|
+
/** Reference stake used for the built-in dividend display, matching the rest of the app. */
|
|
17
|
+
export declare const DIVIDEND_REFERENCE_STAKE = 20;
|
|
18
|
+
export interface RuleSetupOption {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
tagline?: string;
|
|
22
|
+
/** Multi-line "what wins" copy shown beneath the option button. */
|
|
23
|
+
detail?: string[];
|
|
24
|
+
/** Payout tiers shown as a dividends breakdown on the option card. */
|
|
25
|
+
dividends?: DividendTier[];
|
|
26
|
+
/**
|
|
27
|
+
* When true, dividends render open on the card (ladder-style).
|
|
28
|
+
* Otherwise they use the Games-page "Show dividends" popover.
|
|
29
|
+
*/
|
|
30
|
+
dividendsInline?: boolean;
|
|
31
|
+
/** Number of legs each dividend tier covers (renders the pip ladder on ladder cards). */
|
|
32
|
+
tierLegs?: number[];
|
|
33
|
+
/** When set, applies expectedCorrect on continue (exact / pick rules). */
|
|
34
|
+
expectedCorrect?: number;
|
|
35
|
+
/** When set, applies proposition count on continue. */
|
|
36
|
+
propositionCount?: number;
|
|
37
|
+
/** Short positioning hint shown as a chip, e.g. "Top payout". */
|
|
38
|
+
stat?: string;
|
|
39
|
+
/** Highlights the headline / boldest option (filled treatment). */
|
|
40
|
+
emphasis?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface RuleSetupConfig {
|
|
43
|
+
mode: RuleSetupMode;
|
|
44
|
+
/** Which rule identity drives the hero emblem, accent and voice. */
|
|
45
|
+
kind: RuleKind;
|
|
46
|
+
/** Small uppercase eyebrow used in the nav title row. */
|
|
47
|
+
title: string;
|
|
48
|
+
subtitle?: string;
|
|
49
|
+
/** Big hero headline shown on the rule page (e.g. "2 Ways to PLAY more ways to PAY"). */
|
|
50
|
+
headline?: string;
|
|
51
|
+
/** Legacy alias for {@link headline}. */
|
|
52
|
+
heroTitle?: string;
|
|
53
|
+
/** One-line hook shown under the headline. */
|
|
54
|
+
heroTagline?: string;
|
|
55
|
+
/** Number of picks / legs — used to compute expectedCorrect (never displayed). */
|
|
56
|
+
legCount?: number;
|
|
57
|
+
/** Short paragraphs shown in description mode. */
|
|
58
|
+
paragraphs?: string[];
|
|
59
|
+
/** Bullet highlights shown in description mode. */
|
|
60
|
+
highlights?: string[];
|
|
61
|
+
/** Secondary choices shown in selection mode. */
|
|
62
|
+
options?: RuleSetupOption[];
|
|
63
|
+
continueLabel?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Round a dividend for display/pricing to the nearest `roundTo` step.
|
|
67
|
+
*
|
|
68
|
+
* Amounts smaller than the step keep whole-dollar precision (rounding a $28
|
|
69
|
+
* rung to the nearest $1,000 would crush it to $0). `roundTo <= 0` disables
|
|
70
|
+
* step rounding entirely — figures stay exact to the dollar.
|
|
71
|
+
*/
|
|
72
|
+
export declare function roundDividendAmount(amount: number, roundTo: number): number;
|
|
73
|
+
/** Built-in rule setup pages keyed by rule slug. Hosts can override via RuleSetupPage props. */
|
|
74
|
+
export declare function getRuleSetupConfig(game: Game | null | undefined, legCount?: number): RuleSetupConfig | null;
|
|
75
|
+
export declare function gameNeedsRuleSetup(game: Game | null | undefined): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Game, Proposition } from './types';
|
|
2
|
+
/** One selectable sporting fixture and the propositions available within it. */
|
|
3
|
+
export interface SameGameMultiEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
homeTeam?: string;
|
|
6
|
+
awayTeam?: string;
|
|
7
|
+
commenceTime?: string;
|
|
8
|
+
sport?: string;
|
|
9
|
+
league?: string;
|
|
10
|
+
propositionCount: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function formatSameGameMultiEventLabel(event: SameGameMultiEvent): string;
|
|
13
|
+
/** Whether a game requires every selected proposition to belong to one fixture. */
|
|
14
|
+
export declare function isSameGameMultiGame(game: Game | null | undefined): boolean;
|
|
15
|
+
/** Resolve the API's camelCase/snake_case event identifier to one stable key. */
|
|
16
|
+
export declare function getPropositionEventId(proposition: Pick<Proposition, 'eventId' | 'event_id'>): string | null;
|
|
17
|
+
/** Build a stable fixture list, preserving the proposition feed's event order. */
|
|
18
|
+
export declare function groupSameGameMultiEvents(propositions: readonly Proposition[]): SameGameMultiEvent[];
|
|
19
|
+
export declare function isSelectableSameGameMultiProposition(proposition: Proposition): boolean;
|
|
20
|
+
export declare function filterPropositionsToEvent(propositions: readonly Proposition[], eventId: string | null | undefined): Proposition[];
|
|
21
|
+
/** Submission-level guard against stale or programmatically mixed fixture picks. */
|
|
22
|
+
export declare function propositionsBelongToEvent(propositions: readonly Proposition[], eventId: string | null | undefined): boolean;
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
export declare function themeHeading(t: BladeTheme): string;
|
|
9
|
+
export declare function themeLabel(t: BladeTheme): string;
|
|
10
|
+
export declare function themeValue(t: BladeTheme): string;
|
|
11
|
+
/**
|
|
12
|
+
* Product Yes/No binary colours. Fixed bright green/red used by the shared
|
|
13
|
+
* Yes/No answer control across every theme — the one place green/red is
|
|
14
|
+
* allowed. Point the Yes/No control at these, never at brand or status tokens.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PRODUCT_YES = "#00C853";
|
|
17
|
+
export declare const PRODUCT_NO = "#E53935";
|
|
18
|
+
export declare function themeProductYes(t: BladeTheme): string;
|
|
19
|
+
export declare function themeProductNo(t: BladeTheme): string;
|
|
20
|
+
export declare function themeAccent(t: BladeTheme): string;
|
|
21
|
+
export declare function themeBrandChip(t: BladeTheme): string;
|
|
22
|
+
export declare function themeBrandText(t: BladeTheme): string;
|
|
23
|
+
export declare function themeBrandIcon(t: BladeTheme): string;
|
|
24
|
+
export declare function themeTextAlt(t: BladeTheme): string;
|
|
25
|
+
export declare function themeTextAltMuted(t: BladeTheme): string;
|
|
26
|
+
export declare function themeSelectionCard(t: BladeTheme): string;
|
|
27
|
+
export declare function themeMatchupHeader(t: BladeTheme): string;
|
|
28
|
+
export declare function themeSelectionProp(t: BladeTheme): string;
|
|
29
|
+
/** Theme colours passed to picker loading skeletons and card surfaces. */
|
|
30
|
+
export declare function themePickerSurfaceColors(t: BladeTheme): {
|
|
31
|
+
textMuted: string;
|
|
32
|
+
border: string;
|
|
33
|
+
background: string;
|
|
34
|
+
backgroundAlt: string;
|
|
35
|
+
primary: string;
|
|
36
|
+
selectionCard: string;
|
|
37
|
+
};
|
|
38
|
+
export type ColorScheme = 'light' | 'dark';
|
|
39
|
+
export interface BladeTheme {
|
|
40
|
+
name: string;
|
|
41
|
+
colorScheme?: 'light' | 'dark';
|
|
42
|
+
colors: {
|
|
43
|
+
primary: string;
|
|
44
|
+
primaryHover: string;
|
|
45
|
+
primaryText: string;
|
|
46
|
+
payoutWinning: string;
|
|
47
|
+
payoutNone: string;
|
|
48
|
+
success: string;
|
|
49
|
+
successBg: string;
|
|
50
|
+
successText: string;
|
|
51
|
+
error: string;
|
|
52
|
+
errorBg: string;
|
|
53
|
+
errorText: string;
|
|
54
|
+
/**
|
|
55
|
+
* Product Yes/No binary. Bright green/red reserved *only* for the Yes/No
|
|
56
|
+
* answer control — never for brand chrome or primary CTAs. Optional: falls
|
|
57
|
+
* back to the shared product green/red via `themeProductYes`/`themeProductNo`.
|
|
58
|
+
*/
|
|
59
|
+
productYes?: string;
|
|
60
|
+
productNo?: string;
|
|
61
|
+
warning: string;
|
|
62
|
+
warningBg: string;
|
|
63
|
+
warningText: string;
|
|
64
|
+
info: string;
|
|
65
|
+
infoBg: string;
|
|
66
|
+
infoText: string;
|
|
67
|
+
border: string;
|
|
68
|
+
borderFocus: string;
|
|
69
|
+
background: string;
|
|
70
|
+
backgroundAlt: string;
|
|
71
|
+
/** Card surface used across game, sport, category, selection, entry, and review cards */
|
|
72
|
+
selectionCard?: string;
|
|
73
|
+
/** Team A vs team B header band on selection cards */
|
|
74
|
+
matchupHeader?: string;
|
|
75
|
+
/** Proposition row / text area inside selection cards */
|
|
76
|
+
selectionProp?: string;
|
|
77
|
+
surface?: string;
|
|
78
|
+
surfaceElevated?: string;
|
|
79
|
+
borderSubtle?: string;
|
|
80
|
+
text: string;
|
|
81
|
+
textAlt?: string;
|
|
82
|
+
textAltMuted?: string;
|
|
83
|
+
textMuted: string;
|
|
84
|
+
heading?: string;
|
|
85
|
+
label?: string;
|
|
86
|
+
value?: string;
|
|
87
|
+
buttonPrimary: string;
|
|
88
|
+
buttonPrimaryHover: string;
|
|
89
|
+
buttonPrimaryText: string;
|
|
90
|
+
buttonSecondary: string;
|
|
91
|
+
buttonSecondaryHover: string;
|
|
92
|
+
buttonSecondaryText: string;
|
|
93
|
+
};
|
|
94
|
+
brand?: {
|
|
95
|
+
chip?: string;
|
|
96
|
+
text?: string;
|
|
97
|
+
icon?: string;
|
|
98
|
+
accent?: string;
|
|
99
|
+
};
|
|
100
|
+
fonts?: {
|
|
101
|
+
body: string;
|
|
102
|
+
heading?: string;
|
|
103
|
+
mono?: string;
|
|
104
|
+
};
|
|
105
|
+
spacing?: {
|
|
106
|
+
sm: string;
|
|
107
|
+
md: string;
|
|
108
|
+
lg: string;
|
|
109
|
+
xl: string;
|
|
110
|
+
};
|
|
111
|
+
borderRadius?: {
|
|
112
|
+
sm: string;
|
|
113
|
+
md: string;
|
|
114
|
+
lg: string;
|
|
115
|
+
full: string;
|
|
116
|
+
};
|
|
117
|
+
motion?: {
|
|
118
|
+
durationFast?: number;
|
|
119
|
+
durationStd?: number;
|
|
120
|
+
easing?: string;
|
|
121
|
+
};
|
|
122
|
+
density?: 'compact' | 'regular';
|
|
123
|
+
}
|
|
124
|
+
export interface BladeThemeSet {
|
|
125
|
+
light: BladeTheme;
|
|
126
|
+
dark: BladeTheme;
|
|
127
|
+
}
|
|
128
|
+
export declare function resolveTheme(theme: BladeTheme | BladeThemeSet | undefined, colorScheme?: 'light' | 'dark'): BladeTheme;
|
|
129
|
+
export declare function isThemeSet(t: BladeTheme | BladeThemeSet): t is BladeThemeSet;
|
|
130
|
+
export declare const defaultTheme: BladeTheme;
|
|
131
|
+
export declare const greenTheme: BladeTheme;
|
|
132
|
+
export declare const darkTheme: BladeTheme;
|
|
133
|
+
export declare const goldTheme: BladeTheme;
|
|
134
|
+
export declare const greenLightTheme: BladeTheme;
|
|
135
|
+
export declare const goldLightTheme: BladeTheme;
|
|
136
|
+
export declare const yesnoLightTheme: BladeTheme;
|
|
137
|
+
export declare const yesnoTheme: BladeTheme;
|
|
138
|
+
export declare const defaultThemeSet: BladeThemeSet;
|
|
139
|
+
export declare const greenThemeSet: BladeThemeSet;
|
|
140
|
+
export declare const goldThemeSet: BladeThemeSet;
|
|
141
|
+
export declare const yesnoThemeSet: BladeThemeSet;
|
|
142
|
+
export declare function getTheme(name: string): BladeTheme;
|
|
143
|
+
export declare function getThemeSet(name: string): BladeThemeSet;
|
|
144
|
+
export declare const themes: {
|
|
145
|
+
default: BladeTheme;
|
|
146
|
+
green: BladeTheme;
|
|
147
|
+
'green-light': BladeTheme;
|
|
148
|
+
dark: BladeTheme;
|
|
149
|
+
gold: BladeTheme;
|
|
150
|
+
'gold-light': BladeTheme;
|
|
151
|
+
yesno: BladeTheme;
|
|
152
|
+
'yesno-light': BladeTheme;
|
|
153
|
+
};
|
|
154
|
+
export declare const themeSets: {
|
|
155
|
+
default: BladeThemeSet;
|
|
156
|
+
green: BladeThemeSet;
|
|
157
|
+
gold: BladeThemeSet;
|
|
158
|
+
yesno: BladeThemeSet;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Hook that resolves a `BladeTheme | BladeThemeSet` to a concrete
|
|
162
|
+
* `BladeTheme`, respecting the `colorScheme` preference.
|
|
163
|
+
*/
|
|
164
|
+
export declare function useResolvedTheme(theme: BladeTheme | BladeThemeSet | undefined, colorScheme?: ColorScheme): BladeTheme;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BladeTheme } from './themes';
|
|
2
|
+
export declare function withAlpha(color: string, alpha: number): string;
|
|
3
|
+
export interface ResolvedTokens {
|
|
4
|
+
space: {
|
|
5
|
+
xs: number;
|
|
6
|
+
sm: number;
|
|
7
|
+
md: number;
|
|
8
|
+
lg: number;
|
|
9
|
+
xl: number;
|
|
10
|
+
xxl: number;
|
|
11
|
+
xxxl: number;
|
|
12
|
+
};
|
|
13
|
+
radius: {
|
|
14
|
+
xs: number;
|
|
15
|
+
sm: number;
|
|
16
|
+
md: number;
|
|
17
|
+
lg: number;
|
|
18
|
+
xl: number;
|
|
19
|
+
pill: number;
|
|
20
|
+
};
|
|
21
|
+
fontSize: {
|
|
22
|
+
xs: number;
|
|
23
|
+
sm: number;
|
|
24
|
+
md: number;
|
|
25
|
+
lg: number;
|
|
26
|
+
xl: number;
|
|
27
|
+
xxl: number;
|
|
28
|
+
display: number;
|
|
29
|
+
};
|
|
30
|
+
touchTarget: {
|
|
31
|
+
min: number;
|
|
32
|
+
};
|
|
33
|
+
motion: {
|
|
34
|
+
durationFast: number;
|
|
35
|
+
durationStd: number;
|
|
36
|
+
easing: string;
|
|
37
|
+
};
|
|
38
|
+
surface: {
|
|
39
|
+
background: string;
|
|
40
|
+
surface: string;
|
|
41
|
+
surfaceElevated: string;
|
|
42
|
+
borderSubtle: string;
|
|
43
|
+
};
|
|
44
|
+
isDark: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const EASING_STANDARD = "cubic-bezier(0.2, 0, 0, 1)";
|
|
47
|
+
export declare const DURATION_FAST = 160;
|
|
48
|
+
export declare const DURATION_STD = 220;
|
|
49
|
+
export declare function resolveTokens(theme: BladeTheme): ResolvedTokens;
|
|
50
|
+
/**
|
|
51
|
+
* Soft, themed elevation for a card/menu that lifts off the page. Single source
|
|
52
|
+
* of truth mirrored by the Surface primitive and every raised surface — use
|
|
53
|
+
* these instead of hand-rolled `box-shadow` strings so elevation stays uniform.
|
|
54
|
+
*/
|
|
55
|
+
export declare function raisedShadow(theme: BladeTheme): string;
|
|
56
|
+
/** Higher elevation for floating menus / popovers (dropdowns, dividend menus). */
|
|
57
|
+
export declare function elevatedShadow(theme: BladeTheme): string;
|
|
58
|
+
export declare function focusRing(theme: BladeTheme, opts?: {
|
|
59
|
+
offset?: number;
|
|
60
|
+
}): string;
|
|
61
|
+
export declare const TABULAR_NUMS: {
|
|
62
|
+
fontVariantNumeric: "tabular-nums lining-nums";
|
|
63
|
+
fontFeatureSettings: "\"tnum\" 1, \"lnum\" 1";
|
|
64
|
+
};
|