@trafilea/afrodita-components 5.0.0-beta.97 → 5.0.0-beta.99

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
@@ -4594,16 +4594,16 @@ var Input$3 = newStyled.input(templateObject_2$O || (templateObject_2$O = __make
4594
4594
  return (disabled ? 'not-allowed' : 'pointer');
4595
4595
  });
4596
4596
  var Checkbox = function (_a) {
4597
- var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant;
4597
+ var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck;
4598
4598
  var theme = useTheme();
4599
4599
  var _e = React$2.useState(checked), isChecked = _e[0], setIsChecked = _e[1];
4600
4600
  var mounted = React$2.useRef(false);
4601
4601
  var handleChange = React$2.useCallback(function () {
4602
- if (disabled) {
4602
+ if (disabled || (isChecked && blockUncheck)) {
4603
4603
  return;
4604
4604
  }
4605
4605
  setIsChecked(function (checked) { return !checked; });
4606
- }, [disabled]);
4606
+ }, [blockUncheck, disabled, isChecked]);
4607
4607
  React$2.useEffect(function () {
4608
4608
  if (disabled || !mounted.current) {
4609
4609
  return;
@@ -12954,7 +12954,7 @@ var SearchControl = function (_a) {
12954
12954
  var theme = useTheme();
12955
12955
  var isMobile = useWindowDimensions(theme.mediaQueries).isMobile;
12956
12956
  if (showSearchIcon) {
12957
- return (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
12957
+ return (jsx(SearchIconContainer, __assign$1({ onClick: onSearch }, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }), void 0));
12958
12958
  }
12959
12959
  else if (isMobile) {
12960
12960
  return open ? (jsx(ClearButton, { onClick: onClose }, void 0)) : (jsx(SearchIconContainer, { children: jsx(Icon.Navigation.Search, { height: 1.25, width: 1.25 }, void 0) }, void 0));
@@ -17491,9 +17491,6 @@ var Filters = function (_a) {
17491
17491
  if (checked) {
17492
17492
  window.location.assign(currentFilterItem.link);
17493
17493
  }
17494
- else if (currentFilterItem === null || currentFilterItem === void 0 ? void 0 : currentFilterItem.uncheckedLink) {
17495
- window.location.assign(currentFilterItem.uncheckedLink);
17496
- }
17497
17494
  return;
17498
17495
  }
17499
17496
  setCheckedItems(function (prev) {
@@ -17542,14 +17539,14 @@ var Filters = function (_a) {
17542
17539
  .filter(function (filter) { return filter.isLinkOption; })
17543
17540
  .map(function (option, index) { return (jsxRuntime.jsx(OptionContainer, { children: jsxRuntime.jsx(FilterLink, __assign$1({ color: option.color || theme.colors.shades['550'].color, href: option.link }, { children: option.title }), void 0) }, index)); }), filters
17544
17541
  .filter(function (filter) { return !filter.isLinkOption; })
17545
- .map(function (filter) { return (jsxRuntime.jsx(Accordion, __assign$1({ title: filter.title, isOpenByDefault: filter.isOpenByDefault }, { children: jsxRuntime.jsx(SectionContent, __assign$1({ cols: filter.columns }, { children: filter.items.map(function (item, itemIndex) { return (jsxRuntime.jsx(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; }) }, "".concat(item.checked, "-").concat(item.label))); }) }), void 0) }), filters.findIndex(function (filt) { return filt.title === filter.title; }))); }), isMobile && (jsxRuntime.jsxs(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxRuntime.jsxs(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsxRuntime.jsx(MobileIconsContainer, { children: jsxRuntime.jsx(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsxRuntime.jsx(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsxRuntime.jsx(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
17542
+ .map(function (filter) { return (jsxRuntime.jsx(Accordion, __assign$1({ title: filter.title, isOpenByDefault: filter.isOpenByDefault }, { children: jsxRuntime.jsx(SectionContent, __assign$1({ cols: filter.columns }, { children: filter.items.map(function (item, itemIndex) { return (jsxRuntime.jsx(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; }))); }), isMobile && (jsxRuntime.jsxs(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxRuntime.jsxs(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsxRuntime.jsx(MobileIconsContainer, { children: jsxRuntime.jsx(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsxRuntime.jsx(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsxRuntime.jsx(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
17546
17543
  };
17547
17544
  var FilterCheckbox = function (_a) {
17548
- var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked;
17545
+ var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck;
17549
17546
  var onChange = React$2.useCallback(function (checked) {
17550
17547
  onChangeProp({ sectionIndex: sectionIndex, itemIndex: itemIndex, checked: checked });
17551
- }, [sectionIndex, itemIndex, onChangeProp]);
17552
- return (jsxRuntime.jsx(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: exports.ComponentSize.Small, variant: "secondary" }, itemIndex));
17548
+ }, [onChangeProp, sectionIndex, itemIndex]);
17549
+ return (jsxRuntime.jsx(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: exports.ComponentSize.Small, variant: "secondary", blockUncheck: blockUncheck }, itemIndex));
17553
17550
  };
17554
17551
 
17555
17552
  var Container$7 = newStyled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n padding: 0 1rem 1rem;\n"], ["\n display: flex;\n flex-wrap: wrap;\n padding: 0 1rem 1rem;\n"])));