@metrifox/react-sdk 0.0.13 → 0.0.15
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 +99 -8
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +2 -74
- package/dist/index.js +24 -24
- package/dist/styles.css +1 -1
- package/package.json +22 -4
package/README.md
CHANGED
|
@@ -115,12 +115,7 @@ Displays subscription plans and one-time purchases in a configurable pricing tab
|
|
|
115
115
|
import { PricingTable } from "@metrifox/react-sdk"
|
|
116
116
|
|
|
117
117
|
export default function PricingPage() {
|
|
118
|
-
return
|
|
119
|
-
<PricingTable
|
|
120
|
-
checkoutUsername="your-checkout-username"
|
|
121
|
-
productKey="your-product-key"
|
|
122
|
-
/>
|
|
123
|
-
)
|
|
118
|
+
return <PricingTable checkoutUsername="your-checkout-username" productKey="your-product-key" />
|
|
124
119
|
}
|
|
125
120
|
```
|
|
126
121
|
|
|
@@ -151,10 +146,79 @@ import "@metrifox/react-sdk/dist/styles.css"
|
|
|
151
146
|
> This is required for proper styling of all widgets.
|
|
152
147
|
|
|
153
148
|
#### Pricing Table
|
|
154
|
-
|
|
149
|
+
|
|
150
|
+
The SDK accepts an optional `theme` object during initialization. This theme is applied to Widgets and UI elements within them to match your brand styles.
|
|
155
151
|
|
|
156
152
|
Any values not provided will fall back to the default theme.
|
|
157
153
|
|
|
154
|
+
```ts
|
|
155
|
+
theme?: {
|
|
156
|
+
customerPortal?: CustomerPortalTheme
|
|
157
|
+
pricingTable?: PricingTableTheme
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
customerPortalTheme?: {
|
|
163
|
+
tabs?: {
|
|
164
|
+
background?: string
|
|
165
|
+
borderColor?: string
|
|
166
|
+
activeBackground?: string
|
|
167
|
+
activeTextColor?: string
|
|
168
|
+
inactiveTextColor?: string
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
section?: {
|
|
172
|
+
background?: string
|
|
173
|
+
titleTextColor?: string
|
|
174
|
+
contentBackground?: string
|
|
175
|
+
iconBackground?: string
|
|
176
|
+
iconColor?: string
|
|
177
|
+
emptyTextColor?: string
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
card?: {
|
|
181
|
+
titleBackground?: string
|
|
182
|
+
contentBackground?: string
|
|
183
|
+
titleColor?: string
|
|
184
|
+
details?: {
|
|
185
|
+
labelColor?: string
|
|
186
|
+
valueColor?: string
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
subscription?: {
|
|
191
|
+
items?: {
|
|
192
|
+
background?: string
|
|
193
|
+
borderColor?: string
|
|
194
|
+
textColor?: string
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
table?: {
|
|
199
|
+
headerTextColor?: string
|
|
200
|
+
textcolor?: string
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
button?: {
|
|
204
|
+
background?: string
|
|
205
|
+
textColor?: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
filter?: {
|
|
209
|
+
border?: string
|
|
210
|
+
activeBackground?: string
|
|
211
|
+
inactiveBackground?: string
|
|
212
|
+
activeTextColor?: string
|
|
213
|
+
inactiveTextColor?: string
|
|
214
|
+
countBackground?: string
|
|
215
|
+
countTextColor?: string
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
linkColor?: string
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
158
222
|
```ts
|
|
159
223
|
// Pricing table theme configuration
|
|
160
224
|
pricingTableTheme?: {
|
|
@@ -232,7 +296,9 @@ pricingTableTheme?: {
|
|
|
232
296
|
}
|
|
233
297
|
}
|
|
234
298
|
```
|
|
299
|
+
|
|
235
300
|
###### Example usage
|
|
301
|
+
|
|
236
302
|
```tsx
|
|
237
303
|
import { metrifoxInit } from "@metrifox/react-sdk"
|
|
238
304
|
|
|
@@ -254,11 +320,36 @@ const pricingTableTheme = {
|
|
|
254
320
|
},
|
|
255
321
|
}
|
|
256
322
|
|
|
323
|
+
const customerPortalTheme = {
|
|
324
|
+
tabs: {
|
|
325
|
+
background: "#111827",
|
|
326
|
+
borderColor: "#243044",
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
section: {
|
|
330
|
+
background: "#020617",
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
card: {
|
|
334
|
+
titleColor: "#F9FAFB",
|
|
335
|
+
details: {
|
|
336
|
+
labelColor: "#CBD5E1",
|
|
337
|
+
valueColor: "#FFFFFF",
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const theme = {
|
|
343
|
+
customerPortal: customerPortalTheme,
|
|
344
|
+
pricingTableTheme: pricingTableTheme,
|
|
345
|
+
}
|
|
346
|
+
|
|
257
347
|
metrifoxInit({
|
|
258
348
|
clientKey: "your-client-key",
|
|
259
|
-
|
|
349
|
+
theme,
|
|
260
350
|
})
|
|
261
351
|
```
|
|
352
|
+
|
|
262
353
|
---
|
|
263
354
|
|
|
264
355
|
## Local Development
|