@shoplflow/base 0.30.5 → 0.30.7

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
@@ -187,12 +187,12 @@ var BackDropStyled = styled6__default.default(framerMotion.motion.div)`
187
187
  position: fixed;
188
188
  top: 0;
189
189
  left: 0;
190
- z-index: 20000;
190
+ z-index: ${({ zIndex }) => zIndex || 2e4};
191
191
  width: 100%;
192
192
  height: 100%;
193
193
  background: rgba(51, 51, 51, 0.6);
194
194
  `;
195
- var BackDrop = ({ children }) => {
195
+ var BackDrop = ({ children, zIndex }) => {
196
196
  return /* @__PURE__ */ jsxRuntime.jsx(
197
197
  BackDropStyled,
198
198
  {
@@ -201,6 +201,7 @@ var BackDrop = ({ children }) => {
201
201
  animate: "animate",
202
202
  exit: "exit",
203
203
  "data-shoplflow": "BackDrop",
204
+ zIndex,
204
205
  children
205
206
  }
206
207
  );
@@ -1053,12 +1054,12 @@ exports.useHandleModal = () => {
1053
1054
  };
1054
1055
  var ModalProvider = ({ children }) => {
1055
1056
  const [openedModals, setOpenedModals] = React3.useState([]);
1056
- const addModal = (component, id) => {
1057
+ const addModal = (component, id, zIndex) => {
1057
1058
  setOpenedModals((modals) => {
1058
1059
  if (modals) {
1059
- return [...modals, { component, id }];
1060
+ return [...modals, { component, id, zIndex }];
1060
1061
  }
1061
- return [{ component, id }];
1062
+ return [{ component, id, zIndex }];
1062
1063
  });
1063
1064
  };
1064
1065
  const removeModal = (props) => {
@@ -4161,7 +4162,7 @@ var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
4161
4162
  var ModalPortal = () => {
4162
4163
  const modal = React3.useContext(exports.ModalContext);
4163
4164
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: reactDom$1.createPortal(
4164
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: modal.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(BackDrop_default, { children: /* @__PURE__ */ jsxRuntime.jsx(SpaceMarginWrapper, { children: item.component }) }, index)) }),
4165
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: modal.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(BackDrop_default, { zIndex: item.zIndex, children: /* @__PURE__ */ jsxRuntime.jsx(SpaceMarginWrapper, { children: item.component }) }, index)) }),
4165
4166
  document.body
4166
4167
  ) });
4167
4168
  };