@trafilea/afrodita-components 6.43.7 → 6.43.9

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
@@ -21564,7 +21564,7 @@ var Container$5 = newStyled.div({
21564
21564
  width: '100vw',
21565
21565
  position: 'fixed',
21566
21566
  overflowY: 'scroll',
21567
- zIndex: '99999',
21567
+ zIndex: '99999999999',
21568
21568
  top: 0,
21569
21569
  left: 0,
21570
21570
  display: 'flex',
@@ -21635,13 +21635,19 @@ var GalleryDetailed = function (_a) {
21635
21635
  };
21636
21636
 
21637
21637
  var ProductGalleryMobileV4 = function (_a) {
21638
- var images = _a.images, customClick = _a.customClick, topTag = _a.topTag, topRightTag = _a.topRightTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, _c = _a.selectedValue, selectedValue = _c === void 0 ? 0 : _c, _d = _a.itemsOnViewport, itemsOnViewport = _d === void 0 ? 1 : _d;
21638
+ var images = _a.images, customClick = _a.customClick, topTag = _a.topTag, topRightTag = _a.topRightTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, _c = _a.selectedIndex, selectedIndex = _c === void 0 ? 0 : _c, selectedValue = _a.selectedValue, _d = _a.itemsOnViewport, itemsOnViewport = _d === void 0 ? 1 : _d;
21639
21639
  var containerRef = React$2.useRef(null);
21640
- var _e = React$2.useState(selectedValue), selectedImageIndex = _e[0], setSelectedImageIndex = _e[1];
21640
+ var _e = React$2.useState(selectedIndex), selectedImageIndex = _e[0], setSelectedImageIndex = _e[1];
21641
21641
  var _f = React$2.useState(false), galleryOpened = _f[0], setGalleryOpened = _f[1];
21642
21642
  React$2.useEffect(function () {
21643
- setSelectedImageIndex(selectedValue);
21644
- }, [selectedValue]);
21643
+ if (selectedIndex) {
21644
+ setSelectedImageIndex(selectedIndex);
21645
+ }
21646
+ else if (selectedValue) {
21647
+ var actualIndex = images.findIndex(function (el) { return el.key === selectedValue.key; });
21648
+ setSelectedImageIndex(actualIndex);
21649
+ }
21650
+ }, [selectedIndex, selectedValue, images]);
21645
21651
  React$2.useEffect(function () {
21646
21652
  var body = document.querySelector('body');
21647
21653
  if (!body) {
@@ -21914,10 +21920,10 @@ var FlexContainer = newStyled.div(templateObject_1$1 || (templateObject_1$1 = __
21914
21920
  "\n [data-testid='subscription-frequency'] {\n border: 0;\n padding-left: 0 !important;\n padding-right: 32px !important;\n }\n\n [role='listbox']{\n margin-left: -20px;\n }\n ";
21915
21921
  });
21916
21922
  var DiscountTag = newStyled.div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: absolute;\n top: -24px;\n right: 18px;\n background-color: ", ";\n color: white;\n padding: 5px 10px;\n font-size: 12px;\n font-weight: bold;\n line-height: 14px;\n border-radius: ", ";\n"], ["\n position: absolute;\n top: -24px;\n right: 18px;\n background-color: ", ";\n color: white;\n padding: 5px 10px;\n font-size: 12px;\n font-weight: bold;\n line-height: 14px;\n border-radius: ", ";\n"])), function (_a) {
21917
- var theme = _a.theme, disabled = _a.disabled;
21918
- return disabled
21919
- ? theme.colors.shades[350].color
21920
- : theme.component.autoship.discountTag.backgroundColor;
21923
+ var theme = _a.theme, selected = _a.selected;
21924
+ return selected
21925
+ ? theme.component.autoship.discountTag.backgroundColor
21926
+ : theme.colors.shades[350].color;
21921
21927
  }, function (_a) {
21922
21928
  var theme = _a.theme;
21923
21929
  return "".concat(theme.component.autoship.discountTag.borderRadius, " \n ").concat(theme.component.autoship.discountTag.borderRadius, " 0 0");
@@ -22052,7 +22058,7 @@ var SubscriptionPlanSelector = function (_a) {
22052
22058
  }
22053
22059
  return null;
22054
22060
  };
22055
- return (jsxRuntime.jsxs(Container$1, __assign$1({ className: className }, { children: [jsxRuntime.jsxs(SubscriptionContainer, __assign$1({ highlighted: radiosStatuses.subscription.checked, onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", disabled: radiosStatuses.subscription.disabled }, { children: [jsxRuntime.jsx(DiscountTag, __assign$1({ className: discountTagClassName, disabled: radiosStatuses.subscription.disabled }, { children: discountLabel !== null && discountLabel !== void 0 ? discountLabel : "".concat(subscriptionPctOverListPriceRounded, "% OFF - SAVE ").concat(currencySymbol).concat(subscriptionSaving.toFixed(2)) }), void 0), jsxRuntime.jsxs(SubscriptionHeader, __assign$1({ showBorder: radiosStatuses.subscription.checked }, { children: [jsxRuntime.jsxs(FlexContainer, __assign$1({ "data-testid": "subscription-block", onClick: function () { return handleRadioClicked('subscription'); } }, { children: [jsxRuntime.jsx(RadioInput, { label: radios.subscription.label, icon: radios.subscription.icon, name: "subscription", id: "subscription", value: "subscription", size: exports.ComponentSize.Medium, style: { marginRight: '10px' }, useV2Style: true, onChange: function () {
22061
+ return (jsxRuntime.jsxs(Container$1, __assign$1({ className: className }, { children: [jsxRuntime.jsxs(SubscriptionContainer, __assign$1({ highlighted: radiosStatuses.subscription.checked, onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", disabled: radiosStatuses.subscription.disabled }, { children: [jsxRuntime.jsx(DiscountTag, __assign$1({ className: discountTagClassName, selected: radiosStatuses.subscription.checked }, { children: discountLabel !== null && discountLabel !== void 0 ? discountLabel : "".concat(subscriptionPctOverListPriceRounded, "% OFF - SAVE ").concat(currencySymbol).concat(subscriptionSaving.toFixed(2)) }), void 0), jsxRuntime.jsxs(SubscriptionHeader, __assign$1({ showBorder: radiosStatuses.subscription.checked }, { children: [jsxRuntime.jsxs(FlexContainer, __assign$1({ "data-testid": "subscription-block", onClick: function () { return handleRadioClicked('subscription'); } }, { children: [jsxRuntime.jsx(RadioInput, { label: radios.subscription.label, icon: radios.subscription.icon, name: "subscription", id: "subscription", value: "subscription", size: exports.ComponentSize.Medium, style: { marginRight: '10px' }, useV2Style: true, onChange: function () {
22056
22062
  setRadiosStatuses(function (prev) { return ({
22057
22063
  subscription: __assign$1(__assign$1({}, prev.subscription), { checked: true }),
22058
22064
  oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: false }),