@trafilea/afrodita-components 5.0.0-beta.120 → 5.0.0-beta.122

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.js CHANGED
@@ -10758,7 +10758,7 @@ var Image$1 = function Image(_ref) {
10758
10758
  }), /*#__PURE__*/React__default["default"].createElement("img", _extends$1({}, imgAttributes, {
10759
10759
  className: "iiz__img " + (imgAttributes.className || '') + " " + (isZoomed ? 'iiz__img--hidden' : '') + " " + (createSpacer ? 'iiz__img--abs' : ''),
10760
10760
  style: {
10761
- transition: "linear 0ms opacity " + (isZoomed ? fadeDuration : 0) + "ms, linear " + fadeDuration + "ms visibility " + (isZoomed ? fadeDuration : 0) + "ms"
10761
+ transition: "opacity 0ms linear " + (isZoomed ? fadeDuration : 0) + "ms, visibility 0ms linear " + (isZoomed ? fadeDuration : 0) + "ms"
10762
10762
  },
10763
10763
  src: src,
10764
10764
  width: width,
@@ -10766,7 +10766,7 @@ var Image$1 = function Image(_ref) {
10766
10766
  }))) : /*#__PURE__*/React__default["default"].createElement("img", _extends$1({}, imgAttributes, {
10767
10767
  className: "iiz__img " + (imgAttributes.className || '') + " " + (isZoomed ? 'iiz__img--hidden' : '') + " " + (createSpacer ? 'iiz__img--abs' : ''),
10768
10768
  style: {
10769
- transition: "linear 0ms opacity " + (isZoomed ? fadeDuration : 0) + "ms, linear " + fadeDuration + "ms visibility " + (isZoomed ? fadeDuration : 0) + "ms"
10769
+ transition: "opacity 0ms linear " + (isZoomed ? fadeDuration : 0) + "ms, visibility 0ms linear " + (isZoomed ? fadeDuration : 0) + "ms"
10770
10770
  },
10771
10771
  src: src,
10772
10772
  width: width,
@@ -10801,7 +10801,7 @@ var ZoomImage = function ZoomImage(_ref) {
10801
10801
  style: {
10802
10802
  top: top,
10803
10803
  left: left,
10804
- transition: "linear " + fadeDuration + "ms opacity, linear " + fadeDuration + "ms visibility"
10804
+ transition: "opacity " + fadeDuration + "ms linear, visibility " + fadeDuration + "ms linear"
10805
10805
  },
10806
10806
  src: src,
10807
10807
  onLoad: onLoad,
@@ -10815,7 +10815,7 @@ var ZoomImage = function ZoomImage(_ref) {
10815
10815
  }), onClose && /*#__PURE__*/React__default["default"].createElement("button", {
10816
10816
  className: "iiz__btn iiz__close " + (isZoomed ? 'iiz__close--visible' : ''),
10817
10817
  style: {
10818
- transition: "linear " + fadeDuration + "ms opacity, linear " + fadeDuration + "ms visibility"
10818
+ transition: "opacity " + fadeDuration + "ms linear, visibility " + fadeDuration + "ms linear"
10819
10819
  },
10820
10820
  onClick: onClose,
10821
10821
  "aria-label": "Zoom Out"
@@ -10932,6 +10932,7 @@ var InnerImageZoom = function InnerImageZoom(_ref) {
10932
10932
 
10933
10933
  var handleMouseEnter = function handleMouseEnter(e) {
10934
10934
  setIsActive(true);
10935
+ setIsFading(false);
10935
10936
  zoomType === 'hover' && !isZoomed && handleClick(e);
10936
10937
  };
10937
10938
 
@@ -10944,7 +10945,7 @@ var InnerImageZoom = function InnerImageZoom(_ref) {
10944
10945
  var handleClick = function handleClick(e) {
10945
10946
  if (isZoomed) {
10946
10947
  if (isTouch) {
10947
- hideCloseButton && handleClose();
10948
+ hideCloseButton && handleClose(e);
10948
10949
  } else {
10949
10950
  !isValidDrag && zoomOut();
10950
10951
  }
@@ -10989,7 +10990,9 @@ var InnerImageZoom = function InnerImageZoom(_ref) {
10989
10990
  };
10990
10991
 
10991
10992
  var handleDragStart = function handleDragStart(e) {
10992
- imgProps.current.offsets = getOffsets(e.pageX || e.changedTouches[0].pageX, e.pageY || e.changedTouches[0].pageY, zoomImg.current.offsetLeft, zoomImg.current.offsetTop);
10993
+ var pageX = typeof e.pageX === 'number' ? e.pageX : e.changedTouches[0].pageX;
10994
+ var pageY = typeof e.pageY === 'number' ? e.pageY : e.changedTouches[0].pageY;
10995
+ imgProps.current.offsets = getOffsets(pageX, pageY, zoomImg.current.offsetLeft, zoomImg.current.offsetTop);
10993
10996
  setIsDragging(true);
10994
10997
 
10995
10998
  if (!isTouch) {
@@ -11002,8 +11005,10 @@ var InnerImageZoom = function InnerImageZoom(_ref) {
11002
11005
 
11003
11006
  var handleDragMove = React$2.useCallback(function (e) {
11004
11007
  e.stopPropagation();
11005
- var left = (e.pageX || e.changedTouches[0].pageX) - imgProps.current.offsets.x;
11006
- var top = (e.pageY || e.changedTouches[0].pageY) - imgProps.current.offsets.y;
11008
+ var pageX = typeof e.pageX === 'number' ? e.pageX : e.changedTouches[0].pageX;
11009
+ var pageY = typeof e.pageY === 'number' ? e.pageY : e.changedTouches[0].pageY;
11010
+ var left = pageX - imgProps.current.offsets.x;
11011
+ var top = pageY - imgProps.current.offsets.y;
11007
11012
  left = Math.max(Math.min(left, 0), (imgProps.current.scaledDimensions.width - imgProps.current.bounds.width) * -1);
11008
11013
  top = Math.max(Math.min(top, 0), (imgProps.current.scaledDimensions.height - imgProps.current.bounds.height) * -1);
11009
11014
  setLeft(left);
@@ -11021,14 +11026,16 @@ var InnerImageZoom = function InnerImageZoom(_ref) {
11021
11026
  };
11022
11027
 
11023
11028
  var handleMouseLeave = function handleMouseLeave(e) {
11024
- currentMoveType === 'drag' && isZoomed ? handleDragEnd(e) : handleClose();
11029
+ currentMoveType === 'drag' && isZoomed ? handleDragEnd(e) : handleClose(e);
11025
11030
  };
11026
11031
 
11027
- var handleClose = function handleClose() {
11028
- if (!isZoomed || isFullscreen || !fadeDuration) {
11029
- handleFadeOut({}, true);
11030
- } else {
11031
- setIsFading(true);
11032
+ var handleClose = function handleClose(e) {
11033
+ if (!(!isTouch && e.target.classList.contains('iiz__close'))) {
11034
+ if (!isZoomed || isFullscreen || !fadeDuration) {
11035
+ handleFadeOut({}, true);
11036
+ } else {
11037
+ setIsFading(true);
11038
+ }
11032
11039
  }
11033
11040
 
11034
11041
  zoomOut();
@@ -12423,7 +12430,7 @@ var KeepMeUpdated = newStyled.h1(templateObject_8$3 || (templateObject_8$3 = __m
12423
12430
  var DeliveryDetails = function (_a) {
12424
12431
  var deliveryDetailsText = _a.deliveryDetailsText, arrivingBy = _a.arrivingBy, shippingTo = _a.shippingTo, instantOrderUpdate = _a.instantOrderUpdate, note = _a.note;
12425
12432
  var theme = useTheme();
12426
- return (jsxRuntime.jsxs("div", __assign$1({ "data-testid": "DeliveryDetails" }, { children: [jsxRuntime.jsx(Title$4, __assign$1({ color: theme.colors.pallete.secondary.color }, { children: deliveryDetailsText }), void 0), jsxRuntime.jsx(Line, { backgroundColor: theme.colors.shades['100'].color }, void 0), note && jsxRuntime.jsx(Note, __assign$1({}, note), void 0), jsxRuntime.jsxs(Row$1, __assign$1({ "data-testid": "DD-row", theme: theme }, { children: [jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.PDP.Clock, {}, void 0) }), void 0), arrivingBy.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: arrivingBy.details }), void 0)] }), void 0), jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.Navigation.MapMarker, {}, void 0) }), void 0), shippingTo.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: shippingTo.details }), void 0)] }), void 0), jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.Messaging.Messenger, {}, void 0) }), void 0), instantOrderUpdate.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: instantOrderUpdate.details }), void 0), jsxRuntime.jsxs(KeepMeUpdated, __assign$1({ onClick: instantOrderUpdate.keepMeUpdated.onClick, borderColor: theme.colors.shades['150'].color }, { children: [jsxRuntime.jsx(Icon.Messaging.Messenger, { width: 1, height: 1, fill: "#0078FF" }, void 0), instantOrderUpdate.keepMeUpdated.title] }), void 0)] }), void 0)] }), void 0)] }), void 0));
12433
+ return (jsxRuntime.jsxs("div", __assign$1({ "data-testid": "DeliveryDetails" }, { children: [jsxRuntime.jsx(Title$4, __assign$1({ color: theme.colors.pallete.secondary.color }, { children: deliveryDetailsText }), void 0), jsxRuntime.jsx(Line, { backgroundColor: theme.colors.shades['100'].color }, void 0), note && jsxRuntime.jsx(Note, __assign$1({}, note), void 0), jsxRuntime.jsxs(Row$1, __assign$1({ "data-testid": "DD-row", theme: theme }, { children: [jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.PDP.Clock, {}, void 0) }), void 0), arrivingBy.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: arrivingBy.details }), void 0)] }), void 0), jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.Navigation.MapMarker, {}, void 0) }), void 0), shippingTo.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: shippingTo.details }), void 0)] }), void 0), jsxRuntime.jsxs(Col$1, __assign$1({ theme: theme }, { children: [jsxRuntime.jsxs(SectionTitle, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(IconContainer$2, __assign$1({ theme: theme }, { children: jsxRuntime.jsx(Icon.Messaging.Messenger, {}, void 0) }), void 0), instantOrderUpdate.title] }), void 0), jsxRuntime.jsx(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: instantOrderUpdate.details }), void 0), instantOrderUpdate.keepMeUpdated && (jsxRuntime.jsxs(KeepMeUpdated, __assign$1({ onClick: instantOrderUpdate.keepMeUpdated.onClick, borderColor: theme.colors.shades['150'].color }, { children: [jsxRuntime.jsx(Icon.Messaging.Messenger, { width: 1, height: 1, fill: "#0078FF" }, void 0), instantOrderUpdate.keepMeUpdated.title] }), void 0))] }), void 0)] }), void 0)] }), void 0));
12427
12434
  };
12428
12435
  var templateObject_1$H, templateObject_2$s, templateObject_3$o, templateObject_4$f, templateObject_5$a, templateObject_6$8, templateObject_7$4, templateObject_8$3;
12429
12436