@trafilea/afrodita-components 6.21.5 → 6.21.7

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
@@ -2897,6 +2897,7 @@ declare type ModalProps = {
2897
2897
  dismissable?: boolean;
2898
2898
  maxFullScreen?: boolean;
2899
2899
  padding?: string;
2900
+ onClickOverlayHandler?: () => void;
2900
2901
  children: React__default.ReactNode;
2901
2902
  };
2902
2903
  interface ContainerProps {
@@ -3561,7 +3562,7 @@ declare type TimerProps = Partial<TimeProps> & {
3561
3562
  showHours?: boolean;
3562
3563
  timerColor?: string;
3563
3564
  countdown?: number;
3564
- template?: boolean;
3565
+ isCardsVersion?: boolean;
3565
3566
  };
3566
3567
  declare const Timer: React.FC<TimerProps>;
3567
3568
 
@@ -3656,9 +3657,9 @@ declare type HurryUpProps = {
3656
3657
  showTimer?: boolean;
3657
3658
  iconSize?: number;
3658
3659
  textPosition?: 'left' | 'right' | 'center';
3659
- clockPosition?: 'left' | 'right';
3660
+ clockPosition?: 'left' | 'right' | 'none';
3660
3661
  countdown?: number;
3661
- template?: boolean;
3662
+ isFullVersion?: boolean;
3662
3663
  hurryUpTextColor?: string;
3663
3664
  } & Partial<TimerProps>;
3664
3665
  declare const HurryUp: React__default.FC<HurryUpProps>;
@@ -14716,7 +14716,7 @@ var Container$y = newStyled.div(templateObject_5$f || (templateObject_5$f = __ma
14716
14716
  }), visibleStyle, transformStyle);
14717
14717
  var Overlay = newStyled.div(templateObject_6$e || (templateObject_6$e = __makeTemplateObject(["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n\n ", "\n"], ["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n\n ", "\n"])), visibleStyle);
14718
14718
  var Modal = function (_a) {
14719
- var id = _a.id, children = _a.children, _b = _a.dismissable, dismissable = _b === void 0 ? true : _b, _c = _a.maxFullScreen, maxFullScreen = _c === void 0 ? false : _c, padding = _a.padding;
14719
+ var id = _a.id, children = _a.children, _b = _a.dismissable, dismissable = _b === void 0 ? true : _b, _c = _a.maxFullScreen, maxFullScreen = _c === void 0 ? false : _c, padding = _a.padding, onClickOverlayHandler = _a.onClickOverlayHandler;
14720
14720
  var _d = useModal(id), opened = _d.opened, close = _d.close;
14721
14721
  var onDismiss = function () {
14722
14722
  if (!dismissable) {
@@ -14724,7 +14724,10 @@ var Modal = function (_a) {
14724
14724
  }
14725
14725
  close();
14726
14726
  };
14727
- return (jsxs(Portal, __assign$1({ id: id }, { children: [jsx(Container$y, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding }, { children: children }), void 0), jsx(Overlay, { opened: opened, onClick: onDismiss }, void 0)] }), void 0));
14727
+ return (jsxs(Portal, __assign$1({ id: id }, { children: [jsx(Container$y, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding }, { children: children }), void 0), jsx(Overlay, { opened: opened, onClick: function () {
14728
+ onClickOverlayHandler === null || onClickOverlayHandler === void 0 ? void 0 : onClickOverlayHandler();
14729
+ onDismiss();
14730
+ } }, void 0)] }), void 0));
14728
14731
  };
14729
14732
  var modalEvent = function (id, detail) {
14730
14733
  events.dispatchCustomEvent('modal', __assign$1({ id: id }, detail));
@@ -19931,7 +19934,7 @@ var secondsToTime = function (secs) {
19931
19934
  };
19932
19935
  var DEFAULT_TIME = { hours: 0, minutes: 0, seconds: 0 };
19933
19936
  var Timer = function (_a) {
19934
- 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"]);
19935
19938
  var _g = useState(countdown !== null && countdown !== void 0 ? countdown : timeToSeconds(__assign$1(__assign$1({}, DEFAULT_TIME), rest))), secs = _g[0], setSecs = _g[1];
19936
19939
  useEffect(function () {
19937
19940
  var timer = setInterval(function () {
@@ -19949,8 +19952,8 @@ var Timer = function (_a) {
19949
19952
  return function () { return clearInterval(timer); };
19950
19953
  }, [onTimeUp, secs]);
19951
19954
  var _h = secondsToTime(secs), hours = _h.hours, minutes = _h.minutes, seconds = _h.seconds;
19952
- if (template) {
19953
- 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 }, void 0)] }), "Hours")), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [(minutes || displayZeroValues) && "".concat(minutes), jsx$1(Unit, { children: MIN }, void 0)] }), "Minutes"), jsxs$1(UnitBlock, __assign$1({ variant: "body", weight: "bold" }, { children: [showSeconds && "".concat(seconds), jsx$1(Unit, { children: SEC }, void 0)] }), "Seconds")] }), void 0));
19954
19957
  }
19955
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));
19956
19959
  };
@@ -20142,9 +20145,9 @@ var getDefaultCountdown = function () {
20142
20145
  };
20143
20146
 
20144
20147
  var HurryUp = function (_a) {
20145
- 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"]);
20146
20149
  var theme = useTheme();
20147
- 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));
20148
20151
  };
20149
20152
 
20150
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) {