@trafilea/afrodita-components 6.28.12 → 6.28.13
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 +9 -2
- package/build/index.esm.js.map +1 -1
- package/build/index.js +9 -2
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -14956,11 +14956,18 @@ var _calculatePercentage = function (currentAmount, endingValue) {
|
|
|
14956
14956
|
return percentage > 1 ? 100 : percentage * 100;
|
|
14957
14957
|
};
|
|
14958
14958
|
var MotivatorProgressBar = function (_a) {
|
|
14959
|
-
var _b = _a.fillColor, fillColor = _b === void 0 ? '#F7A08B' : _b, _c = _a.backgroundColor, backgroundColor = _c === void 0 ? '#F7F7F7' : _c, _d = _a.unfilledColor, unfilledColor = _d === void 0 ? '#EEBFBD' : _d, _e = _a.currencyCode, currencyCode = _e === void 0 ? '$' : _e, _f = _a.endingValue, endingValue = _f === void 0 ? 70 : _f, _g = _a.currentAmount, currentAmount = _g === void 0 ? 0 : _g, rewardUnlockedMessage = _a.rewardUnlockedMessage;
|
|
14959
|
+
var _b = _a.fillColor, fillColor = _b === void 0 ? '#F7A08B' : _b, _c = _a.backgroundColor, backgroundColor = _c === void 0 ? '#F7F7F7' : _c, _d = _a.unfilledColor, unfilledColor = _d === void 0 ? '#EEBFBD' : _d, _e = _a.currencyCode, currencyCode = _e === void 0 ? '$' : _e, _f = _a.endingValue, endingValue = _f === void 0 ? 70 : _f, _g = _a.currentAmount, currentAmount = _g === void 0 ? 0 : _g, rewardUnlockedMessage = _a.rewardUnlockedMessage, _h = _a.isClubBarMotivatorTest, isClubBarMotivatorTest = _h === void 0 ? false : _h;
|
|
14960
14960
|
var theme = useTheme();
|
|
14961
14961
|
var isRewardUnlocked = currentAmount >= endingValue;
|
|
14962
14962
|
var progress = _calculatePercentage(currentAmount, endingValue);
|
|
14963
|
-
|
|
14963
|
+
var getRemainingAmountMessage = function () {
|
|
14964
|
+
var remainingAmount = Math.round((endingValue - currentAmount) * 100) / 100;
|
|
14965
|
+
if (isClubBarMotivatorTest) {
|
|
14966
|
+
return (jsxRuntime.jsxs("div", { children: ["Spend ", currencyCode, remainingAmount, " more to unlock ", jsxRuntime.jsx("strong", { children: "Free Priority Shipping" }, void 0), " with Club!"] }, void 0));
|
|
14967
|
+
}
|
|
14968
|
+
return (jsxRuntime.jsxs("div", { children: ["Spend ", currencyCode, remainingAmount, " more to get ", jsxRuntime.jsx("strong", { children: "Free Shipping" }, void 0)] }, void 0));
|
|
14969
|
+
};
|
|
14970
|
+
return (jsxRuntime.jsxs(Container$y, __assign$1({ backgroundColor: backgroundColor }, { children: [jsxRuntime.jsxs(BarContainer, __assign$1({ "data-testid": "MPBContainer" }, { children: [jsxRuntime.jsxs(Value, { children: [currencyCode, currentAmount] }, void 0), jsxRuntime.jsx(Background$1, __assign$1({ backgroundColor: unfilledColor || theme.colors.shades['100'].color, "data-testid": "MPBBackground" }, { children: jsxRuntime.jsx(Bar$1, { "data-testid": "MPBBar", backgroundColor: fillColor, percent: progress }, void 0) }), void 0), jsxRuntime.jsxs(Value, __assign$1({ isBold: true }, { children: [currencyCode, endingValue] }), void 0)] }), void 0), isRewardUnlocked ? (jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: rewardUnlockedMessage } }, void 0)) : (getRemainingAmountMessage())] }), void 0));
|
|
14964
14971
|
};
|
|
14965
14972
|
var templateObject_1$K;
|
|
14966
14973
|
|