@trafilea/afrodita-components 5.0.0-beta.239 → 5.0.0-beta.240

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 CHANGED
@@ -1208,17 +1208,16 @@ interface ProgressBarProps {
1208
1208
  declare const ProgressBar: ({ description, fillColor, widthAuto, percent, height, backgroundColor, borderRadius, }: ProgressBarProps) => JSX.Element;
1209
1209
 
1210
1210
  interface MotivatorProgressBarProps {
1211
- fillColor: string;
1211
+ fillColor?: string;
1212
1212
  currentAmount?: number;
1213
1213
  backgroundColor?: string;
1214
1214
  unfilledColor?: string;
1215
1215
  borderRadius?: string;
1216
1216
  rewardUnlockedMessage: string;
1217
- startingValue?: number;
1218
1217
  endingValue?: number;
1219
1218
  currencyCode?: string;
1220
1219
  }
1221
- declare const MotivatorProgressBar: ({ fillColor, backgroundColor, unfilledColor, currencyCode, startingValue, endingValue, currentAmount, rewardUnlockedMessage, }: MotivatorProgressBarProps) => JSX.Element;
1220
+ declare const MotivatorProgressBar: ({ fillColor, backgroundColor, unfilledColor, currencyCode, endingValue, currentAmount, rewardUnlockedMessage, }: MotivatorProgressBarProps) => JSX.Element;
1222
1221
 
1223
1222
  interface IconButtonProps {
1224
1223
  children: React.ReactNode;
@@ -11911,16 +11911,16 @@ var Value = newStyled.div(function (_a) {
11911
11911
  fontWeight: isBold ? 600 : 400,
11912
11912
  });
11913
11913
  });
11914
- var _calculatePercentage = function (currentAmount, startingValue, endingValue) {
11915
- var percentage = (currentAmount - startingValue) / (endingValue - startingValue);
11914
+ var _calculatePercentage = function (currentAmount, endingValue) {
11915
+ var percentage = currentAmount / endingValue;
11916
11916
  return percentage > 1 ? 100 : percentage * 100;
11917
11917
  };
11918
11918
  var MotivatorProgressBar = function (_a) {
11919
- var fillColor = _a.fillColor, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#F7F7F7' : _b, unfilledColor = _a.unfilledColor, _c = _a.currencyCode, currencyCode = _c === void 0 ? '$' : _c, _d = _a.startingValue, startingValue = _d === void 0 ? 10 : _d, _e = _a.endingValue, endingValue = _e === void 0 ? 70 : _e, _f = _a.currentAmount, currentAmount = _f === void 0 ? 0 : _f, rewardUnlockedMessage = _a.rewardUnlockedMessage;
11919
+ 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;
11920
11920
  var theme = useTheme();
11921
11921
  var isRewardUnlocked = currentAmount >= endingValue;
11922
- var progress = _calculatePercentage(currentAmount, startingValue, endingValue);
11923
- return (jsxs$1(Container$Q, __assign$1({ backgroundColor: backgroundColor }, { children: [jsxs$1(BarContainer$1, __assign$1({ "data-testid": "MPBContainer" }, { children: [jsxs$1(Value, { children: [currencyCode, startingValue] }, void 0), jsx$1(Background, __assign$1({ backgroundColor: unfilledColor || theme.colors.shades['100'].color, "data-testid": "MPBBackground" }, { children: jsx$1(Bar$1, { "data-testid": "MPBBar", backgroundColor: fillColor, percent: progress }, void 0) }), void 0), jsxs$1(Value, __assign$1({ isBold: true }, { children: [currencyCode, endingValue] }), void 0)] }), void 0), isRewardUnlocked ? (jsx$1("div", { dangerouslySetInnerHTML: { __html: rewardUnlockedMessage } }, void 0)) : (jsxs$1("div", { children: ["Spend ", currencyCode, Math.round((endingValue - currentAmount) * 100) / 100, " more to get", ' ', jsx$1("strong", { children: "Free Shipping" }, void 0)] }, void 0))] }), void 0));
11922
+ var progress = _calculatePercentage(currentAmount, endingValue);
11923
+ return (jsxs$1(Container$Q, __assign$1({ backgroundColor: backgroundColor }, { children: [jsxs$1(BarContainer$1, __assign$1({ "data-testid": "MPBContainer" }, { children: [jsxs$1(Value, { children: [currencyCode, Math.round(currentAmount)] }, void 0), jsx$1(Background, __assign$1({ backgroundColor: unfilledColor || theme.colors.shades['100'].color, "data-testid": "MPBBackground" }, { children: jsx$1(Bar$1, { "data-testid": "MPBBar", backgroundColor: fillColor, percent: progress }, void 0) }), void 0), jsxs$1(Value, __assign$1({ isBold: true }, { children: [currencyCode, endingValue] }), void 0)] }), void 0), isRewardUnlocked ? (jsx$1("div", { dangerouslySetInnerHTML: { __html: rewardUnlockedMessage } }, void 0)) : (jsxs$1("div", { children: ["Spend ", currencyCode, Math.round((endingValue - currentAmount) * 100) / 100, " more to get", ' ', jsx$1("strong", { children: "Free Shipping" }, void 0)] }, void 0))] }), void 0));
11924
11924
  };
11925
11925
  var templateObject_1$1b;
11926
11926
 
package/build/index.js CHANGED
@@ -11937,16 +11937,16 @@ var Value = newStyled.div(function (_a) {
11937
11937
  fontWeight: isBold ? 600 : 400,
11938
11938
  });
11939
11939
  });
