@simple-parlay/components 1.29.0 → 1.30.1
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/README.md +6 -164
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +346 -282
- package/dist/react/components/ConfirmPage.d.ts +9 -2
- package/dist/react/components/EntrySubmission.d.ts +1 -1
- package/dist/react/components/GameModeCard.d.ts +26 -6
- package/dist/react/components/GamePage.d.ts +10 -6
- package/dist/react/components/GameSelector.d.ts +19 -1
- package/dist/react/components/GameSetupPage.d.ts +0 -14
- package/dist/react/components/HowToPlayButton.d.ts +15 -3
- package/dist/react/components/HowToPlayPanel.d.ts +13 -0
- package/dist/react/components/LoadingIndicators.d.ts +21 -6
- package/dist/react/components/PageBackButton.d.ts +11 -1
- package/dist/react/components/PickerBrand.d.ts +10 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +5 -4
- package/dist/react/components/PropositionFilters.d.ts +24 -0
- package/dist/react/components/SafetyNetPage.d.ts +16 -0
- package/dist/react/components/SelectionReview.d.ts +1 -1
- package/dist/react/components/SelectionsPage.d.ts +7 -1
- package/dist/react/components/SportPickerPage.d.ts +3 -1
- package/dist/react/components/SportSelector.d.ts +15 -2
- package/dist/react/components/SwipeDeck.d.ts +33 -0
- package/dist/react/components/_primitives/index.d.ts +2 -0
- package/dist/react/index.d.ts +16 -4
- package/dist/react/index.js +1 -1
- package/dist/react/index.mjs +346 -282
- package/dist/react/types/index.d.ts +1 -1
- package/dist/react/utils/index.d.ts +2 -2
- package/dist/react/utils/themes.d.ts +1 -1
- package/dist/react-native/components/ConfirmPage.d.ts +9 -2
- package/dist/react-native/components/EntrySubmission.d.ts +1 -1
- package/dist/react-native/components/GameModeCard.d.ts +29 -7
- package/dist/react-native/components/GamePage.d.ts +15 -6
- package/dist/react-native/components/GameSelector.d.ts +19 -0
- package/dist/react-native/components/GameSetupPage.d.ts +2 -4
- package/dist/react-native/components/HowToPlayButton.d.ts +9 -1
- package/dist/react-native/components/HowToPlayPanel.d.ts +12 -0
- package/dist/react-native/components/IconSvg.d.ts +2 -2
- package/dist/react-native/components/LoadingIndicators.d.ts +23 -8
- package/dist/react-native/components/PageBackButton.d.ts +3 -1
- package/dist/react-native/components/PickerBrand.d.ts +8 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +5 -4
- package/dist/react-native/components/PropositionFilters.d.ts +22 -0
- package/dist/react-native/components/SafetyNetPage.d.ts +14 -0
- package/dist/react-native/components/SelectionReview.d.ts +1 -1
- package/dist/react-native/components/SelectionsPage.d.ts +7 -1
- package/dist/react-native/components/SportPickerPage.d.ts +3 -1
- package/dist/react-native/components/SportSelector.d.ts +15 -2
- package/dist/react-native/components/SwipeDeck.d.ts +32 -0
- package/dist/react-native/components/_primitives/index.d.ts +21 -0
- package/dist/react-native/index.d.ts +16 -4
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.mjs +384 -334
- package/dist/react-native/types/index.d.ts +1 -1
- package/dist/react-native/utils/index.d.ts +2 -2
- package/dist/react-native/utils/themes.d.ts +1 -1
- package/dist/shared/api-client.d.ts +1 -0
- package/dist/shared/game-dividends.d.ts +34 -0
- package/dist/shared/game-flow.d.ts +3 -2
- package/dist/shared/hooks.d.ts +2 -1
- package/dist/shared/how-to-play-panel.d.ts +36 -0
- package/dist/shared/picker-brand.d.ts +11 -0
- package/dist/shared/rule-setup.d.ts +1 -8
- package/dist/shared/safety-net.d.ts +47 -0
- package/dist/shared/swipe-deck.d.ts +22 -0
- package/dist/shared/themes.d.ts +1 -0
- package/dist/shared/types.d.ts +31 -10
- package/dist/shared/utils.d.ts +21 -9
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,9 +5,7 @@ experiences in React.
|
|
|
5
5
|
|
|
6
6
|
| | |
|
|
7
7
|
|---|---|
|
|
8
|
-
| **Version** | 1.28.0 |
|
|
9
8
|
| **Licence** | Proprietary — see [LICENSE](./LICENSE) |
|
|
10
|
-
| **Registry** | Public npm — no auth token required |
|
|
11
9
|
| **Changelog** | [CHANGELOG.md](./CHANGELOG.md) |
|
|
12
10
|
|
|
13
11
|
---
|
|
@@ -24,170 +22,14 @@ prohibited. This software is provided as-is without warranty of any kind.
|
|
|
24
22
|
|
|
25
23
|
---
|
|
26
24
|
|
|
27
|
-
##
|
|
25
|
+
## Access
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
Integration documentation — installation, component reference, theming, and
|
|
28
|
+
API details — is provided to licensed partners as part of the onboarding
|
|
29
|
+
package. It is not published here.
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
| Node.js | ≥ 18 |
|
|
34
|
-
| React | ≥ 18 |
|
|
35
|
-
| React DOM | ≥ 18 |
|
|
36
|
-
|
|
37
|
-
### 1. Install
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm install @simple-parlay/components
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
> **No auth token or `.npmrc` required.** This package is published to the
|
|
44
|
-
> public npm registry so it installs with a single command. Use of the
|
|
45
|
-
> Software is governed by the [LICENSE](./LICENSE) and requires a written
|
|
46
|
-
> agreement with Simple Parlay Pty Ltd.
|
|
47
|
-
|
|
48
|
-
### 2. Import — React sub-path
|
|
49
|
-
|
|
50
|
-
All React components, hooks, utilities, and types are available from the
|
|
51
|
-
`/react` sub-path export:
|
|
52
|
-
|
|
53
|
-
```tsx
|
|
54
|
-
import {
|
|
55
|
-
// Components
|
|
56
|
-
PlaceEntryFlow,
|
|
57
|
-
GameSelector,
|
|
58
|
-
SportSelector,
|
|
59
|
-
EntrySubmission,
|
|
60
|
-
PayoutCircles,
|
|
61
|
-
|
|
62
|
-
// Hooks
|
|
63
|
-
useGames,
|
|
64
|
-
usePropositions,
|
|
65
|
-
useCreateGameEntry,
|
|
66
|
-
usePlaceEntryFlow,
|
|
67
|
-
useEvaluateRule,
|
|
68
|
-
useCalculatePayout,
|
|
69
|
-
|
|
70
|
-
// API client
|
|
71
|
-
BladeApiClient,
|
|
72
|
-
|
|
73
|
-
// Utilities
|
|
74
|
-
formatCurrency,
|
|
75
|
-
|
|
76
|
-
// Theming
|
|
77
|
-
getTheme,
|
|
78
|
-
applyTheme,
|
|
79
|
-
useBladeTheme,
|
|
80
|
-
themes,
|
|
81
|
-
|
|
82
|
-
// Types (import type)
|
|
83
|
-
type Game,
|
|
84
|
-
type Proposition,
|
|
85
|
-
type GameEntry,
|
|
86
|
-
type PlaceEntryFlowProps,
|
|
87
|
-
type BladeTheme,
|
|
88
|
-
type BladeApiClientConfig,
|
|
89
|
-
} from '@simple-parlay/components/react';
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 3. Quick start — full-page flow
|
|
93
|
-
|
|
94
|
-
The fastest way to get up and running is with the `PlaceEntryFlow` component.
|
|
95
|
-
It handles game selection, proposition picking, entry configuration, and
|
|
96
|
-
submission in a single self-contained widget:
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
import { PlaceEntryFlow } from '@simple-parlay/components/react';
|
|
100
|
-
|
|
101
|
-
function App() {
|
|
102
|
-
return (
|
|
103
|
-
<PlaceEntryFlow
|
|
104
|
-
apiUrl="https://your-api-endpoint.example.com"
|
|
105
|
-
apiKey="your-api-key"
|
|
106
|
-
userId={42}
|
|
107
|
-
onEntryPlaced={(entry) => console.log('Entry placed:', entry)}
|
|
108
|
-
onCancel={() => console.log('Cancelled')}
|
|
109
|
-
/>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
#### Props
|
|
115
|
-
|
|
116
|
-
| Prop | Type | Required | Description |
|
|
117
|
-
|--------------------|-------------------------------|----------|------------------------------------------------------|
|
|
118
|
-
| `apiUrl` | `string` | ✅ | Base URL of the API |
|
|
119
|
-
| `apiKey` | `string` | ✅ | API key for authentication |
|
|
120
|
-
| `userId` | `number` | — | Current user ID |
|
|
121
|
-
| `onEntryPlaced` | `(entry: GameEntry) => void` | — | Callback fired after successful submission |
|
|
122
|
-
| `onCancel` | `() => void` | — | Callback fired when user cancels |
|
|
123
|
-
| `initialGameId` | `number` | — | Pre-select a game by ID |
|
|
124
|
-
| `gameCategory` | `'sports' \| 'casino' \| 'racing'` | — | Filter games to a specific category |
|
|
125
|
-
| `jurisdiction` | `string` | — | Filter games by jurisdiction |
|
|
126
|
-
| `theme` | `BladeTheme` | — | Custom theme object |
|
|
127
|
-
| `modal` | `boolean` | — | Render as a fixed overlay (default) or inline card |
|
|
128
|
-
| `className` | `string` | — | Additional CSS class name |
|
|
129
|
-
|
|
130
|
-
### 4. Using individual components
|
|
131
|
-
|
|
132
|
-
For tighter control, compose the lower-level components yourself:
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
import {
|
|
136
|
-
GameSelector,
|
|
137
|
-
SportSelector,
|
|
138
|
-
EntrySubmission,
|
|
139
|
-
PayoutCircles,
|
|
140
|
-
useGames,
|
|
141
|
-
usePropositions,
|
|
142
|
-
BladeApiClient,
|
|
143
|
-
} from '@simple-parlay/components/react';
|
|
144
|
-
|
|
145
|
-
const client = new BladeApiClient({
|
|
146
|
-
baseUrl: 'https://your-api-endpoint.example.com',
|
|
147
|
-
apiKey: 'your-api-key',
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
function CustomFlow() {
|
|
151
|
-
const { games, loading } = useGames(client);
|
|
152
|
-
// … build your own UI with the individual components
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### 5. Theming
|
|
157
|
-
|
|
158
|
-
Apply a built-in theme or supply your own `BladeTheme` object:
|
|
159
|
-
|
|
160
|
-
```tsx
|
|
161
|
-
import {
|
|
162
|
-
PlaceEntryFlow,
|
|
163
|
-
getTheme,
|
|
164
|
-
darkTheme,
|
|
165
|
-
goldTheme,
|
|
166
|
-
} from '@simple-parlay/components/react';
|
|
167
|
-
|
|
168
|
-
// Use a built-in theme
|
|
169
|
-
<PlaceEntryFlow theme={darkTheme} /* … */ />
|
|
170
|
-
|
|
171
|
-
// Or retrieve one by name
|
|
172
|
-
<PlaceEntryFlow theme={getTheme('gold')} /* … */ />
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### 6. API client
|
|
176
|
-
|
|
177
|
-
The `BladeApiClient` can also be used standalone for server-side or headless
|
|
178
|
-
integrations:
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
import { BladeApiClient } from '@simple-parlay/components/react';
|
|
182
|
-
|
|
183
|
-
const client = new BladeApiClient({
|
|
184
|
-
baseUrl: 'https://your-api-endpoint.example.com',
|
|
185
|
-
apiKey: 'your-api-key',
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
const games = await client.getGames();
|
|
189
|
-
const propositions = await client.getPropositions();
|
|
190
|
-
```
|
|
31
|
+
For licensing enquiries and access to the integration guide, contact
|
|
32
|
+
Simple Parlay Pty Ltd.
|
|
191
33
|
|
|
192
34
|
---
|
|
193
35
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.30.1";
|
|
2
2
|
export * from './react';
|