@metrifox/react-sdk 0.0.20-beta.0 → 0.0.20-beta.10

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.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
- card?: CardTheme;
6
- button?: ButtonTheme;
7
- featureList?: FeatureListTheme;
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
- borderColor?: string;
17
- descriptionColor?: string;
28
+ border?: {
29
+ color?: string;
30
+ width?: string;
31
+ radius?: string;
32
+ };
18
33
  header?: CardHeaderTheme;
19
34
  description?: CardDescriptionTheme;
20
35
  price?: CardPriceTheme;
@@ -31,11 +46,10 @@ interface CardPriceTheme {
31
46
  amountColor?: string;
32
47
  primaryTextColor?: string;
33
48
  secondaryTextColor?: string;
34
- textButtonColor?: string;
35
49
  background?: string;
36
50
  borderColor?: string;
37
51
  }
38
- interface ButtonTheme {
52
+ interface PlanButtonTheme {
39
53
  background?: string;
40
54
  textColor?: string;
41
55
  secondaryBackground?: string;
@@ -61,10 +75,12 @@ interface IntervalToggleTheme {
61
75
  interface CurrentSubscriptionCard {
62
76
  header: CardHeaderTheme;
63
77
  gradientColor?: string;
78
+ description?: CardDescriptionTheme;
79
+ borderRadius?: string;
64
80
  }
65
- interface FreeTrialTheme {
66
- background?: string;
67
- textColor?: string;
81
+ interface PlanTagsTheme {
82
+ freeTrialBackground?: string;
83
+ freeTrialText?: string;
68
84
  }
69
85
  interface CheckoutBarTheme {
70
86
  background?: string;
@@ -74,6 +90,12 @@ interface CheckoutBarTheme {
74
90
  buttonTextColor?: string;
75
91
  }
76
92
 
93
+ /**
94
+ * Customer Portal theme. All properties are optional.
95
+ * This shape matches what is defined in defaultCustomerPortalTheme and what
96
+ * customerPortalThemeToCssVars maps to CSS variables. Only theme groups
97
+ * that exist in the default theme or are supported by the helper are included.
98
+ */
77
99
  type CustomerPortalTheme = {
78
100
  general?: {
79
101
  linkColor?: string;
@@ -100,11 +122,26 @@ type CustomerPortalTheme = {
100
122
  borderColor?: string;
101
123
  borderRadius?: string;
102
124
  };
103
- summary?: {
125
+ summaryBalance?: {
104
126
  background?: string;
105
127
  padding?: string;
106
128
  borderColor?: string;
107
129
  borderRadius?: string;
130
+ label?: {
131
+ fontSize?: string;
132
+ fontWeight?: string;
133
+ color?: string;
134
+ };
135
+ value?: {
136
+ fontSize?: string;
137
+ fontWeight?: string;
138
+ color?: string;
139
+ };
140
+ unit?: {
141
+ fontSize?: string;
142
+ fontWeight?: string;
143
+ color?: string;
144
+ };
108
145
  };
109
146
  header?: {
110
147
  fontSize?: string;
@@ -124,7 +161,10 @@ type CustomerPortalTheme = {
124
161
  iconBackground?: string;
125
162
  iconColor?: string;
126
163
  emptyTextColor?: string;
127
- usageBarColor?: string;
164
+ usage?: {
165
+ barColor?: string;
166
+ trackColor?: string;
167
+ };
128
168
  };
129
169
  buttons?: {
130
170
  primary?: {
@@ -154,36 +194,6 @@ type CustomerPortalTheme = {
154
194
  };
155
195
  };
156
196
  };
157
- badges?: {
158
- active?: {
159
- background?: string;
160
- textColor?: string;
161
- strokeColor?: string;
162
- };
163
- cancelled?: {
164
- background?: string;
165
- textColor?: string;
166
- strokeColor?: string;
167
- };
168
- inTrial?: {
169
- background?: string;
170
- textColor?: string;
171
- strokeColor?: string;
172
- };
173
- deactivated?: {
174
- background?: string;
175
- textColor?: string;
176
- strokeColor?: string;
177
- };
178
- shared?: {
179
- borderRadius?: string;
180
- strokeWidth?: string;
181
- typography?: {
182
- fontSize?: string;
183
- fontWeight?: string;
184
- };
185
- };
186
- };
187
197
  lineItems?: {
188
198
  parentRow?: {
189
199
  background?: string;
@@ -240,6 +250,13 @@ type CustomerPortalTheme = {
240
250
  rowTextColor?: string;
241
251
  borderColor?: string;
242
252
  cellPadding?: string;
253
+ expandIconColor?: string;
254
+ typography?: {
255
+ fontSize?: string;
256
+ fontWeight?: string;
257
+ headerFontSize?: string;
258
+ headerFontWeight?: string;
259
+ };
243
260
  pagination?: {
244
261
  background?: string;
245
262
  activeBackground?: string;
@@ -294,11 +311,15 @@ type CustomerPortalTheme = {
294
311
  textColor?: string;
295
312
  };
296
313
  gradientColor?: string;
314
+ borderRadius?: string;
297
315
  };
298
316
  planCards?: {
299
317
  background?: string;
300
- borderColor?: string;
301
- descriptionColor?: string;
318
+ border?: {
319
+ color?: string;
320
+ width?: string;
321
+ radius?: string;
322
+ };
302
323
  header?: {
303
324
  background?: string;
304
325
  textColor?: string;
@@ -334,6 +355,29 @@ type CustomerPortalTheme = {
334
355
  freeTrialText?: string;
335
356
  };
336
357
  };
358
+ /** Used by e.g. subscription line-item actions. Not set in default theme; pass to override. */
359
+ popover?: {
360
+ trigger?: {
361
+ background?: string;
362
+ iconColor?: string;
363
+ borderColor?: string;
364
+ borderRadius?: string;
365
+ };
366
+ menu?: {
367
+ background?: string;
368
+ borderColor?: string;
369
+ borderRadius?: string;
370
+ padding?: string;
371
+ itemHoverBackground?: string;
372
+ itemDividerColor?: string;
373
+ typography?: {
374
+ fontSize?: string;
375
+ fontWeight?: string;
376
+ color?: string;
377
+ dangerColor?: string;
378
+ };
379
+ };
380
+ };
337
381
  };
338
382
 
339
383
  interface Theme {
@@ -702,12 +746,15 @@ declare const PriceCard: ({ plan, interval, featureOrderMap, isPricePage, isCust
702
746
  buttonAction?: () => void;
703
747
  }) => react_jsx_runtime.JSX.Element | null;
704
748
 
705
- declare const PricingTable: ({ checkoutUsername, productKey, plansOnly, singlePurchasesOnly, showTabHeader, }: {
749
+ declare const PricingTable: ({ checkoutUsername, productKey, plansOnly, singlePurchasesOnly, showTabHeader, theme: themeOverride, currentPlanOfferingKey, }: {
706
750
  checkoutUsername: string;
707
751
  productKey: string;
708
752
  plansOnly?: boolean;
709
753
  singlePurchasesOnly?: boolean;
710
754
  showTabHeader?: boolean;
755
+ theme?: PricingTableTheme;
756
+ /** 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. */
757
+ currentPlanOfferingKey?: string;
711
758
  }) => react_jsx_runtime.JSX.Element;
712
759
 
713
760
  declare const useCheckoutUrl: () => {