@trafilea/afrodita-components 6.43.9 → 6.43.11
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/build/index.d.ts +2 -1
- package/build/index.esm.js +18 -15
- package/build/index.esm.js.map +1 -1
- package/build/index.js +18 -15
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -3151,15 +3151,10 @@ var formatPrice = function (value, _a) {
|
|
|
3151
3151
|
currency: currency,
|
|
3152
3152
|
maximumFractionDigits: 3,
|
|
3153
3153
|
}).format(valueToFormat);
|
|
3154
|
-
if (currency === 'NZD') {
|
|
3155
|
-
// intlFormat does not support NZD$ currency format
|
|
3156
|
-
var resultOverridden = result.replace('NZ$', 'NZD$');
|
|
3157
|
-
return resultOverridden;
|
|
3158
|
-
}
|
|
3159
3154
|
if (currency === 'SGD') {
|
|
3160
3155
|
// intlFormat does not support singapure currency
|
|
3161
3156
|
var onlyValue = result.slice(result.indexOf('SGD') + 4);
|
|
3162
|
-
var resultOverridden = "
|
|
3157
|
+
var resultOverridden = "S$".concat(onlyValue);
|
|
3163
3158
|
return resultOverridden;
|
|
3164
3159
|
}
|
|
3165
3160
|
return result;
|
|
@@ -3508,7 +3503,7 @@ var PriceLabelV2$1 = function (_a) {
|
|
|
3508
3503
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3509
3504
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
3510
3505
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
3511
|
-
var supportedCurrencies = ['AU$', 'CA$', '£', '
|
|
3506
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZ$', 'S$'];
|
|
3512
3507
|
var currencySymbol = '$';
|
|
3513
3508
|
if (typeof productFinalPrice === 'string') {
|
|
3514
3509
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3580,7 +3575,7 @@ var PriceLabelV3 = function (_a) {
|
|
|
3580
3575
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3581
3576
|
var isDiscount = discount && isDiffFinalAndOriginalPrice;
|
|
3582
3577
|
var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
|
|
3583
|
-
var supportedCurrencies = ['AU$', 'CA$', '£', '
|
|
3578
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZ$', 'S$'];
|
|
3584
3579
|
var currencySymbol = '$';
|
|
3585
3580
|
if (typeof finalPrice === 'string') {
|
|
3586
3581
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3651,7 +3646,7 @@ var PriceLabel = function (_a) {
|
|
|
3651
3646
|
var theme = useTheme();
|
|
3652
3647
|
var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
|
|
3653
3648
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3654
|
-
var supportedCurrencies = ['AU$', 'CA$', '£', '
|
|
3649
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZ$', 'S$'];
|
|
3655
3650
|
var currencySymbol = '$';
|
|
3656
3651
|
if (typeof finalPrice === 'string') {
|
|
3657
3652
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -3687,7 +3682,7 @@ var PriceLabelV2 = function (_a) {
|
|
|
3687
3682
|
var theme = useTheme();
|
|
3688
3683
|
var isDiffFinalAndOriginalPrice = originalPrice !== finalPrice;
|
|
3689
3684
|
var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
|
|
3690
|
-
var supportedCurrencies = ['AU$', 'CA$', '£', '
|
|
3685
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZ$', 'S$'];
|
|
3691
3686
|
var currencySymbol = '$';
|
|
3692
3687
|
if (typeof finalPrice === 'string') {
|
|
3693
3688
|
supportedCurrencies.forEach(function (availableCurrency) {
|
|
@@ -6556,16 +6551,24 @@ var TextContainer$1 = newStyled.div(templateObject_2$1j || (templateObject_2$1j
|
|
|
6556
6551
|
var IconWrapper$1 = newStyled.div(templateObject_3$11 || (templateObject_3$11 = __makeTemplateObject(["\n display: inline;\n top: -1px;\n position: relative;\n\n svg {\n vertical-align: -webkit-baseline-middle;\n }\n"], ["\n display: inline;\n top: -1px;\n position: relative;\n\n svg {\n vertical-align: -webkit-baseline-middle;\n }\n"])));
|
|
6557
6552
|
var BuyNowPayLater = function (_a) {
|
|
6558
6553
|
var _b;
|
|
6559
|
-
var displayBNPL = _a.displayBNPL, installments = _a.installments, installmentPrice = _a.installmentPrice, _c = _a.iconFolder, iconFolder = _c === void 0 ? 'PDP' : _c, iconName = _a.iconName, _d = _a.showLogo, showLogo = _d === void 0 ? true : _d, _e = _a.iconColor, iconColor = _e === void 0 ? '#292929' : _e, fontSize = _a.fontSize, _f = _a.bnplWithAfterPay, bnplWithAfterPay = _f === void 0 ? false : _f;
|
|
6554
|
+
var displayBNPL = _a.displayBNPL, installments = _a.installments, installmentPrice = _a.installmentPrice, _c = _a.iconFolder, iconFolder = _c === void 0 ? 'PDP' : _c, iconName = _a.iconName, _d = _a.showLogo, showLogo = _d === void 0 ? true : _d, _e = _a.iconColor, iconColor = _e === void 0 ? '#292929' : _e, fontSize = _a.fontSize, _f = _a.bnplWithAfterPay, bnplWithAfterPay = _f === void 0 ? false : _f, textTemplate = _a.textTemplate;
|
|
6560
6555
|
// @ts-ignore
|
|
6561
6556
|
var IconComponent = (_b = Icon === null || Icon === void 0 ? void 0 : Icon[iconFolder]) === null || _b === void 0 ? void 0 : _b[iconName];
|
|
6562
6557
|
if (!IconComponent) {
|
|
6563
6558
|
console.error('Icon', iconName, 'not found');
|
|
6564
6559
|
return null;
|
|
6565
6560
|
}
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6561
|
+
var dynamicText = '';
|
|
6562
|
+
if (textTemplate) {
|
|
6563
|
+
dynamicText = "".concat(textTemplate.replace('{installments}', installments.toString()).trimEnd(), " ");
|
|
6564
|
+
}
|
|
6565
|
+
else if (!bnplWithAfterPay) {
|
|
6566
|
+
dynamicText = "Or ".concat(installments, " payments of ");
|
|
6567
|
+
}
|
|
6568
|
+
else {
|
|
6569
|
+
dynamicText = "or 4 interest-free payments of ";
|
|
6570
|
+
}
|
|
6571
|
+
return (jsxRuntime.jsx(Container$19, __assign$1({ displayBNPL: displayBNPL }, { children: jsxRuntime.jsxs(TextContainer$1, __assign$1({ style: { fontSize: fontSize }, "data-testid": "mainText" }, { children: [jsxRuntime.jsxs("div", { children: [dynamicText, jsxRuntime.jsx(Text$7, __assign$1({ variant: "body", weight: "bold", style: {
|
|
6569
6572
|
display: 'inline',
|
|
6570
6573
|
fontSize: fontSize,
|
|
6571
6574
|
paddingLeft: '0.25rem',
|
|
@@ -7024,7 +7027,7 @@ var PriceLabelV4 = function (_a) {
|
|
|
7024
7027
|
var theme = useTheme();
|
|
7025
7028
|
var isMobile = useWindowDimensions().isMobile;
|
|
7026
7029
|
var productFinalPrice = clubPrice;
|
|
7027
|
-
var supportedCurrencies = ['AU$', 'CA$', '£', '
|
|
7030
|
+
var supportedCurrencies = ['AU$', 'CA$', '£', 'NZ$', 'S$'];
|
|
7028
7031
|
var currencySymbol = '$';
|
|
7029
7032
|
if (typeof productFinalPrice === 'string') {
|
|
7030
7033
|
supportedCurrencies.forEach(function (availableCurrency) {
|