@stigg/react-sdk 4.7.1 → 4.8.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/dist/components/checkout/configurations/theme.d.ts +3 -0
- package/dist/react-sdk.cjs.development.js +44 -28
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +51 -30
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/checkout/CheckoutContainer.tsx +10 -1
- package/src/components/checkout/configurations/theme.ts +6 -0
- package/src/components/checkout/summary/CheckoutSuccess.tsx +12 -7
- package/src/components/paywall/PlanOffering.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.8.1",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"moment": "^2.29.4",
|
|
123
123
|
"react-feather": "^2.0.10",
|
|
124
124
|
"react-loading-skeleton": "^3.1.0",
|
|
125
|
-
"react
|
|
125
|
+
"lottie-react": "^2.4.0",
|
|
126
126
|
"react-spinners": "^0.13.3",
|
|
127
127
|
"react-switch": "^7.0.0",
|
|
128
128
|
"styled-components": "^5.3.6",
|
|
@@ -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
|
}
|
|
@@ -2,7 +2,7 @@ import styled from '@emotion/styled/macro';
|
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import Color from 'color';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import Lottie from 'react
|
|
5
|
+
import Lottie from 'lottie-react';
|
|
6
6
|
import animationData from '../../../assets/lottie/checkout-success.json';
|
|
7
7
|
import { Typography } from '../../common/Typography';
|
|
8
8
|
import { CheckoutLocalization } from '../configurations/textOverrides';
|
|
@@ -59,15 +59,20 @@ const CheckoutSuccessText = styled(Typography)`
|
|
|
59
59
|
animation: fadeIn 5s ease-in forwards;
|
|
60
60
|
`;
|
|
61
61
|
|
|
62
|
+
const StyledLottie = styled(Lottie)`
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
|
|
66
|
+
svg {
|
|
67
|
+
width: 350px !important;
|
|
68
|
+
height: auto !important;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
|
|
62
72
|
export function CheckoutSuccess({ checkoutLocalization }: { checkoutLocalization: CheckoutLocalization }) {
|
|
63
73
|
return (
|
|
64
74
|
<CheckoutSuccessContainer className="stigg-checkout-success-container">
|
|
65
|
-
<
|
|
66
|
-
width={350}
|
|
67
|
-
height="auto"
|
|
68
|
-
isClickToPauseDisabled
|
|
69
|
-
options={{ loop: false, autoplay: true, animationData }}
|
|
70
|
-
/>
|
|
75
|
+
<StyledLottie animationData={animationData} loop={false} autoplay />
|
|
71
76
|
<CheckoutSuccessText variant="h1" color="primary.main">
|
|
72
77
|
{checkoutLocalization.summary.checkoutSuccessText}
|
|
73
78
|
</CheckoutSuccessText>
|
|
@@ -185,7 +185,7 @@ export function PlanOffering({
|
|
|
185
185
|
|
|
186
186
|
return (
|
|
187
187
|
<PlanOfferingContainer
|
|
188
|
-
className={classNames('stigg-plan-offering-container', {
|
|
188
|
+
className={classNames(`stigg-${plan.id}`, 'stigg-plan-offering-container', {
|
|
189
189
|
'stigg-current-plan': plan.isCurrentCustomerPlan,
|
|
190
190
|
})}
|
|
191
191
|
$isHighlighted={isHighlighted}
|