@metrifox/react-sdk 0.0.20-beta.3 → 0.0.20-beta.5
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 +185 -226
- package/dist/index.cjs +35 -35
- package/dist/index.d.ts +66 -46
- package/dist/index.js +35 -35
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Pricing Table theme. All properties are optional.
|
|
6
|
+
* The theme follows the same structure as CustomerPortalTheme:
|
|
7
|
+
* - Plan-related keys (planCards, planButton, etc.) are nested under `plans`
|
|
8
|
+
* - Additional top-level keys: `tabs`, `checkoutBar`
|
|
9
|
+
*/
|
|
4
10
|
interface PricingTableTheme {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
general?: {
|
|
12
|
+
fontFamily?: string;
|
|
13
|
+
};
|
|
14
|
+
plans?: PricingTablePlansTheme;
|
|
8
15
|
tabs?: TabsTheme;
|
|
9
|
-
intervalToggle?: IntervalToggleTheme;
|
|
10
|
-
currentPlanCard?: CurrentSubscriptionCard;
|
|
11
|
-
freeTrialTag?: FreeTrialTheme;
|
|
12
16
|
checkoutBar?: CheckoutBarTheme;
|
|
13
17
|
}
|
|
18
|
+
interface PricingTablePlansTheme {
|
|
19
|
+
currentPlanCard?: CurrentSubscriptionCard;
|
|
20
|
+
planCards?: CardTheme;
|
|
21
|
+
planFeatures?: FeatureListTheme;
|
|
22
|
+
planButton?: PlanButtonTheme;
|
|
23
|
+
planToggle?: IntervalToggleTheme;
|
|
24
|
+
planTags?: PlanTagsTheme;
|
|
25
|
+
}
|
|
14
26
|
interface CardTheme {
|
|
15
27
|
background?: string;
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
border?: {
|
|
29
|
+
color?: string;
|
|
30
|
+
width?: string;
|
|
31
|
+
radius?: string;
|
|
32
|
+
};
|
|
18
33
|
header?: CardHeaderTheme;
|
|
19
34
|
description?: CardDescriptionTheme;
|
|
20
35
|
price?: CardPriceTheme;
|
|
@@ -35,7 +50,7 @@ interface CardPriceTheme {
|
|
|
35
50
|
background?: string;
|
|
36
51
|
borderColor?: string;
|
|
37
52
|
}
|
|
38
|
-
interface
|
|
53
|
+
interface PlanButtonTheme {
|
|
39
54
|
background?: string;
|
|
40
55
|
textColor?: string;
|
|
41
56
|
secondaryBackground?: string;
|
|
@@ -61,10 +76,12 @@ interface IntervalToggleTheme {
|
|
|
61
76
|
interface CurrentSubscriptionCard {
|
|
62
77
|
header: CardHeaderTheme;
|
|
63
78
|
gradientColor?: string;
|
|
79
|
+
description?: CardDescriptionTheme;
|
|
80
|
+
borderRadius?: string;
|
|
64
81
|
}
|
|
65
|
-
interface
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
interface PlanTagsTheme {
|
|
83
|
+
freeTrialBackground?: string;
|
|
84
|
+
freeTrialText?: string;
|
|
68
85
|
}
|
|
69
86
|
interface CheckoutBarTheme {
|
|
70
87
|
background?: string;
|
|
@@ -74,6 +91,12 @@ interface CheckoutBarTheme {
|
|
|
74
91
|
buttonTextColor?: string;
|
|
75
92
|
}
|
|
76
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Customer Portal theme. All properties are optional.
|
|
96
|
+
* This shape matches what is defined in defaultCustomerPortalTheme and what
|
|
97
|
+
* customerPortalThemeToCssVars maps to CSS variables. Only theme groups
|
|
98
|
+
* that exist in the default theme or are supported by the helper are included.
|
|
99
|
+
*/
|
|
77
100
|
type CustomerPortalTheme = {
|
|
78
101
|
general?: {
|
|
79
102
|
linkColor?: string;
|
|
@@ -100,11 +123,26 @@ type CustomerPortalTheme = {
|
|
|
100
123
|
borderColor?: string;
|
|
101
124
|
borderRadius?: string;
|
|
102
125
|
};
|
|
103
|
-
|
|
126
|
+
summaryBalance?: {
|
|
104
127
|
background?: string;
|
|
105
128
|
padding?: string;
|
|
106
129
|
borderColor?: string;
|
|
107
130
|
borderRadius?: string;
|
|
131
|
+
label?: {
|
|
132
|
+
fontSize?: string;
|
|
133
|
+
fontWeight?: string;
|
|
134
|
+
color?: string;
|
|
135
|
+
};
|
|
136
|
+
value?: {
|
|
137
|
+
fontSize?: string;
|
|
138
|
+
fontWeight?: string;
|
|
139
|
+
color?: string;
|
|
140
|
+
};
|
|
141
|
+
unit?: {
|
|
142
|
+
fontSize?: string;
|
|
143
|
+
fontWeight?: string;
|
|
144
|
+
color?: string;
|
|
145
|
+
};
|
|
108
146
|
};
|
|
109
147
|
header?: {
|
|
110
148
|
fontSize?: string;
|
|
@@ -157,36 +195,6 @@ type CustomerPortalTheme = {
|
|
|
157
195
|
};
|
|
158
196
|
};
|
|
159
197
|
};
|
|
160
|
-
badges?: {
|
|
161
|
-
active?: {
|
|
162
|
-
background?: string;
|
|
163
|
-
textColor?: string;
|
|
164
|
-
strokeColor?: string;
|
|
165
|
-
};
|
|
166
|
-
cancelled?: {
|
|
167
|
-
background?: string;
|
|
168
|
-
textColor?: string;
|
|
169
|
-
strokeColor?: string;
|
|
170
|
-
};
|
|
171
|
-
inTrial?: {
|
|
172
|
-
background?: string;
|
|
173
|
-
textColor?: string;
|
|
174
|
-
strokeColor?: string;
|
|
175
|
-
};
|
|
176
|
-
deactivated?: {
|
|
177
|
-
background?: string;
|
|
178
|
-
textColor?: string;
|
|
179
|
-
strokeColor?: string;
|
|
180
|
-
};
|
|
181
|
-
shared?: {
|
|
182
|
-
borderRadius?: string;
|
|
183
|
-
strokeWidth?: string;
|
|
184
|
-
typography?: {
|
|
185
|
-
fontSize?: string;
|
|
186
|
-
fontWeight?: string;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
198
|
lineItems?: {
|
|
191
199
|
parentRow?: {
|
|
192
200
|
background?: string;
|
|
@@ -304,11 +312,19 @@ type CustomerPortalTheme = {
|
|
|
304
312
|
textColor?: string;
|
|
305
313
|
};
|
|
306
314
|
gradientColor?: string;
|
|
315
|
+
description?: {
|
|
316
|
+
textColor?: string;
|
|
317
|
+
textButtonColor?: string;
|
|
318
|
+
};
|
|
319
|
+
borderRadius?: string;
|
|
307
320
|
};
|
|
308
321
|
planCards?: {
|
|
309
322
|
background?: string;
|
|
310
|
-
|
|
311
|
-
|
|
323
|
+
border?: {
|
|
324
|
+
color?: string;
|
|
325
|
+
width?: string;
|
|
326
|
+
radius?: string;
|
|
327
|
+
};
|
|
312
328
|
header?: {
|
|
313
329
|
background?: string;
|
|
314
330
|
textColor?: string;
|
|
@@ -344,6 +360,7 @@ type CustomerPortalTheme = {
|
|
|
344
360
|
freeTrialText?: string;
|
|
345
361
|
};
|
|
346
362
|
};
|
|
363
|
+
/** Used by e.g. subscription line-item actions. Not set in default theme; pass to override. */
|
|
347
364
|
popover?: {
|
|
348
365
|
trigger?: {
|
|
349
366
|
background?: string;
|
|
@@ -734,12 +751,15 @@ declare const PriceCard: ({ plan, interval, featureOrderMap, isPricePage, isCust
|
|
|
734
751
|
buttonAction?: () => void;
|
|
735
752
|
}) => react_jsx_runtime.JSX.Element | null;
|
|
736
753
|
|
|
737
|
-
declare const PricingTable: ({ checkoutUsername, productKey, plansOnly, singlePurchasesOnly, showTabHeader, }: {
|
|
754
|
+
declare const PricingTable: ({ checkoutUsername, productKey, plansOnly, singlePurchasesOnly, showTabHeader, theme: themeOverride, currentPlanOfferingKey, }: {
|
|
738
755
|
checkoutUsername: string;
|
|
739
756
|
productKey: string;
|
|
740
757
|
plansOnly?: boolean;
|
|
741
758
|
singlePurchasesOnly?: boolean;
|
|
742
759
|
showTabHeader?: boolean;
|
|
760
|
+
theme?: PricingTableTheme;
|
|
761
|
+
/** When set, the plan with this offering_key is rendered as the current plan (shows currentPlanCard theme + gradient). Use in demo/Storybook to preview gradient. */
|
|
762
|
+
currentPlanOfferingKey?: string;
|
|
743
763
|
}) => react_jsx_runtime.JSX.Element;
|
|
744
764
|
|
|
745
765
|
declare const useCheckoutUrl: () => {
|