@shoplflow/base 0.30.4 → 0.30.6

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) => {
@@ -2417,7 +2418,7 @@ var Container3 = styled6__default.default.button`
2417
2418
  exports.CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
2418
2419
  var Checkbox = React3.forwardRef(
2419
2420
  (_a, ref) => {
2420
- var _b = _a, { defaultSelected, isSelected, disabled, onMouseEnter, onMouseLeave, styleVar = "PRIMARY", id } = _b, rest = __objRest(_b, ["defaultSelected", "isSelected", "disabled", "onMouseEnter", "onMouseLeave", "styleVar", "id"]);
2421
+ var _b = _a, { defaultSelected, isSelected, disabled, onMouseEnter, onClick, onMouseLeave, styleVar = "PRIMARY", id } = _b, rest = __objRest(_b, ["defaultSelected", "isSelected", "disabled", "onMouseEnter", "onClick", "onMouseLeave", "styleVar", "id"]);
2421
2422
  const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
2422
2423
  const [isHovered, toggleHovered] = React3.useState(false);
2423
2424
  const handleMouseLeave = (e) => {
@@ -2428,10 +2429,11 @@ var Checkbox = React3.forwardRef(
2428
2429
  toggleHovered(true);
2429
2430
  onMouseEnter && onMouseEnter(e);
2430
2431
  };
2431
- const handleClick = () => {
2432
+ const handleClick = (e) => {
2432
2433
  if (disabled) {
2433
2434
  return;
2434
2435
  }
2436
+ onClick && onClick(e);
2435
2437
  toggleSelected();
2436
2438
  };
2437
2439
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4160,7 +4162,7 @@ var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
4160
4162
  var ModalPortal = () => {
4161
4163
  const modal = React3.useContext(exports.ModalContext);
4162
4164
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: reactDom$1.createPortal(
4163
- /* @__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)) }),
4164
4166
  document.body
4165
4167
  ) });
4166
4168
  };