@sledge-app/react-instant-search 2.0.25 → 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.
- package/dist/components/SearchResultWidget/components/Facet.d.ts.map +1 -1
- package/dist/sledge-react-instant-search.cjs +1 -1
- package/dist/sledge-react-instant-search.cjs.map +1 -1
- package/dist/sledge-react-instant-search.js +22 -4
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,
|