@trafilea/afrodita-components 6.43.9 → 6.43.10
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 +12 -4
- package/build/index.esm.js.map +1 -1
- package/build/index.js +12 -4
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1454,8 +1454,9 @@ interface BuyNowPayLaterProps {
|
|
|
1454
1454
|
iconColor?: string;
|
|
1455
1455
|
fontSize?: string;
|
|
1456
1456
|
bnplWithAfterPay?: boolean;
|
|
1457
|
+
textTemplate?: string;
|
|
1457
1458
|
}
|
|
1458
|
-
declare const BuyNowPayLater: ({ displayBNPL, installments, installmentPrice, iconFolder, iconName, showLogo, iconColor, fontSize, bnplWithAfterPay, }: BuyNowPayLaterProps) => JSX.Element | null;
|
|
1459
|
+
declare const BuyNowPayLater: ({ displayBNPL, installments, installmentPrice, iconFolder, iconName, showLogo, iconColor, fontSize, bnplWithAfterPay, textTemplate, }: BuyNowPayLaterProps) => JSX.Element | null;
|
|
1459
1460
|
|
|
1460
1461
|
interface CloseButtonProps {
|
|
1461
1462
|
onClick: () => void;
|
package/build/index.esm.js
CHANGED
|
@@ -6530,16 +6530,24 @@ var TextContainer$1 = newStyled.div(templateObject_2$1j || (templateObject_2$1j
|
|
|
6530
6530
|
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"])));
|
|
6531
6531
|
var BuyNowPayLater = function (_a) {
|
|
6532
6532
|
var _b;
|
|
6533
|
-
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;
|
|
6533
|
+
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;
|
|
6534
6534
|
// @ts-ignore
|
|
6535
6535
|
var IconComponent = (_b = Icon === null || Icon === void 0 ? void 0 : Icon[iconFolder]) === null || _b === void 0 ? void 0 : _b[iconName];
|
|
6536
6536
|
if (!IconComponent) {
|
|
6537
6537
|
console.error('Icon', iconName, 'not found');
|
|
6538
6538
|
return null;
|
|
6539
6539
|
}
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6540
|
+
var dynamicText = '';
|
|
6541
|
+
if (textTemplate) {
|
|
6542
|
+
dynamicText = "".concat(textTemplate.replace('{installments}', installments.toString()).trimEnd(), " ");
|
|
6543
|
+
}
|
|
6544
|
+
else if (!bnplWithAfterPay) {
|
|
6545
|
+
dynamicText = "Or ".concat(installments, " payments of ");
|
|
6546
|
+
}
|
|
6547
|
+
else {
|
|
6548
|
+
dynamicText = "or 4 interest-free payments of ";
|
|
6549
|
+
}
|
|
6550
|
+
return (jsx$1(Container$19, __assign$1({ displayBNPL: displayBNPL }, { children: jsxs$1(TextContainer$1, __assign$1({ style: { fontSize: fontSize }, "data-testid": "mainText" }, { children: [jsxs$1("div", { children: [dynamicText, jsx$1(Text$7, __assign$1({ variant: "body", weight: "bold", style: {
|
|
6543
6551
|
display: 'inline',
|
|
6544
6552
|
fontSize: fontSize,
|
|
6545
6553
|
paddingLeft: '0.25rem',
|