@rkmodules/rules 0.0.177 → 0.0.178

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.
@@ -98,6 +98,7 @@
98
98
  top: 100%;
99
99
  right: 0;
100
100
  background-color: var(--bg);
101
+ z-index: 9999;
101
102
  }
102
103
  .MenuItem_UWLzD {
103
104
  padding: 4px 8px;
package/dist/index.cjs.js CHANGED
@@ -7064,6 +7064,19 @@ function Menu(_a) {
7064
7064
  var handleClose = function () {
7065
7065
  setOpen(false);
7066
7066
  };
7067
+ React.useEffect(function () {
7068
+ if (!open)
7069
+ return;
7070
+ var handleClickOutside = function (event) {
7071
+ if (!event.target.closest(".".concat(styles$2.MenuCanvas))) {
7072
+ setOpen(false);
7073
+ }
7074
+ };
7075
+ document.addEventListener("click", handleClickOutside);
7076
+ return function () {
7077
+ document.removeEventListener("click", handleClickOutside);
7078
+ };
7079
+ }, [open]);
7067
7080
  return (React.createElement("div", { className: styles$2.Menu },
7068
7081
  React.createElement("div", { onClick: handleOpen }, handle),
7069
7082
  open && (React.createElement("div", { className: styles$2.MenuCanvas, onClick: handleClose }, children))));