@shoplflow/base 0.42.18 → 0.42.20
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 +16 -9
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -753,8 +753,8 @@ var getModalWidthFromSize = (size2) => {
|
|
|
753
753
|
return MODAL_SIZE_M;
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
|
-
var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar) => {
|
|
757
|
-
if (sizeVar === "FULL") {
|
|
756
|
+
var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar, padding) => {
|
|
757
|
+
if (sizeVar === "FULL" || padding) {
|
|
758
758
|
return react$1.css`
|
|
759
759
|
padding-top: 0;
|
|
760
760
|
padding-bottom: 0;
|
|
@@ -792,6 +792,9 @@ var checkMaxHeight = (height, viewport) => {
|
|
|
792
792
|
return height - topBottomMargin;
|
|
793
793
|
};
|
|
794
794
|
var Container = styled6__default.default.div`
|
|
795
|
+
transition:
|
|
796
|
+
width 0.3s ease-in-out,
|
|
797
|
+
max-width 0.3s ease-in-out;
|
|
795
798
|
display: flex;
|
|
796
799
|
flex-direction: column;
|
|
797
800
|
border-radius: ${exports.borderRadiusTokens.borderRadius08};
|
|
@@ -831,7 +834,7 @@ var BodyContainer = styled6__default.default.div`
|
|
|
831
834
|
min-height: ${({ minHeight }) => minHeight}px;
|
|
832
835
|
max-height: ${({ maxHeight }) => maxHeight}px;
|
|
833
836
|
flex: 1;
|
|
834
|
-
${({ isIncludeHeader, sizeVar }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar)};
|
|
837
|
+
${({ isIncludeHeader, sizeVar, padding }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar, padding)};
|
|
835
838
|
`;
|
|
836
839
|
var ModalBodyContainerInner = styled6__default.default.div`
|
|
837
840
|
display: grid;
|
|
@@ -847,7 +850,7 @@ var ModalBodyContent = styled6__default.default.div`
|
|
|
847
850
|
flex-direction: column;
|
|
848
851
|
height: 100%;
|
|
849
852
|
box-sizing: border-box;
|
|
850
|
-
padding: 0 24px;
|
|
853
|
+
padding: ${({ padding }) => padding || "0 24px"};
|
|
851
854
|
${({ sizeVar }) => sizeVar === "FULL" && react$1.css`
|
|
852
855
|
padding: 0;
|
|
853
856
|
`};
|
|
@@ -997,7 +1000,8 @@ var ModalBody = ({
|
|
|
997
1000
|
isIncludeHeader = false,
|
|
998
1001
|
isIncludeFooter = false,
|
|
999
1002
|
sizeVar,
|
|
1000
|
-
height: modalContainerHeight
|
|
1003
|
+
height: modalContainerHeight,
|
|
1004
|
+
padding
|
|
1001
1005
|
}) => {
|
|
1002
1006
|
const { height: windowHeight } = useViewportSizeObserver();
|
|
1003
1007
|
const { heightToDeduct } = useModalOption();
|
|
@@ -1055,11 +1059,13 @@ var ModalBody = ({
|
|
|
1055
1059
|
};
|
|
1056
1060
|
const setContentHeightMax = () => {
|
|
1057
1061
|
let autoHeightMax = setAutoHeightMax();
|
|
1058
|
-
|
|
1062
|
+
if (padding) {
|
|
1063
|
+
return autoHeightMax;
|
|
1064
|
+
}
|
|
1059
1065
|
if (isIncludeHeader) {
|
|
1060
1066
|
autoHeightMax = autoHeightMax - 24;
|
|
1061
1067
|
}
|
|
1062
|
-
if (
|
|
1068
|
+
if (isIncludeFooter) {
|
|
1063
1069
|
autoHeightMax = autoHeightMax - 16;
|
|
1064
1070
|
}
|
|
1065
1071
|
return autoHeightMax;
|
|
@@ -1073,6 +1079,7 @@ var ModalBody = ({
|
|
|
1073
1079
|
sizeVar,
|
|
1074
1080
|
minHeight: _autoHeightMin,
|
|
1075
1081
|
maxHeight: setAutoHeightMax() - heightToDeduct,
|
|
1082
|
+
padding,
|
|
1076
1083
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1077
1084
|
exports.ScrollArea,
|
|
1078
1085
|
{
|
|
@@ -1082,7 +1089,7 @@ var ModalBody = ({
|
|
|
1082
1089
|
autoHeightMin: _autoHeightMin,
|
|
1083
1090
|
autoHeightMax: setContentHeightMax() - heightToDeduct,
|
|
1084
1091
|
style: {},
|
|
1085
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
|
|
1092
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContent, { isIncludeHeader, sizeVar, padding, children }) })
|
|
1086
1093
|
}
|
|
1087
1094
|
)
|
|
1088
1095
|
}
|
|
@@ -3609,7 +3616,7 @@ exports.TreeItem = (_a) => {
|
|
|
3609
3616
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.RightArrowSolidXsmallIcon, sizeVar: "XS", color: "neutral400" })
|
|
3610
3617
|
}
|
|
3611
3618
|
) }),
|
|
3612
|
-
isLastTree && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "24px", height: "24px", visibility: "hidden" } }),
|
|
3619
|
+
isLastTree && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "24px", height: "24px", visibility: "hidden", flexShrink: 0 } }),
|
|
3613
3620
|
LeftSourceClone && LeftSourceClone,
|
|
3614
3621
|
/* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer, { padding: "0 0 0 4px", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_400", wordBreak: "break-all", color: disabled ? "neutral350" : "neutral700", children: label }) })
|
|
3615
3622
|
] }),
|
package/dist/index.d.cts
CHANGED
|
@@ -502,6 +502,7 @@ interface ModalBodyOptionProps {
|
|
|
502
502
|
isIncludeFooter?: boolean;
|
|
503
503
|
height?: number;
|
|
504
504
|
sizeVar?: ModalSizeType;
|
|
505
|
+
padding?: CSSProperties['padding'];
|
|
505
506
|
}
|
|
506
507
|
interface ModalFooterProps extends ModalFooterOptionProps, ChildrenProps {
|
|
507
508
|
}
|
|
@@ -549,7 +550,7 @@ declare const Modal: {
|
|
|
549
550
|
Container: ({ children, height, outsideClick, ...rest }: ModalContainerProps) => react_jsx_runtime.JSX.Element;
|
|
550
551
|
Header: ModalHeaderType;
|
|
551
552
|
Top: ({ children }: ModalTopProps) => react_jsx_runtime.JSX.Element;
|
|
552
|
-
Body: ({ children, isIncludeHeader, isIncludeFooter, sizeVar, height: modalContainerHeight, }: ModalBodyProps) => react_jsx_runtime.JSX.Element;
|
|
553
|
+
Body: ({ children, isIncludeHeader, isIncludeFooter, sizeVar, height: modalContainerHeight, padding, }: ModalBodyProps) => react_jsx_runtime.JSX.Element;
|
|
553
554
|
Bottom: ({ children }: ModalBottomProps) => react_jsx_runtime.JSX.Element;
|
|
554
555
|
Footer: ModalFooterType;
|
|
555
556
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -502,6 +502,7 @@ interface ModalBodyOptionProps {
|
|
|
502
502
|
isIncludeFooter?: boolean;
|
|
503
503
|
height?: number;
|
|
504
504
|
sizeVar?: ModalSizeType;
|
|
505
|
+
padding?: CSSProperties['padding'];
|
|
505
506
|
}
|
|
506
507
|
interface ModalFooterProps extends ModalFooterOptionProps, ChildrenProps {
|
|
507
508
|
}
|
|
@@ -549,7 +550,7 @@ declare const Modal: {
|
|
|
549
550
|
Container: ({ children, height, outsideClick, ...rest }: ModalContainerProps) => react_jsx_runtime.JSX.Element;
|
|
550
551
|
Header: ModalHeaderType;
|
|
551
552
|
Top: ({ children }: ModalTopProps) => react_jsx_runtime.JSX.Element;
|
|
552
|
-
Body: ({ children, isIncludeHeader, isIncludeFooter, sizeVar, height: modalContainerHeight, }: ModalBodyProps) => react_jsx_runtime.JSX.Element;
|
|
553
|
+
Body: ({ children, isIncludeHeader, isIncludeFooter, sizeVar, height: modalContainerHeight, padding, }: ModalBodyProps) => react_jsx_runtime.JSX.Element;
|
|
553
554
|
Bottom: ({ children }: ModalBottomProps) => react_jsx_runtime.JSX.Element;
|
|
554
555
|
Footer: ModalFooterType;
|
|
555
556
|
};
|
package/dist/index.js
CHANGED
|
@@ -726,8 +726,8 @@ var getModalWidthFromSize = (size2) => {
|
|
|
726
726
|
return MODAL_SIZE_M;
|
|
727
727
|
}
|
|
728
728
|
};
|
|
729
|
-
var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar) => {
|
|
730
|
-
if (sizeVar === "FULL") {
|
|
729
|
+
var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar, padding) => {
|
|
730
|
+
if (sizeVar === "FULL" || padding) {
|
|
731
731
|
return css`
|
|
732
732
|
padding-top: 0;
|
|
733
733
|
padding-bottom: 0;
|
|
@@ -765,6 +765,9 @@ var checkMaxHeight = (height, viewport) => {
|
|
|
765
765
|
return height - topBottomMargin;
|
|
766
766
|
};
|
|
767
767
|
var Container = styled6.div`
|
|
768
|
+
transition:
|
|
769
|
+
width 0.3s ease-in-out,
|
|
770
|
+
max-width 0.3s ease-in-out;
|
|
768
771
|
display: flex;
|
|
769
772
|
flex-direction: column;
|
|
770
773
|
border-radius: ${borderRadiusTokens.borderRadius08};
|
|
@@ -804,7 +807,7 @@ var BodyContainer = styled6.div`
|
|
|
804
807
|
min-height: ${({ minHeight }) => minHeight}px;
|
|
805
808
|
max-height: ${({ maxHeight }) => maxHeight}px;
|
|
806
809
|
flex: 1;
|
|
807
|
-
${({ isIncludeHeader, sizeVar }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar)};
|
|
810
|
+
${({ isIncludeHeader, sizeVar, padding }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar, padding)};
|
|
808
811
|
`;
|
|
809
812
|
var ModalBodyContainerInner = styled6.div`
|
|
810
813
|
display: grid;
|
|
@@ -820,7 +823,7 @@ var ModalBodyContent = styled6.div`
|
|
|
820
823
|
flex-direction: column;
|
|
821
824
|
height: 100%;
|
|
822
825
|
box-sizing: border-box;
|
|
823
|
-
padding: 0 24px;
|
|
826
|
+
padding: ${({ padding }) => padding || "0 24px"};
|
|
824
827
|
${({ sizeVar }) => sizeVar === "FULL" && css`
|
|
825
828
|
padding: 0;
|
|
826
829
|
`};
|
|
@@ -970,7 +973,8 @@ var ModalBody = ({
|
|
|
970
973
|
isIncludeHeader = false,
|
|
971
974
|
isIncludeFooter = false,
|
|
972
975
|
sizeVar,
|
|
973
|
-
height: modalContainerHeight
|
|
976
|
+
height: modalContainerHeight,
|
|
977
|
+
padding
|
|
974
978
|
}) => {
|
|
975
979
|
const { height: windowHeight } = useViewportSizeObserver();
|
|
976
980
|
const { heightToDeduct } = useModalOption();
|
|
@@ -1028,11 +1032,13 @@ var ModalBody = ({
|
|
|
1028
1032
|
};
|
|
1029
1033
|
const setContentHeightMax = () => {
|
|
1030
1034
|
let autoHeightMax = setAutoHeightMax();
|
|
1031
|
-
|
|
1035
|
+
if (padding) {
|
|
1036
|
+
return autoHeightMax;
|
|
1037
|
+
}
|
|
1032
1038
|
if (isIncludeHeader) {
|
|
1033
1039
|
autoHeightMax = autoHeightMax - 24;
|
|
1034
1040
|
}
|
|
1035
|
-
if (
|
|
1041
|
+
if (isIncludeFooter) {
|
|
1036
1042
|
autoHeightMax = autoHeightMax - 16;
|
|
1037
1043
|
}
|
|
1038
1044
|
return autoHeightMax;
|
|
@@ -1046,6 +1052,7 @@ var ModalBody = ({
|
|
|
1046
1052
|
sizeVar,
|
|
1047
1053
|
minHeight: _autoHeightMin,
|
|
1048
1054
|
maxHeight: setAutoHeightMax() - heightToDeduct,
|
|
1055
|
+
padding,
|
|
1049
1056
|
children: /* @__PURE__ */ jsx(
|
|
1050
1057
|
ScrollArea_default,
|
|
1051
1058
|
{
|
|
@@ -1055,7 +1062,7 @@ var ModalBody = ({
|
|
|
1055
1062
|
autoHeightMin: _autoHeightMin,
|
|
1056
1063
|
autoHeightMax: setContentHeightMax() - heightToDeduct,
|
|
1057
1064
|
style: {},
|
|
1058
|
-
children: /* @__PURE__ */ jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
|
|
1065
|
+
children: /* @__PURE__ */ jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsx(ModalBodyContent, { isIncludeHeader, sizeVar, padding, children }) })
|
|
1059
1066
|
}
|
|
1060
1067
|
)
|
|
1061
1068
|
}
|
|
@@ -3582,7 +3589,7 @@ var TreeItem = (_a) => {
|
|
|
3582
3589
|
children: /* @__PURE__ */ jsx(Icon_default, { iconSource: RightArrowSolidXsmallIcon, sizeVar: "XS", color: "neutral400" })
|
|
3583
3590
|
}
|
|
3584
3591
|
) }),
|
|
3585
|
-
isLastTree && /* @__PURE__ */ jsx("div", { style: { width: "24px", height: "24px", visibility: "hidden" } }),
|
|
3592
|
+
isLastTree && /* @__PURE__ */ jsx("div", { style: { width: "24px", height: "24px", visibility: "hidden", flexShrink: 0 } }),
|
|
3586
3593
|
LeftSourceClone && LeftSourceClone,
|
|
3587
3594
|
/* @__PURE__ */ jsx(StackContainer_default, { padding: "0 0 0 4px", children: /* @__PURE__ */ jsx(Text_default, { typography: "body1_400", wordBreak: "break-all", color: disabled ? "neutral350" : "neutral700", children: label }) })
|
|
3588
3595
|
] }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplflow/base",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react-dom": "^18.2.0",
|
|
92
92
|
"simplebar-react": "^3.2.6",
|
|
93
93
|
"@shoplflow/hada-assets": "^0.1.8",
|
|
94
|
-
"@shoplflow/shopl-assets": "^0.12.
|
|
94
|
+
"@shoplflow/shopl-assets": "^0.12.24",
|
|
95
95
|
"@shoplflow/utils": "^0.7.0"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|