@sledge-app/react-instant-search 1.0.78 → 1.0.79

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.
@@ -1570,6 +1570,7 @@ const Trigger = (props) => {
1570
1570
  const [colorIcon, setColorIcon] = React__default.useState(isWishlisted ? activeColorIcon : defaultColorIcon);
1571
1571
  const [typeIcon, setTypeIcon] = React__default.useState(isWishlisted ? activeTypeIcon : defaultTypeIcon);
1572
1572
  const [isWishlist, setIsWishlist] = React__default.useState(!!wishlistChecked);
1573
+ const [mouseEnter, setMouseEnter] = React__default.useState(false);
1573
1574
  const [isLoading, setIsLoading] = React__default.useState(!wishlistCheckedFilled);
1574
1575
  const [dataSettings, setDataSettings] = React__default.useState({});
1575
1576
  const [handleFunctions, _setHandleFunctions] = React__default.useState({
@@ -1694,6 +1695,7 @@ const Trigger = (props) => {
1694
1695
  handleCheckWishlist();
1695
1696
  }, [isRenderAppWishlist, hasEntry, productVariantId]);
1696
1697
  const isActive = (isWishlist || forceActive) && !isRequiredLogin;
1698
+ const inWishlist = isActive || mouseEnter;
1697
1699
  React__default.useEffect(() => {
1698
1700
  if (isActive) {
1699
1701
  setColorIcon(activeColorIcon);
@@ -1703,26 +1705,37 @@ const Trigger = (props) => {
1703
1705
  setTypeIcon(defaultTypeIcon);
1704
1706
  }
1705
1707
  }, [isWishlist]);
1706
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: rootRef, children: !isLoading && !hidden && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__trigger-block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1707
- "span",
1708
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: rootRef, children: !isLoading && !hidden && /* @__PURE__ */ jsxRuntimeExports.jsx(
1709
+ "div",
1708
1710
  {
1709
- className: "sledge-wishlist__trigger",
1710
- onClick: (e) => handleClick(e),
1711
- onMouseEnter: () => {
1712
- if (isActive)
1713
- return;
1714
- setColorIcon(activeColorIcon);
1715
- setTypeIcon(activeTypeIcon);
1716
- },
1717
- onMouseLeave: () => {
1718
- if (isActive)
1719
- return;
1720
- setColorIcon(defaultColorIcon);
1721
- setTypeIcon(defaultTypeIcon);
1711
+ className: "sledge-wishlist__trigger-block",
1712
+ ...inWishlist && {
1713
+ ["in-wishlist"]: ""
1722
1714
  },
1723
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeartIcon, { width: 16.67, height: 15.83, type: typeIcon, color: colorIcon })
1715
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1716
+ "span",
1717
+ {
1718
+ className: "sledge-wishlist__trigger",
1719
+ onClick: (e) => handleClick(e),
1720
+ onMouseEnter: () => {
1721
+ if (isActive)
1722
+ return;
1723
+ setColorIcon(activeColorIcon);
1724
+ setTypeIcon(activeTypeIcon);
1725
+ setMouseEnter(true);
1726
+ },
1727
+ onMouseLeave: () => {
1728
+ if (isActive)
1729
+ return;
1730
+ setColorIcon(defaultColorIcon);
1731
+ setTypeIcon(defaultTypeIcon);
1732
+ setMouseEnter(false);
1733
+ },
1734
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeartIcon, { width: 16.67, height: 15.83, type: typeIcon, color: colorIcon })
1735
+ }
1736
+ )
1724
1737
  }
1725
- ) }) });
1738
+ ) });
1726
1739
  };
1727
1740
  const WidgetHeaderClearTrigger = ({ buttonText, shareId, dataSettings, isFirstLoading }) => {
1728
1741
  var _a, _b, _c, _d, _e;