@trafilea/afrodita-components 6.33.0 → 6.33.2

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
@@ -6766,7 +6766,7 @@ var ImageContainer$6 = newStyled.div(function (_a) {
6766
6766
  var ImageHoverContainer$3 = newStyled.img(templateObject_1$1v || (templateObject_1$1v = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n transition: all 0.4s ease-in-out;\n"], ["\n opacity: 0;\n position: absolute;\n transition: all 0.4s ease-in-out;\n"])));
6767
6767
  var Container$_ = newStyled.a(templateObject_2$18 || (templateObject_2$18 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n text-decoration: none;\n\n &:hover .hover__image {\n opacity: 1;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n text-decoration: none;\n\n &:hover .hover__image {\n opacity: 1;\n }\n"])));
6768
6768
  var ProdCardContainer$4 = newStyled.div(templateObject_3$U || (templateObject_3$U = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n"])));
6769
- var Title$7 = newStyled.p(templateObject_4$J || (templateObject_4$J = __makeTemplateObject(["\n font-size: ", ";\n font-weight: ", ";\n line-height: 1.375rem;\n min-height: 2.75rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n\n ", "\n\n @media (max-width: ", "px) {\n font-size: ", ";\n }\n"], ["\n font-size: ", ";\n font-weight: ", ";\n line-height: 1.375rem;\n min-height: 2.75rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n\n ", "\n\n @media (max-width: ", "px) {\n font-size: ", ";\n }\n"])), function (_a) {
6769
+ var Title$7 = newStyled.p(templateObject_4$J || (templateObject_4$J = __makeTemplateObject(["\n font-size: ", ";\n font-weight: ", ";\n line-height: 1.375rem;\n min-height: 2.75rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n\n ", "\n\n ", "\n\n @media (max-width: ", "px) {\n font-size: ", ";\n }\n"], ["\n font-size: ", ";\n font-weight: ", ";\n line-height: 1.375rem;\n min-height: 2.75rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n\n ", "\n\n ", "\n\n @media (max-width: ", "px) {\n font-size: ", ";\n }\n"])), function (_a) {
6770
6770
  var theme = _a.theme;
6771
6771
  return STYLES_BY_THEME[theme.name].title.fontSize;
6772
6772
  }, function (_a) {
@@ -6781,7 +6781,10 @@ var Title$7 = newStyled.p(templateObject_4$J || (templateObject_4$J = __makeTemp
6781
6781
  }, function (_a) {
6782
6782
  var theme = _a.theme;
6783
6783
  return ['Revel', 'TheSpaDr'].includes(theme.name) &&
6784
- "\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n max-width: 150px;\n ";
6784
+ "\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden; \n ";
6785
+ }, function (_a) {
6786
+ var theme = _a.theme;
6787
+ return theme.name === 'Revel' && "max-width: 150px;";
6785
6788
  }, function (_a) {
6786
6789
  var theme = _a.theme;
6787
6790
  return theme.mediaQueries.mobile;
@@ -21214,10 +21217,10 @@ var FlexContainer = newStyled.div(templateObject_1 || (templateObject_1 = __make
21214
21217
  "\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 ";
21215
21218
  });
21216
21219
  var DiscountTag = newStyled.div(templateObject_2 || (templateObject_2 = __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) {
21217
- var theme = _a.theme, isSelected = _a.isSelected;
21218
- return isSelected
21219
- ? theme.component.autoship.discountTag.backgroundColor
21220
- : theme.colors.shades[350].color;
21220
+ var theme = _a.theme, disabled = _a.disabled;
21221
+ return disabled
21222
+ ? theme.colors.shades[350].color
21223
+ : theme.component.autoship.discountTag.backgroundColor;
21221
21224
  }, function (_a) {
21222
21225
  var theme = _a.theme;
21223
21226
  return "".concat(theme.component.autoship.discountTag.borderRadius, " \n ").concat(theme.component.autoship.discountTag.borderRadius, " 0 0");
@@ -21230,13 +21233,13 @@ var getSelectedBorder = function (_a) {
21230
21233
  return "1.5px solid ".concat(colors.shades['700'].color);
21231
21234
  };
21232
21235
  var ContainerBase = newStyled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 8px;\n\n border: ", ";\n\n ", "\n\n & input:checked + div {\n border-color: ", ";\n }\n\n & label {\n cursor: pointer;\n }\n"], ["\n border-radius: 8px;\n\n border: ", ";\n\n ", "\n\n & input:checked + div {\n border-color: ", ";\n }\n\n & label {\n cursor: pointer;\n }\n"])), function (_a) {
21233
- var selected = _a.selected, theme = _a.theme;
21234
- return selected ? getSelectedBorder(theme) : "1px solid ".concat(theme.colors.shades[200].color);
21236
+ var disabled = _a.disabled, theme = _a.theme;
21237
+ return disabled ? "1px solid ".concat(theme.colors.shades[200].color) : getSelectedBorder(theme);
21235
21238
  }, function (_a) {
21236
- var selected = _a.selected;
21237
- return selected
21238
- ? "& label {\n font-weight: 700;\n }"
21239
- : '';
21239
+ var disabled = _a.disabled;
21240
+ return disabled
21241
+ ? ''
21242
+ : "& label {\n font-weight: 700;\n }";
21240
21243
  }, function (_a) {
21241
21244
  var theme = _a.theme;
21242
21245
  return theme.colors.pallete.primary.color;
@@ -21258,8 +21261,8 @@ var BenefitsContainer = newStyled.div(templateObject_7 || (templateObject_7 = __
21258
21261
  return (disabled ? 'var(--colors-shades-250-color)' : 'inherit');
21259
21262
  });
21260
21263
  var StyledPrice = newStyled(PriceLabelV2$1)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n div p {\n color: ", ";\n }\n"], ["\n div p {\n color: ", ";\n }\n"])), function (_a) {
21261
- var selected = _a.selected, theme = _a.theme;
21262
- return selected ? theme.colors.shades[700].color : theme.colors.shades[200].color;
21264
+ var disabled = _a.disabled, theme = _a.theme;
21265
+ return disabled ? theme.colors.shades[200].color : theme.colors.shades[700].color;
21263
21266
  });
21264
21267
  var Container = newStyled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-top: 20px;\n"], ["\n margin-top: 20px;\n"])));
21265
21268
  var TooltipWrapper = newStyled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n margin: ", ";\n"], ["\n margin: ", ";\n"])), function (_a) {
@@ -21323,7 +21326,7 @@ var SubscriptionPlanSelector = function (_a) {
21323
21326
  };
21324
21327
  var benefitsColor = benefitsColorMapper(theme);
21325
21328
  var renderBenefitsOrChildren = function () {
21326
- var isDisabled = radiosStatuses.subscription.disabled || !radiosStatuses.subscription.checked;
21329
+ var isDisabled = radiosStatuses.subscription.disabled;
21327
21330
  if (children) {
21328
21331
  var disabledStyle_1 = isDisabled ? { opacity: 0.5, pointerEvents: 'none' } : {};
21329
21332
  return React$2.Children.map(children, function (child) {
@@ -21338,17 +21341,17 @@ var SubscriptionPlanSelector = function (_a) {
21338
21341
  }
21339
21342
  return null;
21340
21343
  };
21341
- return (jsxRuntime.jsxs(Container, __assign$1({ className: className }, { children: [jsxRuntime.jsxs(SubscriptionContainer, __assign$1({ onClick: function () { return handleRadioClicked('subscription'); }, "data-testid": "subscription-purchase-block", selected: radiosStatuses.subscription.checked }, { children: [jsxRuntime.jsx(DiscountTag, __assign$1({ className: discountTagClassName, isSelected: 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, { 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 () {
21344
+ return (jsxRuntime.jsxs(Container, __assign$1({ className: className }, { children: [jsxRuntime.jsxs(SubscriptionContainer, __assign$1({ 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, { 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 () {
21342
21345
  setRadiosStatuses(function (prev) { return ({
21343
21346
  subscription: __assign$1(__assign$1({}, prev.subscription), { checked: true }),
21344
21347
  oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: false }),
21345
21348
  }); });
21346
- }, checked: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.checked, disabled: !radiosStatuses.subscription.checked }, void 0), jsxRuntime.jsx(TooltipWrapper, { children: jsxRuntime.jsx(Tooltip, __assign$1({ position: 0, content: tooltip === null || tooltip === void 0 ? void 0 : tooltip.content, header: tooltip === null || tooltip === void 0 ? void 0 : tooltip.header, maxWidth: "248px", showCloseIcon: closeIcon, closeBtnSize: 0.7 }, { children: jsxRuntime.jsx(Icon.Actions.CircleQuestion, { width: 1 }, void 0) }), void 0) }, void 0)] }), void 0), jsxRuntime.jsx(StyledPrice, { testId: "subscription", finalPrice: "$".concat(decimalFormat(Number(subscriptionFinalPrice))), selected: radiosStatuses.subscription.checked, size: exports.ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }, void 0), jsxRuntime.jsx(BenefitsContainer, __assign$1({ disabled: !radiosStatuses.subscription.checked }, { children: renderBenefitsOrChildren() }), void 0), radiosStatuses.subscription.checked && frequency && (jsxRuntime.jsx(AutoshipFrequencyDropdown, { frequency: frequency, onChange: handleFrequencyChange }, void 0))] }), void 0), jsxRuntime.jsxs(SinglePurchaseContainer, __assign$1({ "data-testid": "single-purchase-block", selected: radiosStatuses.oneTime.checked, onClick: function () { return handleRadioClicked('oneTime'); } }, { children: [jsxRuntime.jsx(RadioInput, { label: radios.oneTime.label, icon: radios.oneTime.icon, name: "oneTime", id: "oneTime", value: "oneTime", size: exports.ComponentSize.Medium, onChange: function () {
21349
+ }, checked: !radiosStatuses.subscription.disabled && radiosStatuses.subscription.checked, disabled: radiosStatuses.subscription.disabled }, void 0), jsxRuntime.jsx(TooltipWrapper, { children: jsxRuntime.jsx(Tooltip, __assign$1({ position: 0, content: tooltip === null || tooltip === void 0 ? void 0 : tooltip.content, header: tooltip === null || tooltip === void 0 ? void 0 : tooltip.header, maxWidth: "248px", showCloseIcon: closeIcon, closeBtnSize: 0.7 }, { children: jsxRuntime.jsx(Icon.Actions.CircleQuestion, { width: 1 }, void 0) }), void 0) }, void 0)] }), void 0), jsxRuntime.jsx(StyledPrice, { testId: "subscription", finalPrice: "$".concat(decimalFormat(Number(subscriptionFinalPrice))), disabled: radiosStatuses.subscription.disabled, size: exports.ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }, void 0), jsxRuntime.jsx(BenefitsContainer, __assign$1({ disabled: radiosStatuses.subscription.disabled }, { children: renderBenefitsOrChildren() }), void 0), radiosStatuses.subscription.checked && frequency && (jsxRuntime.jsx(AutoshipFrequencyDropdown, { frequency: frequency, onChange: handleFrequencyChange }, void 0))] }), void 0), jsxRuntime.jsxs(SinglePurchaseContainer, __assign$1({ "data-testid": "single-purchase-block", disabled: radiosStatuses.oneTime.disabled, onClick: function () { return handleRadioClicked('oneTime'); } }, { children: [jsxRuntime.jsx(RadioInput, { label: radios.oneTime.label, icon: radios.oneTime.icon, name: "oneTime", id: "oneTime", value: "oneTime", size: exports.ComponentSize.Medium, onChange: function () {
21347
21350
  setRadiosStatuses(function (prev) { return ({
21348
21351
  subscription: __assign$1(__assign$1({}, prev.subscription), { checked: false }),
21349
21352
  oneTime: __assign$1(__assign$1({}, prev.oneTime), { checked: true }),
21350
21353
  }); });
21351
- }, useV2Style: true, checked: !radiosStatuses.oneTime.disabled && radiosStatuses.oneTime.checked, disabled: radiosStatuses.oneTime.disabled }, void 0), jsxRuntime.jsx(StyledPrice, { testId: "single-purchase", finalPrice: "$".concat(decimalFormat(Number(discountedPrice))), selected: radiosStatuses.oneTime.checked, size: exports.ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0)] }), void 0));
21354
+ }, useV2Style: true, checked: !radiosStatuses.oneTime.disabled && radiosStatuses.oneTime.checked, disabled: radiosStatuses.oneTime.disabled }, void 0), jsxRuntime.jsx(StyledPrice, { testId: "single-purchase", finalPrice: "$".concat(decimalFormat(Number(discountedPrice))), disabled: radiosStatuses.oneTime.disabled, size: exports.ComponentSize.Large, originalPrice: "$".concat(decimalFormat(Number(listPrice))) }, void 0)] }), void 0)] }), void 0));
21352
21355
  };
21353
21356
 
21354
21357
  exports.AbsorbencyLevel = AbsorbencyLevel;