@stigg/react-sdk 4.4.0 → 4.4.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.4.0",
2
+ "version": "4.4.1",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import { Elements } from '@stripe/react-stripe-js';
3
3
  import { PricingType, BillingAddress, ApplySubscription, CheckoutStatePlan } from '@stigg/js-client-sdk';
4
4
  import { CheckoutContent, CheckoutLayout, CheckoutPanel } from './CheckoutContainer.style';
@@ -94,9 +94,10 @@ export function CheckoutContainer({
94
94
  </>
95
95
  );
96
96
 
97
- const stripeElementsMode: StripeClientSecret | StripeManualMode = setupIntentClientSecret
98
- ? { clientSecret: setupIntentClientSecret }
99
- : { mode: 'setup', currency: 'usd' };
97
+ const stripeElementsMode: StripeClientSecret | StripeManualMode = useMemo(
98
+ () => (setupIntentClientSecret ? { clientSecret: setupIntentClientSecret } : { mode: 'setup', currency: 'usd' }),
99
+ [setupIntentClientSecret],
100
+ );
100
101
 
101
102
  return (
102
103
  <Elements
@@ -19,4 +19,7 @@ export const InputField = styled(TextField)<OutlinedInputProps>(({ theme }) => (
19
19
  color: theme.stigg.palette.text.primary,
20
20
  ...theme.stigg.typography.body,
21
21
  },
22
+ '& .Mui-error': {
23
+ fontFamily: theme.stigg.typography.fontFamily,
24
+ },
22
25
  }));
@@ -25,11 +25,10 @@ export const StyledStepButton = styled(Button)(() => ({
25
25
 
26
26
  export const StyledIcon = styled(Icon, { shouldForwardProp: (prop) => !prop.startsWith('$') })<{
27
27
  $disabled?: boolean;
28
- $shouldStroke?: boolean;
29
28
  $shouldFill?: boolean;
30
- }>(({ theme, $disabled, $shouldStroke = true, $shouldFill }) => ({
29
+ }>(({ theme, $disabled, $shouldFill }) => ({
31
30
  circle: {
32
- stroke: $shouldStroke ? ($disabled ? theme.stigg.palette.primaryLight : theme.stigg.palette.primary) : undefined,
31
+ stroke: $disabled ? theme.stigg.palette.primaryLight : theme.stigg.palette.primary,
33
32
  fill: $shouldFill ? ($disabled ? theme.stigg.palette.primaryLight : theme.stigg.palette.primary) : undefined,
34
33
  },
35
34
  }));
@@ -37,7 +37,6 @@ export const CheckoutProgressBar = () => {
37
37
  <StyledIcon
38
38
  icon={isCompleted ? checkedIcon : 'OutlinedCircle'}
39
39
  $disabled={isDisabled}
40
- $shouldStroke={(isCompleted && !isDisabled) || isDisabled}
41
40
  $shouldFill={isCompleted}
42
41
  />
43
42
  }