@yosgo/swap-ui 1.0.140 → 1.0.142

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.
@@ -13,6 +13,7 @@ export interface ModalProps {
13
13
  footerDisplayColumn?: boolean;
14
14
  mobile?: boolean;
15
15
  fullWidth?: boolean;
16
+ fullScreen?: boolean;
16
17
  onClose: () => void;
17
18
  width?: string | number;
18
19
  maxWidth?: string | number;
@@ -7371,8 +7371,8 @@ var useStyles$f = makeStyles$1(function (theme) { return ({
7371
7371
  border: "unset",
7372
7372
  borderRadius: 12,
7373
7373
  margin: function (_a) {
7374
- var fullWidth = _a.fullWidth, match_XS = _a.match_XS;
7375
- return fullWidth ? 0 : match_XS ? "0px 24px" : "0px 16px";
7374
+ var fullWidth = _a.fullWidth, fullScreen = _a.fullScreen, match_XS = _a.match_XS;
7375
+ return fullWidth || fullScreen ? 0 : match_XS ? "0px 24px" : "0px 16px";
7376
7376
  },
7377
7377
  },
7378
7378
  backdrop: {
@@ -7380,36 +7380,44 @@ var useStyles$f = makeStyles$1(function (theme) { return ({
7380
7380
  },
7381
7381
  modal: {
7382
7382
  width: function (_a) {
7383
- var width = _a.width, size = _a.size;
7384
- return width
7385
- ? width
7386
- : size === "large"
7387
- ? 800
7388
- : size === "medium"
7389
- ? 640
7390
- : size === "small"
7391
- ? 480
7392
- : size === "extraSmall"
7393
- ? 320
7394
- : "100%";
7383
+ var fullScreen = _a.fullScreen, width = _a.width, size = _a.size;
7384
+ return fullScreen
7385
+ ? "100vw"
7386
+ : width
7387
+ ? width
7388
+ : size === "large"
7389
+ ? 800
7390
+ : size === "medium"
7391
+ ? 640
7392
+ : size === "small"
7393
+ ? 480
7394
+ : size === "extraSmall"
7395
+ ? 320
7396
+ : "100%";
7395
7397
  },
7396
7398
  maxWidth: function (_a) {
7397
7399
  var maxWidth = _a.maxWidth;
7398
7400
  return maxWidth;
7399
7401
  },
7400
7402
  borderRadius: function (_a) {
7401
- var fullWidth = _a.fullWidth;
7402
- return fullWidth ? "12px 12px 0px 0px" : 12;
7403
+ var fullWidth = _a.fullWidth, fullScreen = _a.fullScreen;
7404
+ return fullScreen ? 0 : fullWidth ? "12px 12px 0px 0px" : 12;
7403
7405
  },
7404
7406
  border: "unset",
7405
- boxShadow: theme.boxShadow.l,
7407
+ boxShadow: function (_a) {
7408
+ var fullScreen = _a.fullScreen;
7409
+ return fullScreen ? "unset" : theme.boxShadow.l;
7410
+ },
7406
7411
  display: "flex",
7407
7412
  flexDirection: "column",
7408
7413
  outline: 0,
7409
7414
  },
7410
7415
  head: {
7411
7416
  height: "100%",
7412
- borderRadius: "12px 12px 0px 0px",
7417
+ borderRadius: function (_a) {
7418
+ var fullScreen = _a.fullScreen;
7419
+ return fullScreen ? 0 : "12px 12px 0px 0px";
7420
+ },
7413
7421
  padding: function (_a) {
7414
7422
  var headpadding = _a.headpadding, mobile = _a.mobile, disCloseIcon = _a.disCloseIcon, helpText = _a.helpText, multiline = _a.multiline;
7415
7423
  return headpadding
@@ -7689,8 +7697,8 @@ var useStyles$f = makeStyles$1(function (theme) { return ({
7689
7697
  body: {
7690
7698
  transition: "all 0.2s ease-in-out",
7691
7699
  height: function (_a) {
7692
- var height = _a.height;
7693
- return (height ? height : "100%");
7700
+ var fullScreen = _a.fullScreen, height = _a.height;
7701
+ return fullScreen ? "calc(100dvh - 146px)" : height ? height : "100%";
7694
7702
  },
7695
7703
  padding: function (_a) {
7696
7704
  var bodyPadding = _a.bodyPadding, mobile = _a.mobile;
@@ -7702,8 +7710,14 @@ var useStyles$f = makeStyles$1(function (theme) { return ({
7702
7710
  return (onExit ? "none" : "unset");
7703
7711
  },
7704
7712
  maxHeight: function (_a) {
7705
- var bodyMaxHeight = _a.bodyMaxHeight, fullWidth = _a.fullWidth, clientHeight = _a.clientHeight;
7706
- return bodyMaxHeight ? bodyMaxHeight : fullWidth ? clientHeight : "unset";
7713
+ var bodyMaxHeight = _a.bodyMaxHeight, fullWidth = _a.fullWidth, fullScreen = _a.fullScreen, clientHeight = _a.clientHeight;
7714
+ return fullScreen
7715
+ ? "calc(100dvh - 146px)"
7716
+ : bodyMaxHeight
7717
+ ? bodyMaxHeight
7718
+ : fullWidth
7719
+ ? clientHeight
7720
+ : "unset";
7707
7721
  },
7708
7722
  overflowY: function (_a) {
7709
7723
  var onExit = _a.onExit;
@@ -7757,7 +7771,7 @@ var useStyles$f = makeStyles$1(function (theme) { return ({
7757
7771
  },
7758
7772
  }); });
7759
7773
  var Modal = React__default.forwardRef(function (props, ref) {
7760
- var width = props.width, height = props.height, open = props.open, onClose = props.onClose, title = props.title, helpText = props.helpText, size = props.size, headpadding = props.headpadding, headChildren = props.headChildren, checked = props.checked, failed = props.failed, icon = props.icon, checkIconColor = props.checkIconColor, iconColor = props.iconColor, children = props.children, label = props.label, buttonFullWidth = props.buttonFullWidth, footerDisplayColumn = props.footerDisplayColumn, secondaryButton = props.secondaryButton, primaryButton = props.primaryButton, mobile = props.mobile, fullWidth = props.fullWidth, bodyPadding = props.bodyPadding, maxWidth = props.maxWidth, disCloseIcon = props.disCloseIcon, titleStyle = props.titleStyle, bodyStyle = props.bodyStyle, onExit = props.onExit, bodyMaxHeight = props.bodyMaxHeight, multiline = props.multiline, disUnderLine = props.disUnderLine, footer = props.footer;
7774
+ var width = props.width, height = props.height, open = props.open, onClose = props.onClose, title = props.title, helpText = props.helpText, size = props.size, headpadding = props.headpadding, headChildren = props.headChildren, checked = props.checked, failed = props.failed, icon = props.icon, checkIconColor = props.checkIconColor, iconColor = props.iconColor, children = props.children, label = props.label, buttonFullWidth = props.buttonFullWidth, footerDisplayColumn = props.footerDisplayColumn, secondaryButton = props.secondaryButton, primaryButton = props.primaryButton, mobile = props.mobile, fullWidth = props.fullWidth, fullScreen = props.fullScreen, bodyPadding = props.bodyPadding, maxWidth = props.maxWidth, disCloseIcon = props.disCloseIcon, titleStyle = props.titleStyle, bodyStyle = props.bodyStyle, onExit = props.onExit, bodyMaxHeight = props.bodyMaxHeight, multiline = props.multiline, disUnderLine = props.disUnderLine, footer = props.footer;
7761
7775
  var _a = useState(0), clientHeight = _a[0], setClientHeight = _a[1];
7762
7776
  var _b = useState(0), scorllbarWidth = _b[0], setScorllbarWidth = _b[1];
7763
7777
  useEffect(function () {
@@ -7783,6 +7797,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
7783
7797
  var match_XS = useBreakpoints("xs");
7784
7798
  var classes = useStyles$f({
7785
7799
  fullWidth: fullWidth,
7800
+ fullScreen: fullScreen,
7786
7801
  match_XS: match_XS,
7787
7802
  width: width,
7788
7803
  size: size,
@@ -7809,7 +7824,7 @@ var Modal = React__default.forwardRef(function (props, ref) {
7809
7824
  className: classes.backdrop,
7810
7825
  style: { overflow: "auto", WebkitOverflowScrolling: "touch" },
7811
7826
  } },
7812
- React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth, style: {
7827
+ React__default.createElement(ModalTransitionEffect, { in: open, slide: fullWidth || fullScreen, style: {
7813
7828
  outline: "none",
7814
7829
  transition: "ease-in-out",
7815
7830
  width: "100%",
@@ -7861,7 +7876,10 @@ var Modal = React__default.forwardRef(function (props, ref) {
7861
7876
  : mobile
7862
7877
  ? -16
7863
7878
  : -24,
7864
- position: bodyMaxHeight || height || (mobile && fullWidth)
7879
+ position: bodyMaxHeight ||
7880
+ height ||
7881
+ (mobile && fullWidth) ||
7882
+ fullScreen
7865
7883
  ? "fixed"
7866
7884
  : "absolute",
7867
7885
  width: width
@@ -7875,13 +7893,15 @@ var Modal = React__default.forwardRef(function (props, ref) {
7875
7893
  : size === "extraSmall"
7876
7894
  ? 320
7877
7895
  : "100%",
7878
- height: bodyMaxHeight
7879
- ? bodyMaxHeight
7880
- : height
7881
- ? height
7882
- : mobile && fullWidth
7883
- ? clientHeight
7884
- : "100%",
7896
+ height: fullScreen
7897
+ ? "100dvh"
7898
+ : bodyMaxHeight
7899
+ ? bodyMaxHeight
7900
+ : height
7901
+ ? height
7902
+ : mobile && fullWidth
7903
+ ? clientHeight
7904
+ : "100%",
7885
7905
  background: "black",
7886
7906
  opacity: 0.5,
7887
7907
  zIndex: 10,