@stigg/react-sdk 4.7.0 → 4.8.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.7.0",
2
+ "version": "4.8.0",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -83,7 +83,7 @@ export function CheckoutContainer({
83
83
  onMockCheckoutPreview,
84
84
  }: CheckoutContainerProps) {
85
85
  const { stripePromise, setupIntentClientSecret } = useStripeIntegration();
86
- const [{ stiggTheme, widgetState }] = useCheckoutContext();
86
+ const [{ stiggTheme, widgetState, theme }] = useCheckoutContext();
87
87
  const { currentStep } = useProgressBarModel();
88
88
 
89
89
  const { isLoadingCheckoutData } = widgetState;
@@ -132,7 +132,16 @@ export function CheckoutContainer({
132
132
  colorPrimaryText: stiggTheme.palette.text.primary,
133
133
  colorTextPlaceholder: stiggTheme.palette.text.disabled,
134
134
  fontFamily: stiggTheme.typography.fontFamily,
135
+ colorBackground: theme?.paymentInputBackgroundColor,
136
+ borderRadius: theme?.paymentInputBorderRadius,
135
137
  },
138
+ rules: theme?.paymentInputBorderColor
139
+ ? {
140
+ '.Input': {
141
+ borderColor: theme?.paymentInputBorderColor,
142
+ },
143
+ }
144
+ : undefined,
136
145
  },
137
146
  }}>
138
147
  <CheckoutLayout className="stigg-checkout-layout">
@@ -8,6 +8,9 @@ export type CheckoutTheme = {
8
8
  backgroundColor: string;
9
9
  borderColor: string;
10
10
  summaryBackgroundColor: string;
11
+ paymentInputBackgroundColor?: string;
12
+ paymentInputBorderColor?: string;
13
+ paymentInputBorderRadius?: string;
11
14
  };
12
15
 
13
16
  const defaultCheckoutTheme: CheckoutTheme = {
@@ -36,5 +39,8 @@ export function getResolvedCheckoutTheme(
36
39
  themeOverride?.summaryBackgroundColor ||
37
40
  globalPalette?.backgroundHighlight ||
38
41
  defaultCheckoutTheme.summaryBackgroundColor,
42
+ paymentInputBackgroundColor: themeOverride?.paymentInputBackgroundColor,
43
+ paymentInputBorderColor: themeOverride?.paymentInputBorderColor,
44
+ paymentInputBorderRadius: themeOverride?.paymentInputBorderRadius,
39
45
  };
40
46
  }
@@ -171,7 +171,8 @@ export function PlanOffering({
171
171
 
172
172
  useEffect(() => {
173
173
  setSelectedTierByFeature(getSelectedTier(plan, billingPeriod, currentSubscription, selectedTierByFeature));
174
- }, [billingPeriod, currentSubscription, plan, selectedTierByFeature]);
174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
175
+ }, [billingPeriod, currentSubscription, plan]);
175
176
 
176
177
  const onPlanButtonClick = (intentionType: SubscribeIntentionType) => {
177
178
  const billableFeatures: BillableFeature[] = Object.keys(selectedTierByFeature).map((featureId) => ({