@shoplflow/base 0.24.17 → 0.24.20

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/index.cjs CHANGED
@@ -942,6 +942,15 @@ var ModalProvider = ({ children }) => {
942
942
  document.body.style.cssText = "overflow:unset";
943
943
  };
944
944
  }, [openedModals.length]);
945
+ React2.useEffect(() => {
946
+ const closeAllModals = () => {
947
+ setOpenedModals([]);
948
+ };
949
+ window.addEventListener("popstate", closeAllModals);
950
+ return () => {
951
+ window.removeEventListener("popstate", closeAllModals);
952
+ };
953
+ }, []);
945
954
  return /* @__PURE__ */ jsxRuntime.jsx(exports.ModalContext.Provider, { value: openedModals, children: /* @__PURE__ */ jsxRuntime.jsx(exports.ModalHandlerContext.Provider, { value: dispatch, children }) });
946
955
  };
947
956
  var ModalProvider_default = ModalProvider;
@@ -2698,10 +2707,10 @@ var Input = React2.forwardRef(
2698
2707
  );
2699
2708
  const limitRange = React2.useCallback(
2700
2709
  (value2) => {
2701
- if (min && Number(value2) < min) {
2710
+ if (min && Number(value2) < Number(min)) {
2702
2711
  return String(min);
2703
2712
  }
2704
- if (max && Number(value2) > max) {
2713
+ if (max && Number(value2) > Number(max)) {
2705
2714
  return String(max);
2706
2715
  }
2707
2716
  return value2;
@@ -2802,7 +2811,7 @@ var Input = React2.forwardRef(
2802
2811
  ),
2803
2812
  !(type === "number") && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper, { children: [
2804
2813
  maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength }),
2805
- isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral600" }) }),
2814
+ isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) }),
2806
2815
  initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
2807
2816
  exports.Icon,
2808
2817
  {