@sledge-app/react-instant-search 2.0.24 → 2.0.26

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.
@@ -1156,14 +1156,31 @@ const RadioGroup = ({ id, name, required, value, items, labelStyle = {}, onValue
1156
1156
  ) }) }) });
1157
1157
  };
1158
1158
  const ColorSwatch$1 = "";
1159
- const ColorSwatch = ({ id, name, value, rgb, image, required, checked, onClick, labelType = "tooltip", label, labelStyle = {} }) => {
1159
+ const ColorSwatch = ({ id, name, value, rgb, additionalRgb: additionalRgbProp = [], image, required, checked, onClick, labelType = "tooltip", label, labelStyle = {} }) => {
1160
+ var _a;
1161
+ const additionalRgb = (_a = additionalRgbProp == null ? void 0 : additionalRgbProp.filter) == null ? void 0 : _a.call(additionalRgbProp, (item) => item);
1162
+ let rgbStyle = {
1163
+ backgroundColor: rgb
1164
+ };
1165
+ if (additionalRgb == null ? void 0 : additionalRgb.length) {
1166
+ rgbStyle = {
1167
+ background: `linear-gradient(to bottom right, ${rgb} 50%, ${additionalRgb[0]} 50%)`
1168
+ };
1169
+ if ((additionalRgb == null ? void 0 : additionalRgb.length) > 1) {
1170
+ rgbStyle = {
1171
+ background: `conic-gradient(
1172
+ ${rgb} 0deg 120deg,
1173
+ ${additionalRgb[0]} 120deg 240deg,
1174
+ ${additionalRgb[1]} 240deg 360deg
1175
+ )`
1176
+ };
1177
+ }
1178
+ }
1160
1179
  const styles = {
1161
1180
  ...(image == null ? void 0 : image.length) ? {
1162
1181
  backgroundImage: `url("${image}")`,
1163
1182
  backgroundSize: "contain"
1164
- } : {
1165
- backgroundColor: rgb
1166
- }
1183
+ } : rgbStyle
1167
1184
  };
1168
1185
  const colorSwatchComponent = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__color-swatch-wrapper", children: [
1169
1186
  /* @__PURE__ */ jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9, { className: "sledge__color-swatch-root", checked, id, name, value, required, onClick, style: styles }),
@@ -7820,6 +7837,7 @@ const Facet = (props) => {
7820
7837
  name: value,
7821
7838
  value: item == null ? void 0 : item.value,
7822
7839
  rgb: getColorSwatch == null ? void 0 : getColorSwatch.rgb,
7840
+ additionalRgb: [(getColorSwatch == null ? void 0 : getColorSwatch.color_2) || null, (getColorSwatch == null ? void 0 : getColorSwatch.color_3) || null],
7823
7841
  image: getColorSwatch == null ? void 0 : getColorSwatch.image,
7824
7842
  onClick: (e) => handleFilterChange({
7825
7843
  parentId: value,
@@ -8698,7 +8716,7 @@ const DesktopLayout = (props) => {
8698
8716
  );
8699
8717
  };
8700
8718
  const FilterFlyoutLayout = (props) => {
8701
- var _a, _b, _c;
8719
+ var _a, _b, _c, _d;
8702
8720
  const {
8703
8721
  displaySettings,
8704
8722
  languageSettings,
@@ -8756,17 +8774,17 @@ const FilterFlyoutLayout = (props) => {
8756
8774
  selectOptionSkeletonComponent
8757
8775
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8758
8776
  /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
8759
- /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }),
8777
+ ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null,
8760
8778
  /* @__PURE__ */ jsxRuntimeExports.jsx(FilterHorizontalBlockMobile, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultSearchFieldFlex, { children: [
8761
8779
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { type: "button", className: "sledge-instant-search__trigger-filter-flyout", onClick: () => setOpenFilterFlyout == null ? void 0 : setOpenFilterFlyout(true), children: [
8762
8780
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: language_filter || "Filter" }),
8763
8781
  /* @__PURE__ */ jsxRuntimeExports.jsx(FilterIcon, { width: 18, height: 18, color: "#393d4e" })
8764
8782
  ] }),
8765
- ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : searchField
8783
+ ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : searchField
8766
8784
  ] }) }),
8767
8785
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
8768
8786
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
8769
- ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8787
+ ((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8770
8788
  ] })
8771
8789
  ] }) }),
8772
8790
  isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -8777,7 +8795,7 @@ const FilterFlyoutLayout = (props) => {
8777
8795
  ] });
8778
8796
  };
8779
8797
  const FilterStandardLayout = (props) => {
8780
- var _a, _b, _c;
8798
+ var _a, _b, _c, _d;
8781
8799
  const { displaySettings, languageSettings, allowedFilter, isFirstLoading, isLoading, isLoadingProduct, isLoadingSetting, searchResult = [], components, skeleton } = props;
8782
8800
  const {
8783
8801
  filterHorizontal = null,
@@ -8807,14 +8825,14 @@ const FilterStandardLayout = (props) => {
8807
8825
  selectOptionSkeletonComponent
8808
8826
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8809
8827
  /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
8810
- /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }),
8828
+ ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null,
8811
8829
  /* @__PURE__ */ jsxRuntimeExports.jsxs(FilterHorizontalBlockMobile, { children: [
8812
- ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : searchField,
8830
+ ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : searchField,
8813
8831
  filterHorizontal == null ? void 0 : filterHorizontal({ deviceType: "mobile" })
8814
8832
  ] }),
8815
8833
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
8816
8834
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
8817
- ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8835
+ ((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8818
8836
  ] })
8819
8837
  ] }) }),
8820
8838
  isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -8824,7 +8842,7 @@ const FilterStandardLayout = (props) => {
8824
8842
  ] }) }) });
8825
8843
  };
8826
8844
  const StickyFilterButtonLayout = (props) => {
8827
- var _a, _b, _c;
8845
+ var _a, _b, _c, _d;
8828
8846
  const {
8829
8847
  displaySettings,
8830
8848
  languageSettings,
@@ -8886,11 +8904,11 @@ const StickyFilterButtonLayout = (props) => {
8886
8904
  selectOptionSkeletonComponent
8887
8905
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8888
8906
  /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryTextHorizontal, { children: summaryText }),
8889
- /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }),
8890
- ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(FilterHorizontalBlockMobile, { children: searchField }),
8907
+ ((_b = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _b.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) : null,
8908
+ ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_search_bar) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(FilterHorizontalBlockMobile, { children: searchField }),
8891
8909
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectFieldWrapper, { children: [
8892
8910
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: sort }),
8893
- ((_c = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _c.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8911
+ ((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.hide_limit_options) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldItem, { children: limit })
8894
8912
  ] })
8895
8913
  ] }) }),
8896
8914
  isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: productGridSkeleton }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (searchResult == null ? void 0 : searchResult.length) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [