@trafilea/afrodita-components 6.21.6 → 6.21.8

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
@@ -3562,7 +3562,7 @@ declare type TimerProps = Partial<TimeProps> & {
3562
3562
  showHours?: boolean;
3563
3563
  timerColor?: string;
3564
3564
  countdown?: number;
3565
- template?: boolean;
3565
+ isCardsVersion?: boolean;
3566
3566
  };
3567
3567
  declare const Timer: React.FC<TimerProps>;
3568
3568
 
@@ -3657,9 +3657,9 @@ declare type HurryUpProps = {
3657
3657
  showTimer?: boolean;
3658
3658
  iconSize?: number;
3659
3659
  textPosition?: 'left' | 'right' | 'center';
3660
- clockPosition?: 'left' | 'right';
3660
+ clockPosition?: 'left' | 'right' | 'none';
3661
3661
  countdown?: number;
3662
- template?: boolean;
3662
+ isFullVersion?: boolean;
3663
3663
  hurryUpTextColor?: string;
3664
3664
  } & Partial<TimerProps>;
3665
3665
  declare const HurryUp: React__default.FC<HurryUpProps>;
@@ -19934,7 +19934,7 @@ var secondsToTime = function (secs) {
19934
19934
  };
19935
19935
  var DEFAULT_TIME = { hours: 0, minutes: 0, seconds: 0 };
19936
19936
  var Timer = function (_a) {
19937
- var onTimeUp = _a.onTimeUp, _b = _a.displayZeroValues, displayZeroValues = _b === void 0 ? false : _b, _c = _a.showSeconds, showSeconds = _c === void 0 ? true : _c, _d = _a.showHours, showHours = _d === void 0 ? true : _d, _e = _a.timerColor, timerColor = _e === void 0 ? '#292929' : _e, countdown = _a.countdown, _f = _a.template, template = _f === void 0 ? false : _f, rest = __rest(_a, ["onTimeUp", "displayZeroValues", "showSeconds", "showHours", "timerColor", "countdown", "template"]);
19937
+ var onTimeUp = _a.onTimeUp, _b = _a.displayZeroValues, displayZeroValues = _b === void 0 ? false : _b, _c = _a.showSeconds, showSeconds = _c === void 0 ? true : _c, _d = _a.showHours, showHours = _d === void 0 ? true : _d, _e = _a.timerColor, timerColor = _e === void 0 ? '#292929' : _e, countdown = _a.countdown, _f = _a.isCardsVersion, isCardsVersion = _f === void 0 ? false : _f, rest = __rest(_a, ["onTimeUp", "displayZeroValues", "showSeconds", "showHours", "timerColor", "countdown", "isCardsVersion"]);
19938
19938
  var _g = useState(countdown !== null && countdown !== void 0 ? countdown : timeToSeconds(__assign$1(__assign$1({}, DEFAULT_TIME), rest))), secs = _g[0], setSecs = _g[1];
19939
19939
  useEffect(function () {
19940
19940
  var timer = setInterval(function () {
@@ -19952,8 +19952,8 @@ var Timer = function (_a) {
19952
19952
  return function () { return clearInterval(timer); };
19953
19953
  }, [onTimeUp, secs]);
19954
19954
  var _h = secondsToTime(secs), hours = _h.hours, minutes = _h.minutes, seconds = _h.seconds;
19955
- if (template) {
19956
- return (jsxs$1(TimerContainerV2, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(hours || displayZeroValues) && "".concat(hours), jsx$1(Unit, { children: HRS }, void 0)] }), void 0)), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(minutes || displayZeroValues) && "".concat(minutes), jsx$1(Unit, { children: MIN }, void 0)] }), void 0), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [showSeconds && "".concat(seconds), jsx$1(Unit, { children: SEC }, void 0)] }), void 0)] }), void 0));
19955
+ if (isCardsVersion) {
19956
+ return (jsxs$1(TimerContainerV2, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(hours || displayZeroValues) && "".concat(hours), jsx$1(Unit, { children: HRS }, "HoursUnit")] }), "Hours")), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(minutes || displayZeroValues) && "".concat(minutes), jsx$1(Unit, { children: MIN }, "MinutesUnit")] }), "Minutes"), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [showSeconds && "".concat(seconds), jsx$1(Unit, { children: SEC }, "SecondsUnit")] }), "Seconds")] }), void 0));
19957
19957
  }