11940
- var _calculatePercentage = function (currentAmount, startingValue, endingValue) {
11941
- var percentage = (currentAmount - startingValue) / (endingValue - startingValue);
11940
+ var _calculatePercentage = function (currentAmount, endingValue) {
11941
+ var percentage = currentAmount / endingValue;
11942
11942
  return percentage > 1 ? 100 : percentage * 100;
11943
11943
  };
11944
11944
  var MotivatorProgressBar = function (_a) {
11945
- var fillColor = _a.fillColor, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#F7F7F7' : _b, unfilledColor = _a.unfilledColor, _c = _a.currencyCode, currencyCode = _c === void 0 ? '$' : _c, _d = _a.startingValue, startingValue = _d === void 0 ? 10 : _d, _e = _a.endingValue, endingValue = _e === void 0 ? 70 : _e, _f = _a.currentAmount, currentAmount = _f === void 0 ? 0 : _f, rewardUnlockedMessage = _a.rewardUnlockedMessage;
11945
+ 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;
11946
11946
  var theme = useTheme();
11947
11947
  var isRewardUnlocked = currentAmount >= endingValue;
11948
- var progress = _calculatePercentage(currentAmount, startingValue, endingValue);
11949
- return (jsxRuntime.jsxs(Container$Q, __assign$1({ backgroundColor: backgroundColor }, { children: [jsxRuntime.jsxs(BarContainer$1, __assign$1({ "data-testid": "MPBContainer" }, { children: [jsxRuntime.jsxs(Value, { children: [currencyCode, startingValue] }, void 0), jsxRuntime.jsx(Background, __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)) : (jsxRuntime.jsxs("div", { children: ["Spend ", currencyCode, Math.round((endingValue - currentAmount) * 100) / 100, " more to get", ' ', jsxRuntime.jsx("strong", { children: "Free Shipping" }, void 0)] }, void 0))] }), void 0));
11948
+ var progress = _calculatePercentage(currentAmount, endingValue);
11949
+ return (jsxRuntime.jsxs(Container$Q, __assign$1({ backgroundColor: backgroundColor }, { children: [jsxRuntime.jsxs(BarContainer$1, __assign$1({ "data-testid": "MPBContainer" }, { children: [jsxRuntime.jsxs(Value, { children: [currencyCode, Math.round(currentAmount)] }, void 0), jsxRuntime.jsx(Background, __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)) : (jsxRuntime.jsxs("div", { children: ["Spend ", currencyCode, Math.round((endingValue - currentAmount) * 100) / 100, " more to get", ' ', jsxRuntime.jsx("strong", { children: "Free Shipping" }, void 0)] }, void 0))] }), void 0));
11950
11950
  };
11951
11951
  var templateObject_1$1b;
11952
11952
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "5.0.0-beta.239",
6
+ "version": "5.0.0-beta.240",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "style": "build/index.css",