@shoplflow/base 0.26.0 → 0.26.3
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 +41 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +41 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -614,7 +614,7 @@ var createStackComponent2 = (stackOption) => React3.forwardRef(function Stack2(_
|
|
|
614
614
|
margin,
|
|
615
615
|
padding
|
|
616
616
|
}, rest), {
|
|
617
|
-
"data-shoplflow": "
|
|
617
|
+
"data-shoplflow": "StackContainer",
|
|
618
618
|
children: rest.children
|
|
619
619
|
})
|
|
620
620
|
);
|
|
@@ -723,13 +723,19 @@ var getModalWidthFromSize = (size2) => {
|
|
|
723
723
|
return MODAL_SIZE_M;
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
|
-
var getModalBodyTopBottomPadding = (isIncludeHeader) => {
|
|
726
|
+
var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar) => {
|
|
727
727
|
if (isIncludeHeader) {
|
|
728
728
|
return react$1.css`
|
|
729
729
|
padding-top: 16px;
|
|
730
730
|
padding-bottom: 24px;
|
|
731
731
|
`;
|
|
732
732
|
}
|
|
733
|
+
if (sizeVar === "FULL") {
|
|
734
|
+
return react$1.css`
|
|
735
|
+
padding-top: 0;
|
|
736
|
+
padding-bottom: 0;
|
|
737
|
+
`;
|
|
738
|
+
}
|
|
733
739
|
return react$1.css`
|
|
734
740
|
padding-top: 24px;
|
|
735
741
|
padding-bottom: 24px;
|
|
@@ -792,10 +798,10 @@ var BodyContainer = styled6__default.default.div`
|
|
|
792
798
|
flex-direction: column;
|
|
793
799
|
background: ${exports.colorTokens.neutral0};
|
|
794
800
|
box-sizing: border-box;
|
|
795
|
-
min-height: ${({ minHeight }) => minHeight};
|
|
801
|
+
min-height: ${({ minHeight }) => minHeight}px;
|
|
796
802
|
max-height: ${({ maxHeight }) => maxHeight}px;
|
|
797
803
|
flex: 1;
|
|
798
|
-
${({ isIncludeHeader }) => getModalBodyTopBottomPadding(isIncludeHeader)}
|
|
804
|
+
${({ isIncludeHeader, sizeVar }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar)}
|
|
799
805
|
`;
|
|
800
806
|
var ModalBodyContainerInner = styled6__default.default.div`
|
|
801
807
|
display: grid;
|
|
@@ -812,6 +818,9 @@ var ModalBodyContent = styled6__default.default.div`
|
|
|
812
818
|
height: 100%;
|
|
813
819
|
box-sizing: border-box;
|
|
814
820
|
padding: 0 24px;
|
|
821
|
+
${({ sizeVar }) => sizeVar === "FULL" && react$1.css`
|
|
822
|
+
padding: 0;
|
|
823
|
+
`};
|
|
815
824
|
background: ${exports.colorTokens.neutral0};
|
|
816
825
|
`;
|
|
817
826
|
var FooterContainer = styled6__default.default.div`
|
|
@@ -947,6 +956,9 @@ var ModalBody = ({
|
|
|
947
956
|
}, [isIncludeFooter, isIncludeHeader]);
|
|
948
957
|
const headerFooterHeight = React3.useMemo(() => getHeaderFooterHeight(), [getHeaderFooterHeight]);
|
|
949
958
|
const setAutoHeightMin = () => {
|
|
959
|
+
if (sizeVar === "FULL") {
|
|
960
|
+
return windowHeight - topBottomMargin - headerFooterHeight;
|
|
961
|
+
}
|
|
950
962
|
if (modalContainerHeight) {
|
|
951
963
|
if (modalContainerHeight <= 1200) {
|
|
952
964
|
if (windowHeight < modalContainerHeight) {
|
|
@@ -960,10 +972,10 @@ var ModalBody = ({
|
|
|
960
972
|
}
|
|
961
973
|
};
|
|
962
974
|
const setAutoHeightMax = () => {
|
|
975
|
+
if (sizeVar === "FULL") {
|
|
976
|
+
return windowHeight;
|
|
977
|
+
}
|
|
963
978
|
if (modalContainerHeight) {
|
|
964
|
-
if (sizeVar === "FULL") {
|
|
965
|
-
return windowHeight;
|
|
966
|
-
}
|
|
967
979
|
if (modalContainerHeight > 1200) {
|
|
968
980
|
return 1200 - topBottomMargin - headerFooterHeight;
|
|
969
981
|
}
|
|
@@ -992,21 +1004,30 @@ var ModalBody = ({
|
|
|
992
1004
|
}
|
|
993
1005
|
return autoHeightMax;
|
|
994
1006
|
};
|
|
995
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
996
|
-
|
|
1007
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
|
+
BodyContainer,
|
|
997
1009
|
{
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1010
|
+
isIncludeHeader,
|
|
1011
|
+
sizeVar,
|
|
1012
|
+
minHeight: setAutoHeightMin(),
|
|
1013
|
+
maxHeight: setAutoHeightMax(),
|
|
1014
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1015
|
+
exports.ScrollArea,
|
|
1016
|
+
{
|
|
1017
|
+
id: `scrollbar`,
|
|
1018
|
+
universal: true,
|
|
1019
|
+
autoHeight: !modalContainerHeight,
|
|
1020
|
+
autoHeightMin: setAutoHeightMin(),
|
|
1021
|
+
autoHeightMax: setContentHeightMax(),
|
|
1022
|
+
style: {
|
|
1023
|
+
height: "100%",
|
|
1024
|
+
overflow: "hidden"
|
|
1025
|
+
},
|
|
1026
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
|
|
1027
|
+
}
|
|
1028
|
+
)
|
|
1008
1029
|
}
|
|
1009
|
-
)
|
|
1030
|
+
);
|
|
1010
1031
|
};
|
|
1011
1032
|
var ModalBody_default = ModalBody;
|
|
1012
1033
|
var ModalHeader = ({ children }) => {
|