@eclass/ui-kit 1.60.4 → 1.61.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.
- package/dist/eclass-ui-kit.es.js +61 -19
- package/dist/eclass-ui-kit.es.js.map +1 -1
- package/dist/eclass-ui-kit.umd.js +8 -8
- package/dist/eclass-ui-kit.umd.js.map +1 -1
- package/dist/organisms/Modals/Modal/Modal.d.ts +1 -1
- package/dist/organisms/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/organisms/Modals/Modal/ModalSimple.d.ts +1 -1
- package/dist/organisms/Modals/Modal/ModalSimple.d.ts.map +1 -1
- package/dist/organisms/Modals/Modal/useModalConfig.d.ts +6 -1
- package/dist/organisms/Modals/Modal/useModalConfig.d.ts.map +1 -1
- package/dist/organisms/Modals/ModalMultiple/ModalMultiple.d.ts +4 -0
- package/dist/organisms/Modals/ModalMultiple/ModalMultiple.d.ts.map +1 -1
- package/dist/organisms/Modals/ModalMultiple/useModalMultipleConfig.d.ts +5 -1
- package/dist/organisms/Modals/ModalMultiple/useModalMultipleConfig.d.ts.map +1 -1
- package/dist/organisms/Modals/types.d.ts +6 -0
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/eclass-ui-kit.es.js
CHANGED
|
@@ -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 ? "
|
|
7622
|
-
minH: isDesktop ? "
|
|
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 ?
|
|
7633
|
-
|
|
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,22 @@ const Modal = ({
|
|
|
7667
7682
|
withoutMargin = false,
|
|
7668
7683
|
scrollBehavior = "outside",
|
|
7669
7684
|
fixedButtons = false,
|
|
7670
|
-
autoFocus = false
|
|
7685
|
+
autoFocus = false,
|
|
7686
|
+
minWidth,
|
|
7687
|
+
maxWidth,
|
|
7688
|
+
minHeight,
|
|
7689
|
+
maxHeight
|
|
7671
7690
|
}) => {
|
|
7672
7691
|
const isInside = scrollBehavior === "inside" || fixedButtons;
|
|
7673
7692
|
const modalConfig = useModalConfig({
|
|
7674
7693
|
closeOnOverlayClick,
|
|
7675
7694
|
scrollBehavior,
|
|
7676
7695
|
fixedButtons,
|
|
7677
|
-
withoutMargin
|
|
7696
|
+
withoutMargin,
|
|
7697
|
+
minWidth,
|
|
7698
|
+
maxWidth,
|
|
7699
|
+
minHeight,
|
|
7700
|
+
maxHeight
|
|
7678
7701
|
});
|
|
7679
7702
|
return /* @__PURE__ */ jsxs(Modal$1, {
|
|
7680
7703
|
closeOnOverlayClick: modalConfig.closeOnOverlayClick,
|
|
@@ -7762,13 +7785,15 @@ const ModalSimple = ({
|
|
|
7762
7785
|
onClose,
|
|
7763
7786
|
closeOnOverlayClick = true,
|
|
7764
7787
|
closeOnEsc,
|
|
7765
|
-
withoutMargin = false
|
|
7788
|
+
withoutMargin = false,
|
|
7789
|
+
mobileCompact = false
|
|
7766
7790
|
}) => {
|
|
7767
7791
|
const modalConfig = useModalConfig({
|
|
7768
7792
|
closeOnOverlayClick,
|
|
7769
7793
|
scrollBehavior: "outside",
|
|
7770
7794
|
fixedButtons: false,
|
|
7771
|
-
withoutMargin
|
|
7795
|
+
withoutMargin,
|
|
7796
|
+
mobileCompact
|
|
7772
7797
|
});
|
|
7773
7798
|
return /* @__PURE__ */ jsxs(Modal$1, {
|
|
7774
7799
|
closeOnOverlayClick: modalConfig.closeOnOverlayClick,
|
|
@@ -7777,6 +7802,7 @@ const ModalSimple = ({
|
|
|
7777
7802
|
motionPreset: "scale",
|
|
7778
7803
|
onClose,
|
|
7779
7804
|
scrollBehavior: "outside",
|
|
7805
|
+
isCentered: mobileCompact,
|
|
7780
7806
|
blockScrollOnMount: false,
|
|
7781
7807
|
children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent$1, {
|
|
7782
7808
|
...modalConfig.contentProps,
|
|
@@ -7959,7 +7985,7 @@ const useModalAlertConfig = () => {
|
|
|
7959
7985
|
p: 0,
|
|
7960
7986
|
m: "10vh auto 0",
|
|
7961
7987
|
sx: {
|
|
7962
|
-
maxWidth: isDesktop ? "589px" : "
|
|
7988
|
+
maxWidth: isDesktop ? "589px" : "calc(100vw - 32px)"
|
|
7963
7989
|
}
|
|
7964
7990
|
}
|
|
7965
7991
|
};
|
|
@@ -8027,13 +8053,21 @@ const useModalMultipleConfig = ({
|
|
|
8027
8053
|
closeOnOverlayClick,
|
|
8028
8054
|
scrollBehavior,
|
|
8029
8055
|
fixedButtons,
|
|
8030
|
-
withoutMargin
|
|
8056
|
+
withoutMargin,
|
|
8057
|
+
minWidth,
|
|
8058
|
+
maxWidth,
|
|
8059
|
+
minHeight,
|
|
8060
|
+
maxHeight
|
|
8031
8061
|
}) => {
|
|
8032
8062
|
const modalConfig = useModalConfig({
|
|
8033
8063
|
closeOnOverlayClick,
|
|
8034
8064
|
scrollBehavior,
|
|
8035
8065
|
fixedButtons,
|
|
8036
|
-
withoutMargin
|
|
8066
|
+
withoutMargin,
|
|
8067
|
+
minWidth,
|
|
8068
|
+
maxWidth,
|
|
8069
|
+
minHeight,
|
|
8070
|
+
maxHeight
|
|
8037
8071
|
});
|
|
8038
8072
|
const modalAlertConfig = useModalAlertConfig();
|
|
8039
8073
|
switch (type) {
|
|
@@ -8056,14 +8090,22 @@ const ModalMultiple = (props) => {
|
|
|
8056
8090
|
fixedSubtitle,
|
|
8057
8091
|
withoutMargin = false,
|
|
8058
8092
|
scrollBehavior = "outside",
|
|
8059
|
-
fixedButtons = false
|
|
8093
|
+
fixedButtons = false,
|
|
8094
|
+
minWidth,
|
|
8095
|
+
maxWidth,
|
|
8096
|
+
minHeight,
|
|
8097
|
+
maxHeight
|
|
8060
8098
|
} = props;
|
|
8061
8099
|
const modalConfig = useModalMultipleConfig({
|
|
8062
8100
|
type,
|
|
8063
8101
|
closeOnOverlayClick,
|
|
8064
8102
|
scrollBehavior,
|
|
8065
8103
|
fixedButtons,
|
|
8066
|
-
withoutMargin
|
|
8104
|
+
withoutMargin,
|
|
8105
|
+
minWidth,
|
|
8106
|
+
maxWidth,
|
|
8107
|
+
minHeight,
|
|
8108
|
+
maxHeight
|
|
8067
8109
|
});
|
|
8068
8110
|
const renderContent = () => {
|
|
8069
8111
|
switch (type) {
|