@eclass/ui-kit 1.60.4 → 1.62.0

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.
@@ -7607,30 +7607,45 @@ const useModalConfig = ({
7607
7607
  closeOnOverlayClick,
7608
7608
  scrollBehavior,
7609
7609
  fixedButtons,
7610
- withoutMargin
7610
+ withoutMargin,
7611
+ minWidth,
7612
+ maxWidth,
7613
+ minHeight,
7614
+ maxHeight,
7615
+ mobileCompact = false
7611
7616
  }) => {
7612
7617
  const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
7613
7618
  const isInsideScroll = scrollBehavior === "inside";
7614
7619
  const shouldForceInsideScroll = fixedButtons;
7620
+ const desktopMinWidth = minWidth != null ? minWidth : "690px";
7621
+ const desktopMaxWidth = maxWidth != null ? maxWidth : "690px";
7622
+ const desktopMinHeight = minHeight != null ? minHeight : "300px";
7623
+ const insideMaxHeight = maxHeight != null ? maxHeight : "calc(100% - 96px)";
7624
+ const outsideMaxHeight = maxHeight != null ? maxHeight : "auto";
7625
+ const compactMobileWidth = maxWidth != null ? maxWidth : "calc(100vw - 32px)";
7626
+ const compactMobileMaxWidth = maxWidth != null ? maxWidth : "375px";
7627
+ const compactMobileMaxHeight = maxHeight != null ? maxHeight : "calc(100dvh - 32px)";
7615
7628
  const isInside = isInsideScroll || shouldForceInsideScroll;
7616
7629
  return {
7617
7630
  closeOnOverlayClick,
7618
7631
  closeOnEsc: closeOnOverlayClick,
7619
7632
  scrollBehavior: isInside ? "inside" : "outside",
7620
7633
  contentProps: {
7621
- maxH: isInside ? "100dvh" : "auto",
7622
- minH: isDesktop ? "300px" : "100dvh",
7634
+ maxH: isInside ? maxHeight != null ? maxHeight : "100%" : mobileCompact && !isDesktop ? compactMobileMaxHeight : outsideMaxHeight,
7635
+ minH: isDesktop ? desktopMinHeight : mobileCompact ? "auto" : "100%",
7623
7636
  padding: 0,
7624
- width: "100%",
7637
+ width: isDesktop ? "fit-content" : mobileCompact ? compactMobileWidth : "100%",
7625
7638
  animation: "none",
7626
7639
  sx: {
7627
7640
  bgColor: vars("colors-neutral-white"),
7628
- borderRadius: isDesktop ? "8px" : 0,
7629
- mt: isDesktop ? "48px" : 0,
7630
- mb: isDesktop ? "48px" : 0,
7631
- marginX: isDesktop ? "auto" : 0,
7632
- maxH: isInside ? "calc(100dvh - 96px)" : "auto",
7633
- maxWidth: isDesktop ? "690px" : "100%",
7641
+ borderRadius: isDesktop ? "8px" : mobileCompact ? "10px" : 0,
7642
+ mt: isDesktop ? "48px" : mobileCompact ? "auto" : 0,
7643
+ mb: isDesktop ? "48px" : mobileCompact ? "auto" : 0,
7644
+ marginX: isDesktop ? "auto" : mobileCompact ? "auto" : 0,
7645
+ maxH: isInside ? insideMaxHeight : mobileCompact && !isDesktop ? compactMobileMaxHeight : outsideMaxHeight,
7646
+ minWidth: isDesktop ? desktopMinWidth : mobileCompact ? "auto" : void 0,
7647
+ maxWidth: isDesktop ? desktopMaxWidth : mobileCompact ? compactMobileMaxWidth : "100%",
7648
+ overflow: mobileCompact && !isDesktop ? "hidden" : void 0,
7634
7649
  ...fixedButtons && {
7635
7650
  ".uikit-modalContent": {
7636
7651
  pb: 0
@@ -7667,14 +7682,23 @@ const Modal = ({
7667
7682
  withoutMargin = false,
7668
7683
  scrollBehavior = "outside",
7669
7684
  fixedButtons = false,
7670
- autoFocus = false
7685
+ autoFocus = false,
7686
+ returnFocusOnClose = true,
7687
+ minWidth,
7688
+ maxWidth,
7689
+ minHeight,
7690
+ maxHeight
7671
7691
  }) => {
7672
7692
  const isInside = scrollBehavior === "inside" || fixedButtons;
7673
7693
  const modalConfig = useModalConfig({
7674
7694
  closeOnOverlayClick,
7675
7695
  scrollBehavior,
7676
7696
  fixedButtons,
7677
- withoutMargin
7697
+ withoutMargin,
7698
+ minWidth,
7699
+ maxWidth,
7700
+ minHeight,
7701
+ maxHeight
7678
7702
  });
7679
7703
  return /* @__PURE__ */ jsxs(Modal$1, {
7680
7704
  closeOnOverlayClick: modalConfig.closeOnOverlayClick,
@@ -7684,6 +7708,7 @@ const Modal = ({
7684
7708
  onClose,
7685
7709
  scrollBehavior: isInside ? "inside" : "outside",
7686
7710
  autoFocus,
7711
+ returnFocusOnClose,
7687
7712
  blockScrollOnMount: false,
7688
7713
  children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(Box, {
7689
7714
  sx: {
@@ -7762,13 +7787,15 @@ const ModalSimple = ({
7762
7787
  onClose,
7763
7788
  closeOnOverlayClick = true,
7764
7789
  closeOnEsc,
7765
- withoutMargin = false
7790
+ withoutMargin = false,
7791
+ mobileCompact = false
7766
7792
  }) => {
7767
7793
  const modalConfig = useModalConfig({
7768
7794
  closeOnOverlayClick,
7769
7795
  scrollBehavior: "outside",
7770
7796
  fixedButtons: false,
7771
- withoutMargin
7797
+ withoutMargin,
7798
+ mobileCompact
7772
7799
  });
7773
7800
  return /* @__PURE__ */ jsxs(Modal$1, {
7774
7801
  closeOnOverlayClick: modalConfig.closeOnOverlayClick,
@@ -7777,6 +7804,7 @@ const ModalSimple = ({
7777
7804
  motionPreset: "scale",
7778
7805
  onClose,
7779
7806
  scrollBehavior: "outside",
7807
+ isCentered: mobileCompact,
7780
7808
  blockScrollOnMount: false,
7781
7809
  children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent$1, {
7782
7810
  ...modalConfig.contentProps,
@@ -7959,7 +7987,7 @@ const useModalAlertConfig = () => {
7959
7987
  p: 0,
7960
7988
  m: "10vh auto 0",
7961
7989
  sx: {
7962
- maxWidth: isDesktop ? "589px" : "343px"
7990
+ maxWidth: isDesktop ? "589px" : "calc(100vw - 32px)"
7963
7991
  }
7964
7992
  }
7965
7993
  };
@@ -7967,6 +7995,7 @@ const useModalAlertConfig = () => {
7967
7995
  const ModalAlertNew = ({
7968
7996
  autoFocus = false,
7969
7997
  type,
7998
+ returnFocusOnClose = true,
7970
7999
  isOpen,
7971
8000
  onClose,
7972
8001
  children,
@@ -7983,6 +8012,7 @@ const ModalAlertNew = ({
7983
8012
  onClose,
7984
8013
  closeOnEsc: type !== "loading",
7985
8014
  autoFocus,
8015
+ returnFocusOnClose,
7986
8016
  children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(ModalContent$1, {
7987
8017
  ...modalConfig.contentProps,
7988
8018
  children: /* @__PURE__ */ jsx(ModalAlertContent, {
@@ -8027,13 +8057,21 @@ const useModalMultipleConfig = ({
8027
8057
  closeOnOverlayClick,
8028
8058
  scrollBehavior,
8029
8059
  fixedButtons,
8030
- withoutMargin
8060
+ withoutMargin,
8061
+ minWidth,
8062
+ maxWidth,
8063
+ minHeight,
8064
+ maxHeight
8031
8065
  }) => {
8032
8066
  const modalConfig = useModalConfig({
8033
8067
  closeOnOverlayClick,
8034
8068
  scrollBehavior,
8035
8069
  fixedButtons,
8036
- withoutMargin
8070
+ withoutMargin,
8071
+ minWidth,
8072
+ maxWidth,
8073
+ minHeight,
8074
+ maxHeight
8037
8075
  });
8038
8076
  const modalAlertConfig = useModalAlertConfig();
8039
8077
  switch (type) {
@@ -8050,20 +8088,29 @@ const ModalMultiple = (props) => {
8050
8088
  isOpen,
8051
8089
  onClose,
8052
8090
  autoFocus = false,
8091
+ returnFocusOnClose = true,
8053
8092
  children,
8054
8093
  title,
8055
8094
  closeOnOverlayClick = true,
8056
8095
  fixedSubtitle,
8057
8096
  withoutMargin = false,
8058
8097
  scrollBehavior = "outside",
8059
- fixedButtons = false
8098
+ fixedButtons = false,
8099
+ minWidth,
8100
+ maxWidth,
8101
+ minHeight,
8102
+ maxHeight
8060
8103
  } = props;
8061
8104
  const modalConfig = useModalMultipleConfig({
8062
8105
  type,
8063
8106
  closeOnOverlayClick,
8064
8107
  scrollBehavior,
8065
8108
  fixedButtons,
8066
- withoutMargin
8109
+ withoutMargin,
8110
+ minWidth,
8111
+ maxWidth,
8112
+ minHeight,
8113
+ maxHeight
8067
8114
  });
8068
8115
  const renderContent = () => {
8069
8116
  switch (type) {
@@ -8097,6 +8144,7 @@ const ModalMultiple = (props) => {
8097
8144
  onClose,
8098
8145
  motionPreset: "scale",
8099
8146
  autoFocus,
8147
+ returnFocusOnClose,
8100
8148
  closeOnOverlayClick: modalConfig.closeOnOverlayClick,
8101
8149
  closeOnEsc: modalConfig.closeOnEsc,
8102
8150
  scrollBehavior: modalConfig.scrollBehavior,