19958
19958
  return (jsxs$1(TimerContainer$1, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (hours || displayZeroValues) && "".concat(hours, "h "), (minutes || displayZeroValues) && "".concat(minutes, "m "), showSeconds && "".concat(seconds, "s")] }), void 0));
19959
19959
  };
@@ -20145,9 +20145,9 @@ var getDefaultCountdown = function () {
20145
20145
  };
20146
20146
 
20147
20147
  var HurryUp = function (_a) {
20148
- var hurryUpText = _a.hurryUpText, backgroundColor = _a.backgroundColor, _b = _a.iconSize, iconSize = _b === void 0 ? 1.5 : _b, _c = _a.textPosition, textPosition = _c === void 0 ? 'center' : _c, _d = _a.showTimer, showTimer = _d === void 0 ? false : _d, _e = _a.clockPosition, clockPosition = _e === void 0 ? 'left' : _e, _f = _a.countdown, countdown = _f === void 0 ? getDefaultCountdown() : _f, template = _a.template, hurryUpTextColor = _a.hurryUpTextColor, timerProps = __rest(_a, ["hurryUpText", "backgroundColor", "iconSize", "textPosition", "showTimer", "clockPosition", "countdown", "template", "hurryUpTextColor"]);
20148
+ var hurryUpText = _a.hurryUpText, backgroundColor = _a.backgroundColor, _b = _a.iconSize, iconSize = _b === void 0 ? 1.5 : _b, _c = _a.textPosition, textPosition = _c === void 0 ? 'center' : _c, _d = _a.showTimer, showTimer = _d === void 0 ? false : _d, _e = _a.clockPosition, clockPosition = _e === void 0 ? 'left' : _e, _f = _a.countdown, countdown = _f === void 0 ? getDefaultCountdown() : _f, isFullVersion = _a.isFullVersion, hurryUpTextColor = _a.hurryUpTextColor, timerProps = __rest(_a, ["hurryUpText", "backgroundColor", "iconSize", "textPosition", "showTimer", "clockPosition", "countdown", "isFullVersion", "hurryUpTextColor"]);
20149
20149
  var theme = useTheme();
20150
- return (jsxs$1(TimerContainer, __assign$1({ backgroundColor: backgroundColor || theme.component.card.backgroundColor, textPosition: textPosition, borderRadius: (!template && theme.component.hurryUp.borderRadius) || '0', "data-testid": "HurryUp" }, { children: [clockPosition === 'left' && (jsxs$1(Fragment$2, { children: [jsx$1(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), jsx$1(Text$7, __assign$1({ testId: "HurryUpText", variant: "body", size: "small", weight: "demi", color: hurryUpTextColor }, { children: hurryUpText }), void 0), "\u00A0", clockPosition === 'right' && (jsxs$1(Fragment$2, { children: [jsx$1(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), showTimer && (jsx$1(Timer, __assign$1({ countdown: countdown, onTimeUp: function () { } }, timerProps, { template: template }), void 0))] }), void 0));
20150
+ return (jsxs$1(TimerContainer, __assign$1({ backgroundColor: backgroundColor || theme.component.card.backgroundColor, textPosition: textPosition, borderRadius: (!isFullVersion && theme.component.hurryUp.borderRadius) || '0', "data-testid": "HurryUp" }, { children: [clockPosition === 'left' && (jsxs$1(Fragment$2, { children: [jsx$1(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), jsx$1(Text$7, __assign$1({ testId: "HurryUpText", variant: "body", size: "small", weight: "demi", color: hurryUpTextColor }, { children: hurryUpText }), void 0), "\u00A0", clockPosition === 'right' && (jsxs$1(Fragment$2, { children: [jsx$1(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), showTimer && (jsx$1(Timer, __assign$1({ countdown: countdown, onTimeUp: function () { } }, timerProps, { isCardsVersion: isFullVersion }), void 0))] }), void 0));
20151
20151
  };
20152
20152
 
20153
20153
  var Container$5 = newStyled.div(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n svg {\n vertical-align: unset;\n }\n"], ["\n width: ", ";\n height: ", ";\n svg {\n vertical-align: unset;\n }\n"])), function (_a) {
package/build/index.js CHANGED
@@ -19960,7 +19960,7 @@ var secondsToTime = function (secs) {
19960
19960
  };
19961
19961
  var DEFAULT_TIME = { hours: 0, minutes: 0, seconds: 0 };
19962
19962
  var Timer = function (_a) {
19963
- var onTimeUp = _a.onTimeUp, _b = _a.displayZeroValues, displayZeroValues = _b === void 0 ? false : _b, _c = _a.showSeconds, showSeconds = _c === void 0 ? true : _c, _d = _a.showHours, showHours = _d === void 0 ? true : _d, _e = _a.timerColor, timerColor = _e === void 0 ? '#292929' : _e, countdown = _a.countdown, _f = _a.template, template = _f === void 0 ? false : _f, rest = __rest(_a, ["onTimeUp", "displayZeroValues", "showSeconds", "showHours", "timerColor", "countdown", "template"]);
19963
+ var onTimeUp = _a.onTimeUp, _b = _a.displayZeroValues, displayZeroValues = _b === void 0 ? false : _b, _c = _a.showSeconds, showSeconds = _c === void 0 ? true : _c, _d = _a.showHours, showHours = _d === void 0 ? true : _d, _e = _a.timerColor, timerColor = _e === void 0 ? '#292929' : _e, countdown = _a.countdown, _f = _a.isCardsVersion, isCardsVersion = _f === void 0 ? false : _f, rest = __rest(_a, ["onTimeUp", "displayZeroValues", "showSeconds", "showHours", "timerColor", "countdown", "isCardsVersion"]);
19964
19964
  var _g = React$2.useState(countdown !== null && countdown !== void 0 ? countdown : timeToSeconds(__assign$1(__assign$1({}, DEFAULT_TIME), rest))), secs = _g[0], setSecs = _g[1];
19965
19965
  React$2.useEffect(function () {
19966
19966
  var timer = setInterval(function () {
@@ -19978,8 +19978,8 @@ var Timer = function (_a) {
19978
19978
  return function () { return clearInterval(timer); };
19979
19979
  }, [onTimeUp, secs]);
19980
19980
  var _h = secondsToTime(secs), hours = _h.hours, minutes = _h.minutes, seconds = _h.seconds;
19981
- if (template) {
19982
- return (jsxRuntime.jsxs(TimerContainerV2, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(hours || displayZeroValues) && "".concat(hours), jsxRuntime.jsx(Unit, { children: HRS }, void 0)] }), void 0)), jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(minutes || displayZeroValues) && "".concat(minutes), jsxRuntime.jsx(Unit, { children: MIN }, void 0)] }), void 0), jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [showSeconds && "".concat(seconds), jsxRuntime.jsx(Unit, { children: SEC }, void 0)] }), void 0)] }), void 0));
19981
+ if (isCardsVersion) {
19982
+ return (jsxRuntime.jsxs(TimerContainerV2, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(hours || displayZeroValues) && "".concat(hours), jsxRuntime.jsx(Unit, { children: HRS }, "HoursUnit")] }), "Hours")), jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(minutes || displayZeroValues) && "".concat(minutes), jsxRuntime.jsx(Unit, { children: MIN }, "MinutesUnit")] }), "Minutes"), jsxRuntime.jsxs(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [showSeconds && "".concat(seconds), jsxRuntime.jsx(Unit, { children: SEC }, "SecondsUnit")] }), "Seconds")] }), void 0));
19983
19983
  }
