@stigg/react-sdk 4.4.1 → 4.4.3
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/CheckoutContainer.d.ts +2 -1
- package/dist/components/checkout/index.d.ts +3 -2
- package/dist/components/checkout/promotionCode/AppliedPromotionCode.d.ts +6 -0
- package/dist/components/checkout/steps/payment/PaymentMethods.d.ts +2 -2
- package/dist/components/checkout/steps/payment/PaymentStep.d.ts +1 -1
- package/dist/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react-sdk.cjs.development.js +43 -24
- 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 +49 -25
- package/dist/react-sdk.esm.js.map +1 -1
- package/dist/stories/mocks/checkout/mockCheckoutState.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/checkout/CheckoutContainer.tsx +14 -4
- package/src/components/checkout/index.ts +8 -2
- package/src/components/checkout/promotionCode/AppliedPromotionCode.tsx +14 -2
- package/src/components/checkout/steps/payment/PaymentMethods.tsx +3 -2
- package/src/components/checkout/steps/payment/PaymentStep.tsx +5 -1
- package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +6 -2
- package/src/index.ts +17 -1
- package/src/stories/mocks/checkout/mockCheckoutState.ts +1 -1
|
@@ -24,6 +24,7 @@ export declare type CheckoutContainerProps = {
|
|
|
24
24
|
}) => Promise<void>;
|
|
25
25
|
disablePromotionCode?: boolean;
|
|
26
26
|
disableSuccessAnimation?: boolean;
|
|
27
|
+
collectPhoneNumber?: boolean;
|
|
27
28
|
onMockCheckoutPreview?: MockCheckoutPreviewCallback;
|
|
28
29
|
};
|
|
29
|
-
export declare function CheckoutContainer({ onCheckout, onCheckoutCompleted, onChangePlan, onBillingAddressChange, disablePromotionCode, disableSuccessAnimation, onMockCheckoutPreview, }: CheckoutContainerProps): JSX.Element;
|
|
30
|
+
export declare function CheckoutContainer({ onCheckout, onCheckoutCompleted, onChangePlan, onBillingAddressChange, collectPhoneNumber, disablePromotionCode, disableSuccessAnimation, onMockCheckoutPreview, }: CheckoutContainerProps): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { CheckoutTheme } from './theme';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { OnCheckoutCompletedParams, OnCheckoutParams, CheckoutResult, CheckoutContainerProps, } from './CheckoutContainer';
|
|
3
|
+
export { CheckoutProviderProps } from './CheckoutProvider';
|
|
4
4
|
export { CheckoutLocalization } from './textOverrides';
|
|
5
|
+
export { Checkout, CheckoutProps } from './Checkout';
|
|
5
6
|
export * from './types';
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="@emotion/styled/macro" />
|
|
3
|
+
export declare const StyledIcon: import("@emotion/styled/macro").StyledComponent<import("../../common/Icon").IconProps & {
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$shouldFill?: boolean | undefined;
|
|
7
|
+
}, {}, {}>;
|
|
2
8
|
export declare type AppliedPromotionCodeProps = {
|
|
3
9
|
promotionCode: string;
|
|
4
10
|
onClearPromotionCode: () => void;
|
|
@@ -16,6 +16,6 @@ export declare type PaymentMethodProps = Pick<Customer, 'paymentMethodDetails'>
|
|
|
16
16
|
export declare type NewPaymentMethodProps = Pick<PaymentMethodLayoutProps, 'checked' | 'readOnly'> & {
|
|
17
17
|
onSelect: () => void;
|
|
18
18
|
checkoutLocalization: CheckoutLocalization;
|
|
19
|
-
} & Pick<CheckoutContainerProps, 'onBillingAddressChange'>;
|
|
19
|
+
} & Pick<CheckoutContainerProps, 'onBillingAddressChange' | 'collectPhoneNumber'>;
|
|
20
20
|
export declare function ExistingPaymentMethod({ checked, paymentMethodDetails, readOnly, onSelect }: PaymentMethodProps): JSX.Element | null;
|
|
21
|
-
export declare function NewPaymentMethod({ checked, onSelect, readOnly, checkoutLocalization, onBillingAddressChange, }: NewPaymentMethodProps): JSX.Element;
|
|
21
|
+
export declare function NewPaymentMethod({ checked, onSelect, readOnly, checkoutLocalization, onBillingAddressChange, collectPhoneNumber, }: NewPaymentMethodProps): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckoutContainerProps } from '../../CheckoutContainer';
|
|
3
|
-
export declare function PaymentStep({ onBillingAddressChange }: Pick<CheckoutContainerProps, 'onBillingAddressChange'>): JSX.Element;
|
|
3
|
+
export declare function PaymentStep({ onBillingAddressChange, collectPhoneNumber, }: Pick<CheckoutContainerProps, 'onBillingAddressChange' | 'collectPhoneNumber'>): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckoutContainerProps } from '../../../CheckoutContainer';
|
|
3
|
-
export declare function StripePaymentForm({ onBillingAddressChange }: Pick<CheckoutContainerProps, 'onBillingAddressChange'>): JSX.Element;
|
|
3
|
+
export declare function StripePaymentForm({ onBillingAddressChange, collectPhoneNumber, }: Pick<CheckoutContainerProps, 'onBillingAddressChange' | 'collectPhoneNumber'>): JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from '@stigg/js-client-sdk';
|
|
|
3
3
|
export { Paywall, PaywallProps, OnPlanSelectedCallbackFn, PaywallPlan, SubscribeIntentionType, PaywallLocalization, } from './components/paywall';
|
|
4
4
|
export { CustomerPortalProvider, CustomerPortal, CustomerPortalProps, CustomerPortalSection, AddonsList, PaymentDetailsSection, InvoicesSection, CustomerUsageData, CustomerUsageDataProps, SubscriptionsOverview, SubscriptionsOverviewProps, Promotions, } from './components/customerPortal';
|
|
5
5
|
export { StiggProvider, StiggProviderProps, useStiggContext, StiggContextValue, StiggContext, } from './components/StiggProvider';
|
|
6
|
-
export { Checkout, CheckoutProps, CheckoutTheme } from './components/checkout';
|
|
6
|
+
export { Checkout, CheckoutProps, CheckoutProviderProps, CheckoutContainerProps, CheckoutLocalization, CheckoutResult, OnCheckoutCompletedParams, OnCheckoutParams, CheckoutTheme, CheckoutMockProps, MockCheckoutPreviewCallback, MockCheckoutStateCallback, BillingInformation, TaxDetailsInput, } from './components/checkout';
|
|
7
7
|
export { useWaitForCheckoutCompleted, ProvisionStatus } from './components/hooks';
|
|
8
8
|
export { HorizontalAlignment, TextAlignment } from './theme/types';
|
|
9
9
|
export { CustomizedTheme as Theme } from './theme/Theme';
|
|
@@ -7933,7 +7933,7 @@ var AddPromotionCode = function AddPromotionCode(_ref2) {
|
|
|
7933
7933
|
};
|
|
7934
7934
|
|
|
7935
7935
|
var AppliedCouponContainer = /*#__PURE__*/_styled(material.Grid, {
|
|
7936
|
-
target: "
|
|
7936
|
+
target: "e1cvrfx31",
|
|
7937
7937
|
label: "AppliedCouponContainer"
|
|
7938
7938
|
})("width:auto;display:inline-flex;align-items:center;flex-direction:row;gap:8px;padding:6px 8px;border-radius:", function (_ref) {
|
|
7939
7939
|
var theme = _ref.theme;
|
|
@@ -7941,11 +7941,25 @@ var AppliedCouponContainer = /*#__PURE__*/_styled(material.Grid, {
|
|
|
7941
7941
|
}, ";border:1px solid ", function (_ref2) {
|
|
7942
7942
|
var theme = _ref2.theme;
|
|
7943
7943
|
return theme.stigg.palette.primary;
|
|
7944
|
-
}, ";" + ( "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
7944
|
+
}, ";" + ( "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFwcGxpZWRQcm9tb3Rpb25Db2RlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNNEMiLCJmaWxlIjoiQXBwbGllZFByb21vdGlvbkNvZGUudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW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BcHBsaWVkUHJvbW90aW9uQ29kZS5qcy5tYXAiXX0= */"));
|
|
7945
7945
|
|
|
7946
|
-
var
|
|
7947
|
-
|
|
7948
|
-
|
|
7946
|
+
var StyledIcon$1 = /*#__PURE__*/_styled(Icon, {
|
|
7947
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
7948
|
+
return prop !== 'style';
|
|
7949
|
+
},
|
|
7950
|
+
target: "e1cvrfx30",
|
|
7951
|
+
label: "StyledIcon"
|
|
7952
|
+
})("display:flex;g{stroke:", function (_ref3) {
|
|
7953
|
+
var theme = _ref3.theme;
|
|
7954
|
+
return theme.stigg.palette.primary;
|
|
7955
|
+
}, ";}path{fill:", function (_ref4) {
|
|
7956
|
+
var theme = _ref4.theme,
|
|
7957
|
+
$shouldFill = _ref4.$shouldFill;
|
|
7958
|
+
return $shouldFill ? theme.stigg.palette.primary : undefined;
|
|
7959
|
+
}, ";}" + ( "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFwcGxpZWRQcm9tb3Rpb25Db2RlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQjBGIiwiZmlsZSI6IkFwcGxpZWRQcm9tb3Rpb25Db2RlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkL21hY3JvJztcclxuaW1wb3J0IHsgR3JpZCB9IGZyb20gJ0BtdWkvbWF0ZXJpYWwnO1xyXG5pbXBvcnQgeyBJY29uIH0gZnJvbSAnLi4vLi4vY29tbW9uL0ljb24nO1xyXG5pbXBvcnQgeyBUeXBvZ3JhcGh5IH0gZnJvbSAnLi4vLi4vY29tbW9uL1R5cG9ncmFwaHknO1xyXG5pbXBvcnQgeyBCdXR0b24gfSBmcm9tICcuLi9jb21wb25lbnRzJztcclxuY29uc3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GRpc3BsYXk6IFwiZmxleFwiLCBnYXA6IDEsIGFsaWduSXRlbXM6IFwiY2VudGVyXCIgfSxcclxuICAgICAgICBSZWFjdC5jcmVhdGVFbGVtZW50KFN0eWxlZEljb24sIHsgaWNvbjogXCJDb3Vwb25cIiB9KSxcclxuICAgICAgICBSZWFjdC5jcmVhdGVFbGVtZW50KFR5cG9ncmFwaHksIHsgdmFyaWFudDogXCJib2R5MVwiLCBjb2xvcjogXCJwcmltYXJ5Lm1haW5cIiwgbGluZUhlaWdodDogXCJhdXRvXCIgfSwgcHJvbW90aW9uQ29kZSkpLFxyXG4gICAgUmVhY3QuY3JlYXRlRWxlbWVudChHcmlkLCB7IGl0ZW06IHRydWUgfSxcclxuICAgICAgICBSZWFjdC5jcmVhdGVFbGVtZW50KEJ1dHRvbiwgeyB2YXJpYW50OiBcInRleHRcIiwgc3g6IHsgbWluV2lkdGg6ICd1bnNldCcsIHBhZGRpbmc6IDAgfSwgb25DbGljazogb25DbGVhclByb21vdGlvbkNvZGUgfSxcclxuICAgICAgICAgICAgUmVhY3QuY3JlYXRlRWxlbWVudChTdHlsZWRJY29uLCB7IGljb246IFwiQ2xvc2VcIiwgXCIkc2hvdWxkRmlsbFwiOiB0cnVlIH0pKSkpKTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QXBwbGllZFByb21vdGlvbkNvZGUuanMubWFwIl19 */"));
|
|
7960
|
+
var AppliedPromotionCode = function AppliedPromotionCode(_ref5) {
|
|
7961
|
+
var promotionCode = _ref5.promotionCode,
|
|
7962
|
+
onClearPromotionCode = _ref5.onClearPromotionCode;
|
|
7949
7963
|
return React__default.createElement(AppliedCouponContainer, {
|
|
7950
7964
|
container: true
|
|
7951
7965
|
}, React__default.createElement(material.Grid, {
|
|
@@ -7953,11 +7967,8 @@ var AppliedPromotionCode = function AppliedPromotionCode(_ref3) {
|
|
|
7953
7967
|
display: "flex",
|
|
7954
7968
|
gap: 1,
|
|
7955
7969
|
alignItems: "center"
|
|
7956
|
-
}, React__default.createElement(
|
|
7957
|
-
icon: "Coupon"
|
|
7958
|
-
style: {
|
|
7959
|
-
display: 'flex'
|
|
7960
|
-
}
|
|
7970
|
+
}, React__default.createElement(StyledIcon$1, {
|
|
7971
|
+
icon: "Coupon"
|
|
7961
7972
|
}), React__default.createElement(Typography, {
|
|
7962
7973
|
variant: "body1",
|
|
7963
7974
|
color: "primary.main",
|
|
@@ -7971,11 +7982,9 @@ var AppliedPromotionCode = function AppliedPromotionCode(_ref3) {
|
|
|
7971
7982
|
padding: 0
|
|
7972
7983
|
},
|
|
7973
7984
|
onClick: onClearPromotionCode
|
|
7974
|
-
}, React__default.createElement(
|
|
7985
|
+
}, React__default.createElement(StyledIcon$1, {
|
|
7975
7986
|
icon: "Close",
|
|
7976
|
-
|
|
7977
|
-
display: 'flex'
|
|
7978
|
-
}
|
|
7987
|
+
"$shouldFill": true
|
|
7979
7988
|
}))));
|
|
7980
7989
|
};
|
|
7981
7990
|
|
|
@@ -8019,7 +8028,8 @@ var _excluded$6 = ["postal_code"];
|
|
|
8019
8028
|
function StripePaymentForm(_ref) {
|
|
8020
8029
|
var _configuration$conten;
|
|
8021
8030
|
|
|
8022
|
-
var onBillingAddressChange = _ref.onBillingAddressChange
|
|
8031
|
+
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
8032
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
8023
8033
|
|
|
8024
8034
|
var _useCheckoutModel = useCheckoutModel(),
|
|
8025
8035
|
checkoutState = _useCheckoutModel.checkoutState,
|
|
@@ -8035,6 +8045,7 @@ function StripePaymentForm(_ref) {
|
|
|
8035
8045
|
configuration = _ref2.configuration;
|
|
8036
8046
|
|
|
8037
8047
|
var readOnly = widgetState.readOnly;
|
|
8048
|
+
var shouldCollectPhoneNumber = !!(collectPhoneNumber != null ? collectPhoneNumber : configuration == null ? void 0 : (_configuration$conten = configuration.content) == null ? void 0 : _configuration$conten.collectPhoneNumber);
|
|
8038
8049
|
|
|
8039
8050
|
var handleAddressChange = function handleAddressChange(args) {
|
|
8040
8051
|
if (!args.complete) {
|
|
@@ -8105,7 +8116,7 @@ function StripePaymentForm(_ref) {
|
|
|
8105
8116
|
options: {
|
|
8106
8117
|
mode: 'billing',
|
|
8107
8118
|
fields: {
|
|
8108
|
-
phone:
|
|
8119
|
+
phone: shouldCollectPhoneNumber ? 'always' : 'auto'
|
|
8109
8120
|
},
|
|
8110
8121
|
defaultValues: _extends({}, (customer == null ? void 0 : customer.name) && {
|
|
8111
8122
|
name: customer.name
|
|
@@ -12859,7 +12870,8 @@ function NewPaymentMethod(_ref3) {
|
|
|
12859
12870
|
onSelect = _ref3.onSelect,
|
|
12860
12871
|
readOnly = _ref3.readOnly,
|
|
12861
12872
|
checkoutLocalization = _ref3.checkoutLocalization,
|
|
12862
|
-
onBillingAddressChange = _ref3.onBillingAddressChange
|
|
12873
|
+
onBillingAddressChange = _ref3.onBillingAddressChange,
|
|
12874
|
+
collectPhoneNumber = _ref3.collectPhoneNumber;
|
|
12863
12875
|
return React__default.createElement(NewPaymentMethodContainer, {
|
|
12864
12876
|
item: true,
|
|
12865
12877
|
onClick: onSelect,
|
|
@@ -12874,14 +12886,16 @@ function NewPaymentMethod(_ref3) {
|
|
|
12874
12886
|
}), React__default.createElement(material.Collapse, {
|
|
12875
12887
|
"in": checked
|
|
12876
12888
|
}, React__default.createElement(StripePaymentForm, {
|
|
12877
|
-
onBillingAddressChange: onBillingAddressChange
|
|
12889
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
12890
|
+
collectPhoneNumber: collectPhoneNumber
|
|
12878
12891
|
})));
|
|
12879
12892
|
}
|
|
12880
12893
|
|
|
12881
12894
|
var _templateObject$8;
|
|
12882
12895
|
var PaymentContainer = /*#__PURE__*/styled$1(material.Grid)(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));
|
|
12883
12896
|
function PaymentStep(_ref) {
|
|
12884
|
-
var onBillingAddressChange = _ref.onBillingAddressChange
|
|
12897
|
+
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
12898
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
12885
12899
|
|
|
12886
12900
|
var _useCheckoutModel = useCheckoutModel(),
|
|
12887
12901
|
checkoutState = _useCheckoutModel.checkoutState,
|
|
@@ -12929,7 +12943,8 @@ function PaymentStep(_ref) {
|
|
|
12929
12943
|
onSelect: function onSelect() {
|
|
12930
12944
|
return handleOnSelect(true);
|
|
12931
12945
|
},
|
|
12932
|
-
onBillingAddressChange: onBillingAddressChange
|
|
12946
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
12947
|
+
collectPhoneNumber: collectPhoneNumber
|
|
12933
12948
|
}));
|
|
12934
12949
|
}
|
|
12935
12950
|
|
|
@@ -13498,7 +13513,8 @@ var DowngradeToFreePlan = function DowngradeToFreePlan(_ref3) {
|
|
|
13498
13513
|
|
|
13499
13514
|
var getStepProps = function getStepProps(currentStep, _ref) {
|
|
13500
13515
|
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
13501
|
-
onChangePlan = _ref.onChangePlan
|
|
13516
|
+
onChangePlan = _ref.onChangePlan,
|
|
13517
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
13502
13518
|
|
|
13503
13519
|
switch (currentStep.key) {
|
|
13504
13520
|
case CheckoutStepKey.PLAN:
|
|
@@ -13516,7 +13532,8 @@ var getStepProps = function getStepProps(currentStep, _ref) {
|
|
|
13516
13532
|
case CheckoutStepKey.PAYMENT:
|
|
13517
13533
|
return {
|
|
13518
13534
|
content: React__default.createElement(PaymentStep, {
|
|
13519
|
-
onBillingAddressChange: onBillingAddressChange
|
|
13535
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
13536
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13520
13537
|
})
|
|
13521
13538
|
};
|
|
13522
13539
|
|
|
@@ -13532,6 +13549,7 @@ function CheckoutContainer(_ref2) {
|
|
|
13532
13549
|
onCheckoutCompleted = _ref2.onCheckoutCompleted,
|
|
13533
13550
|
onChangePlan = _ref2.onChangePlan,
|
|
13534
13551
|
onBillingAddressChange = _ref2.onBillingAddressChange,
|
|
13552
|
+
collectPhoneNumber = _ref2.collectPhoneNumber,
|
|
13535
13553
|
disablePromotionCode = _ref2.disablePromotionCode,
|
|
13536
13554
|
disableSuccessAnimation = _ref2.disableSuccessAnimation,
|
|
13537
13555
|
onMockCheckoutPreview = _ref2.onMockCheckoutPreview;
|
|
@@ -13562,15 +13580,16 @@ function CheckoutContainer(_ref2) {
|
|
|
13562
13580
|
|
|
13563
13581
|
var _getStepProps = getStepProps(currentStep, {
|
|
13564
13582
|
onBillingAddressChange: onBillingAddressChange,
|
|
13565
|
-
onChangePlan: onChangePlan
|
|
13583
|
+
onChangePlan: onChangePlan,
|
|
13584
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13566
13585
|
}),
|
|
13567
13586
|
content = _getStepProps.content;
|
|
13568
13587
|
|
|
13569
13588
|
var checkoutContent = React__default.createElement(React__default.Fragment, null, isFreeDowngrade ? React__default.createElement(DowngradeToFreePlan, {
|
|
13570
|
-
checkoutLocalization: checkoutLocalization,
|
|
13571
13589
|
freePlan: plan,
|
|
13572
13590
|
activeSubscription: activeSubscription,
|
|
13573
13591
|
allowChangePlan: true,
|
|
13592
|
+
checkoutLocalization: checkoutLocalization,
|
|
13574
13593
|
onChangePlan: onChangePlan
|
|
13575
13594
|
}) : React__default.createElement(React__default.Fragment, null, content));
|
|
13576
13595
|
var stripeElementsMode = React.useMemo(function () {
|