@trafilea/afrodita-components 6.57.6 → 6.58.1

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
@@ -2476,6 +2476,7 @@ interface CheckboxProps {
2476
2476
  blockUncheck?: boolean;
2477
2477
  id: string;
2478
2478
  backgroundColor?: string;
2479
+ backgroundImage?: string;
2479
2480
  variant: 'primary' | 'secondary' | 'color';
2480
2481
  }
2481
2482
  declare const Checkbox: react__default.FC<CheckboxProps>;
@@ -2672,6 +2673,7 @@ declare type Filter = {
2672
2673
  link?: string;
2673
2674
  blockUncheck?: boolean;
2674
2675
  value?: string;
2676
+ backgroundImage?: string;
2675
2677
  }>;
2676
2678
  showInMobile: boolean;
2677
2679
  showInTablet: boolean;
@@ -3279,6 +3281,7 @@ declare type ModalProps = {
3279
3281
  width?: string;
3280
3282
  initialTop?: string;
3281
3283
  countryRedirModalWithCoupon?: boolean;
3284
+ className?: string;
3282
3285
  };
3283
3286
  interface ContainerProps {
3284
3287
  maxFullScreen: boolean;
@@ -6031,8 +6031,10 @@ var Container$1q = newStyled.div(templateObject_1$2g || (templateObject_1$2g = _
6031
6031
  var CustomCheckbox = newStyled.div(CustomCheckboxStyles.baseStyles, function (props) { return [
6032
6032
  CustomCheckboxStyles[props.size](props.theme),
6033
6033
  CustomCheckboxStyles[props.variant](props.theme, props.isChecked, props.disabled),
6034
- "\n ".concat(props.backgroundColor ? "background-color: ".concat(props.backgroundColor, ";") : '', "\n ").concat(props.text === 'White' ||
6035
- props.text === 'Nude' ||
6034
+ "\n ".concat(props.backgroundImage
6035
+ ? "\n background-image: url(".concat(props.backgroundImage, ");\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n ")
6036
+ : '', "\n ").concat(props.backgroundColor ? "background-color: ".concat(props.backgroundColor, ";") : '', "\n ").concat(props.text === 'White' ||
6037
+ props.text === 'Beige' ||
6036
6038
  props.text === 'Latte' ||
6037
6039
  props.text === 'Sand'
6038
6040
  ? "\n svg {\n path {\n fill: var(--colors-shades-black-color);\n }\n }"
@@ -6043,7 +6045,7 @@ var Input$5 = newStyled.input(templateObject_2$1G || (templateObject_2$1G = __ma
6043
6045
  return (disabled ? 'not-allowed' : 'pointer');
6044
6046
  });
6045
6047
  var Checkbox = function (_a) {
6046
- var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.sizeLabel, sizeLabel = _d === void 0 ? ComponentSize.Medium : _d, colorLabel = _a.colorLabel, text = _a.text, _e = _a.checked, checked = _e === void 0 ? false : _e, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor;
6048
+ var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.sizeLabel, sizeLabel = _d === void 0 ? ComponentSize.Medium : _d, colorLabel = _a.colorLabel, text = _a.text, _e = _a.checked, checked = _e === void 0 ? false : _e, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor, backgroundImage = _a.backgroundImage;
6047
6049
  var theme = useTheme();
6048
6050
  var handleChange = function (e) {
6049
6051
  if (disabled || (e.target.checked === false && blockUncheck)) {
@@ -6052,7 +6054,7 @@ var Checkbox = function (_a) {
6052
6054
  }
6053
6055
  onChange(e.target.checked);
6054
6056
  };
6055
- return (jsxs$1(Container$1q, { children: [jsx$1(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: checked && (jsx$1(Icon.Actions.Check, { fill: text === 'White'
6057
+ return (jsxs$1(Container$1q, { children: [jsx$1(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, backgroundImage: backgroundImage, text: text }, { children: checked && (jsx$1(Icon.Actions.Check, { fill: text === 'White'
6056
6058
  ? theme.colors.shades['black'].color
6057
6059
  : theme.colors.shades['white'].color }, void 0)) }), void 0), jsx$1(Label$6, __assign$1({ "data-testid": "checkbox-text", size: sizeLabel, style: { color: colorLabel ? colorLabel : theme.colors.shades['700'].color }, variant: checked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
6058
6060
  };
@@ -8627,7 +8629,10 @@ var Filters = function (_a) {
8627
8629
  });
8628
8630
  }, width: "50px", id: "filter[".concat(calculatedSectionIndex, ",").concat(itemIndex, "]") }, item.label));
8629
8631
  }), filter.type === 'color' &&
8630
- filter.items.map(function (item, itemIndex) { return (jsx$1(FilterCheckboxColor, { onChange: handleCheckboxClick, text: item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck, color: item.value || '' }, "".concat(item.checked, "-").concat(item.label))); }), !filter.type &&
8632
+ filter.items.map(function (item, itemIndex) {
8633
+ var _a;
8634
+ return (jsx$1(FilterCheckboxColor, { onChange: handleCheckboxClick, text: item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck, color: (_a = item.value) !== null && _a !== void 0 ? _a : '', backgroundImage: item.backgroundImage }, "".concat(item.checked, "-").concat(item.label)));
8635
+ }), !filter.type &&
8631
8636
  filter.items.map(function (item, itemIndex) { return (jsx$1(FilterCheckbox, { onChange: handleCheckboxClick, text: item.label === '$75 And Above' ? '+$75' : item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck }, "".concat(item.checked, "-").concat(item.label))); })] }), void 0) }), filters.findIndex(function (filt) { return filt.title === filter.title; })));
8632
8637
  }), isMobile && (jsxs$1(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxs$1(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsx$1(MobileIconsContainer, { children: jsx$1(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsx$1(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsx$1(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
8633
8638
  };
@@ -8639,11 +8644,11 @@ var FilterCheckbox = function (_a) {
8639
8644
  return (jsx$1(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: ComponentSize.Small, variant: "secondary", blockUncheck: blockUncheck }, itemIndex));
8640
8645
  };
8641
8646
  var FilterCheckboxColor = function (_a) {
8642
- var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck, color = _a.color;
8647
+ var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck, color = _a.color, backgroundImage = _a.backgroundImage;
8643
8648
  var onChange = useCallback(function (checked) {
8644
8649
  onChangeProp({ sectionIndex: sectionIndex, itemIndex: itemIndex, checked: checked });
8645
8650
  }, [onChangeProp, sectionIndex, itemIndex]);
8646
- return (jsx$1(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: ComponentSize.Medium, variant: "color", blockUncheck: blockUncheck, backgroundColor: color }, itemIndex));
8651
+ return (jsx$1(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: ComponentSize.Medium, variant: "color", blockUncheck: blockUncheck, backgroundColor: color, backgroundImage: backgroundImage }, itemIndex));
8647
8652
  };
8648
8653
 
8649
8654
  var Wrapper$4 = newStyled.div(templateObject_1$1p || (templateObject_1$1p = __makeTemplateObject(["\n padding: 12px 58px;\n display: flex;\n gap: 1.5em;\n @media (max-width: 768px) {\n padding: 0.625rem 1.5rem;\n }\n"], ["\n padding: 12px 58px;\n display: flex;\n gap: 1.5em;\n @media (max-width: 768px) {\n padding: 0.625rem 1.5rem;\n }\n"])));
@@ -15127,7 +15132,7 @@ var Container$T = newStyled.div(templateObject_6$s || (templateObject_6$s = __ma
15127
15132
  }, visibleStyle, transformStyle);
15128
15133
  var Overlay = newStyled.div(templateObject_7$p || (templateObject_7$p = __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 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"])), visibleStyle);
15129
15134
  var Modal = function (_a) {
15130
- 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, width = _a.width, _d = _a.initialTop, initialTop = _d === void 0 ? '50%' : _d, _e = _a.countryRedirModalWithCoupon, countryRedirModalWithCoupon = _e === void 0 ? false : _e;
15135
+ 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, width = _a.width, _d = _a.initialTop, initialTop = _d === void 0 ? '50%' : _d, _e = _a.countryRedirModalWithCoupon, countryRedirModalWithCoupon = _e === void 0 ? false : _e, className = _a.className;
15131
15136
  var _f = useModal(id), opened = _f.opened, close = _f.close;
15132
15137
  var onDismiss = function () {
15133
15138
  if (!dismissable) {
@@ -15135,7 +15140,7 @@ var Modal = function (_a) {
15135
15140
  }
15136
15141
  close();
15137
15142
  };
15138
- return (jsxs(Portal, __assign$1({ id: id }, { children: [jsx(Container$T, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding, width: width, initialTop: initialTop, countryRedirModalWithCoupon: countryRedirModalWithCoupon }, { children: children }), void 0), jsx(Overlay, { "data-testid": "modal-overlay", opened: opened, onClick: function () {
15143
+ return (jsxs(Portal, __assign$1({ id: id, className: className }, { children: [jsx(Container$T, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding, width: width, initialTop: initialTop, countryRedirModalWithCoupon: countryRedirModalWithCoupon }, { children: children }), void 0), jsx(Overlay, { "data-testid": "modal-overlay", opened: opened, onClick: function () {
15139
15144
  onClickOverlayHandler === null || onClickOverlayHandler === void 0 ? void 0 : onClickOverlayHandler();
15140
15145
  onDismiss();
15141
15146
  } }, void 0)] }), void 0));