19984
19984
  return (jsxRuntime.jsxs(TimerContainer$1, __assign$1({ "data-testid": "Time", timerColor: timerColor }, { children: [showHours && (hours || displayZeroValues) && "".concat(hours, "h "), (minutes || displayZeroValues) && "".concat(minutes, "m "), showSeconds && "".concat(seconds, "s")] }), void 0));
19985
19985
  };
@@ -20171,9 +20171,9 @@ var getDefaultCountdown = function () {
20171
20171
  };
20172
20172
 
20173
20173
  var HurryUp = function (_a) {
20174
- var hurryUpText = _a.hurryUpText, backgroundColor = _a.backgroundColor, _b = _a.iconSize, iconSize = _b === void 0 ? 1.5 : _b, _c = _a.textPosition, textPosition = _c === void 0 ? 'center' : _c, _d = _a.showTimer, showTimer = _d === void 0 ? false : _d, _e = _a.clockPosition, clockPosition = _e === void 0 ? 'left' : _e, _f = _a.countdown, countdown = _f === void 0 ? getDefaultCountdown() : _f, template = _a.template, hurryUpTextColor = _a.hurryUpTextColor, timerProps = __rest(_a, ["hurryUpText", "backgroundColor", "iconSize", "textPosition", "showTimer", "clockPosition", "countdown", "template", "hurryUpTextColor"]);
20174
+ var hurryUpText = _a.hurryUpText, backgroundColor = _a.backgroundColor, _b = _a.iconSize, iconSize = _b === void 0 ? 1.5 : _b, _c = _a.textPosition, textPosition = _c === void 0 ? 'center' : _c, _d = _a.showTimer, showTimer = _d === void 0 ? false : _d, _e = _a.clockPosition, clockPosition = _e === void 0 ? 'left' : _e, _f = _a.countdown, countdown = _f === void 0 ? getDefaultCountdown() : _f, isFullVersion = _a.isFullVersion, hurryUpTextColor = _a.hurryUpTextColor, timerProps = __rest(_a, ["hurryUpText", "backgroundColor", "iconSize", "textPosition", "showTimer", "clockPosition", "countdown", "isFullVersion", "hurryUpTextColor"]);
20175
20175
  var theme = useTheme();
20176
- return (jsxRuntime.jsxs(TimerContainer, __assign$1({ backgroundColor: backgroundColor || theme.component.card.backgroundColor, textPosition: textPosition, borderRadius: (!template && theme.component.hurryUp.borderRadius) || '0', "data-testid": "HurryUp" }, { children: [clockPosition === 'left' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), jsxRuntime.jsx(Text$7, __assign$1({ testId: "HurryUpText", variant: "body", size: "small", weight: "demi", color: hurryUpTextColor }, { children: hurryUpText }), void 0), "\u00A0", clockPosition === 'right' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), showTimer && (jsxRuntime.jsx(Timer, __assign$1({ countdown: countdown, onTimeUp: function () { } }, timerProps, { template: template }), void 0))] }), void 0));
20176
+ return (jsxRuntime.jsxs(TimerContainer, __assign$1({ backgroundColor: backgroundColor || theme.component.card.backgroundColor, textPosition: textPosition, borderRadius: (!isFullVersion && theme.component.hurryUp.borderRadius) || '0', "data-testid": "HurryUp" }, { children: [clockPosition === 'left' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), jsxRuntime.jsx(Text$7, __assign$1({ testId: "HurryUpText", variant: "body", size: "small", weight: "demi", color: hurryUpTextColor }, { children: hurryUpText }), void 0), "\u00A0", clockPosition === 'right' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon.PDP.Stopwatch, { width: iconSize, height: iconSize, fill: theme.colors.pallete.secondary.color }, void 0), "\u00A0"] }, void 0)), showTimer && (jsxRuntime.jsx(Timer, __assign$1({ countdown: countdown, onTimeUp: function () { } }, timerProps, { isCardsVersion: isFullVersion }), void 0))] }), void 0));
20177
20177
  };
20178
20178
 
20179
20179
  var Container$5 = newStyled.div(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n svg {\n vertical-align: unset;\n }\n"], ["\n width: ", ";\n height: ", ";\n svg {\n vertical-align: unset;\n }\n"])), function (_a) {
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": "6.21.6",
6
+ "version": "6.21.8",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "style": "build/index.css",