@stigg/react-sdk 5.28.1 → 5.28.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/utils/currencyUtils.d.ts +2 -1
- package/dist/react-sdk.cjs.development.js +15 -9
- 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 +16 -10
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/checkout/summary/components/CheckoutCaptions.tsx +6 -5
- package/src/components/utils/currencyUtils.ts +4 -3
- package/src/components/utils/getPaidPriceText.ts +7 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Currency } from '@stigg/js-client-sdk';
|
|
2
|
-
export declare const currencyPriceFormatter: ({ amount, currency, locale, maximumFractionDigits, minimumFractionDigits, }: {
|
|
2
|
+
export declare const currencyPriceFormatter: ({ amount, currency, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZero, }: {
|
|
3
3
|
amount: number;
|
|
4
4
|
currency?: string | undefined;
|
|
5
5
|
locale?: string | undefined;
|
|
6
6
|
maximumFractionDigits?: number | undefined;
|
|
7
7
|
minimumFractionDigits?: number | undefined;
|
|
8
|
+
removeTrailingZero?: boolean | undefined;
|
|
8
9
|
}) => string;
|
|
@@ -1158,7 +1158,8 @@ var currencyPriceFormatter = function currencyPriceFormatter(_ref) {
|
|
|
1158
1158
|
_ref$maximumFractionD = _ref.maximumFractionDigits,
|
|
1159
1159
|
maximumFractionDigits = _ref$maximumFractionD === void 0 ? 5 : _ref$maximumFractionD,
|
|
1160
1160
|
_ref$minimumFractionD = _ref.minimumFractionDigits,
|
|
1161
|
-
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD
|
|
1161
|
+
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD,
|
|
1162
|
+
removeTrailingZero = _ref.removeTrailingZero;
|
|
1162
1163
|
var currencyString = currency.toString();
|
|
1163
1164
|
var currencySymbol = getSymbolFromCurrency(currencyString);
|
|
1164
1165
|
var formattedPrice = new Intl.NumberFormat(locale, _extends({
|
|
@@ -1166,8 +1167,7 @@ var currencyPriceFormatter = function currencyPriceFormatter(_ref) {
|
|
|
1166
1167
|
minimumFractionDigits: minimumFractionDigits,
|
|
1167
1168
|
style: 'currency',
|
|
1168
1169
|
currency: currencyString,
|
|
1169
|
-
|
|
1170
|
-
trailingZeroDisplay: 'stripIfInteger'
|
|
1170
|
+
trailingZeroDisplay: removeTrailingZero ? 'stripIfInteger' : 'auto'
|
|
1171
1171
|
}, currencySymbol ? {
|
|
1172
1172
|
currencyDisplay: 'code'
|
|
1173
1173
|
} : {})).format(amount || 0);
|
|
@@ -1238,7 +1238,8 @@ function getPaidPriceText(_ref) {
|
|
|
1238
1238
|
amount: priceNumber,
|
|
1239
1239
|
currency: currency,
|
|
1240
1240
|
locale: locale,
|
|
1241
|
-
minimumFractionDigits: 2
|
|
1241
|
+
minimumFractionDigits: 2,
|
|
1242
|
+
removeTrailingZero: true
|
|
1242
1243
|
}),
|
|
1243
1244
|
unit: unit,
|
|
1244
1245
|
tiers: tiers,
|
|
@@ -3424,7 +3425,7 @@ function mapPaywallData(paywall, showOnlyEligiblePlans) {
|
|
|
3424
3425
|
};
|
|
3425
3426
|
}
|
|
3426
3427
|
|
|
3427
|
-
var version = "5.28.
|
|
3428
|
+
var version = "5.28.3";
|
|
3428
3429
|
var name = "@stigg/react-sdk";
|
|
3429
3430
|
|
|
3430
3431
|
var StiggContext = /*#__PURE__*/React__default.createContext(null);
|
|
@@ -12243,7 +12244,8 @@ var RemainingCreditsCaption = function RemainingCreditsCaption(_ref) {
|
|
|
12243
12244
|
variant: "body1",
|
|
12244
12245
|
style: {
|
|
12245
12246
|
marginTop: 14
|
|
12246
|
-
}
|
|
12247
|
+
},
|
|
12248
|
+
className: "stigg-checkout-summary-captions-remaining-credits"
|
|
12247
12249
|
}, React__default.createElement(WithSkeleton, {
|
|
12248
12250
|
isLoading: isFetchingSubscriptionPreview,
|
|
12249
12251
|
width: "100%"
|
|
@@ -12270,7 +12272,8 @@ var ScheduledUpdatesCaption = function ScheduledUpdatesCaption(_ref3) {
|
|
|
12270
12272
|
variant: "body1",
|
|
12271
12273
|
style: {
|
|
12272
12274
|
marginTop: 14
|
|
12273
|
-
}
|
|
12275
|
+
},
|
|
12276
|
+
className: "stigg-checkout-summary-captions-scheduled-updates"
|
|
12274
12277
|
}, React__default.createElement(WithSkeleton, {
|
|
12275
12278
|
isLoading: isFetchingSubscriptionPreview,
|
|
12276
12279
|
width: "100%"
|
|
@@ -12334,7 +12337,8 @@ var NextBillingCaption = function NextBillingCaption(_ref4) {
|
|
|
12334
12337
|
variant: "body1",
|
|
12335
12338
|
style: {
|
|
12336
12339
|
marginTop: 14
|
|
12337
|
-
}
|
|
12340
|
+
},
|
|
12341
|
+
className: "stigg-checkout-summary-captions-next-billing"
|
|
12338
12342
|
}, React__default.createElement(WithSkeleton, {
|
|
12339
12343
|
isLoading: isFetchingSubscriptionPreview,
|
|
12340
12344
|
width: "100%"
|
|
@@ -12342,7 +12346,9 @@ var NextBillingCaption = function NextBillingCaption(_ref4) {
|
|
|
12342
12346
|
};
|
|
12343
12347
|
|
|
12344
12348
|
function CheckoutCaptions(props) {
|
|
12345
|
-
return React__default.createElement(
|
|
12349
|
+
return React__default.createElement(material.Box, {
|
|
12350
|
+
className: "stigg-checkout-summary-captions"
|
|
12351
|
+
}, React__default.createElement(RemainingCreditsCaption, Object.assign({}, props)), React__default.createElement(ScheduledUpdatesCaption, Object.assign({}, props)), React__default.createElement(NextBillingCaption, Object.assign({}, props)));
|
|
12346
12352
|
}
|
|
12347
12353
|
|
|
12348
12354
|
function formatPricePerUnit(_ref) {
|