@yosgo/swap-ui 1.0.124 → 1.0.127

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.
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
+ import { MyTooltipProps } from "../Tooltip/Tooltip.types";
3
+ declare type OmitTooltipProps = Omit<MyTooltipProps, "children">;
2
4
  export interface ModalProps {
3
5
  footer?: React.ReactNode;
4
6
  multiline?: boolean;
@@ -32,6 +34,7 @@ export interface ModalProps {
32
34
  style?: React.CSSProperties;
33
35
  variant?: "primary" | "secondary" | "text" | "tertiary" | "black" | "danger";
34
36
  loading?: boolean;
37
+ tooltip?: OmitTooltipProps;
35
38
  };
36
39
  primaryButton?: {
37
40
  title?: string | React.ReactNode;
@@ -40,6 +43,7 @@ export interface ModalProps {
40
43
  style?: React.CSSProperties;
41
44
  variant?: "primary" | "secondary" | "text" | "tertiary" | "black" | "danger";
42
45
  loading?: boolean;
46
+ tooltip?: OmitTooltipProps;
43
47
  };
44
48
  disUnderLine?: boolean;
45
49
  disCloseIcon?: boolean;
@@ -47,3 +51,4 @@ export interface ModalProps {
47
51
  checkIconColor?: "primary" | "secondary" | "tertiary" | "primary50" | "primary100" | "primary200" | "primary300" | "primary400" | "primary500" | "primary600" | "primary700" | "primary800" | "primary900" | "primaryA11y" | "secondary50" | "secondary100" | "secondary200" | "secondary300" | "secondary400" | "secondary500" | "secondary600" | "secondary700" | "secondary800" | "secondary900" | "secondaryA11y" | "danger50" | "danger100" | "danger200" | "danger300" | "danger400" | "danger500" | "danger600" | "danger700" | "danger800" | "danger900" | "dangerA11y" | "success50" | "success100" | "success200" | "success300" | "success400" | "success500" | "success600" | "success700" | "success800" | "success900" | "successA11y" | "white" | "black100" | "black200" | "black300" | "black400" | "black500" | "black600" | "black700" | "black800" | "black900" | "black1000";
48
52
  iconColor?: "primary" | "secondary" | "tertiary" | "primary50" | "primary100" | "primary200" | "primary300" | "primary400" | "primary500" | "primary600" | "primary700" | "primary800" | "primary900" | "primaryA11y" | "secondary50" | "secondary100" | "secondary200" | "secondary300" | "secondary400" | "secondary500" | "secondary600" | "secondary700" | "secondary800" | "secondary900" | "secondaryA11y" | "danger50" | "danger100" | "danger200" | "danger300" | "danger400" | "danger500" | "danger600" | "danger700" | "danger800" | "danger900" | "dangerA11y" | "success50" | "success100" | "success200" | "success300" | "success400" | "success500" | "success600" | "success700" | "success800" | "success900" | "successA11y" | "white" | "black100" | "black200" | "black300" | "black400" | "black500" | "black600" | "black700" | "black800" | "black900" | "black1000";
49
53
  }
54
+ export {};
@@ -6662,6 +6662,58 @@ const host = createHost(primitives, {
6662
6662
  });
6663
6663
  const animated = host.animated;
6664
6664
 
6665
+ var useStyles$a = makeStyles$1(function (theme) { return ({
6666
+ root: function (props) { return ({
6667
+ margin: props.margin,
6668
+ backgroundColor: props.backgroundColor,
6669
+ color: props.color,
6670
+ padding: props.padding,
6671
+ boxShadow: theme.boxShadow.m,
6672
+ border: props.border,
6673
+ maxWidth: props.width,
6674
+ fontSize: 12,
6675
+ lineHeight: 1.4,
6676
+ fontWeight: props.fontWeight,
6677
+ }); },
6678
+ arrow: function (props) { return ({
6679
+ color: props.backgroundColor,
6680
+ }); },
6681
+ }); });
6682
+ var Tooltip = function (props) {
6683
+ var theme = useTheme$1();
6684
+ var arrow = props.arrow, margin = props.margin, marginTop = props.marginTop, marginBottom = props.marginBottom, marginRight = props.marginRight, marginLeft = props.marginLeft, dark = props.dark, light = props.light, children = props.children, width = props.width, childrenStyle = props.childrenStyle, other = __rest(props, ["arrow", "margin", "marginTop", "marginBottom", "marginRight", "marginLeft", "dark", "light", "children", "width", "childrenStyle"]);
6685
+ var styleProps = {
6686
+ width: width ? width : 240,
6687
+ padding: arrow ? "7.5px 12px" : 12,
6688
+ margin: margin
6689
+ ? margin
6690
+ : marginTop
6691
+ ? "0px 0px " + marginTop + "px 0px"
6692
+ : marginBottom
6693
+ ? marginBottom + "px 0px 0px 0px"
6694
+ : marginRight
6695
+ ? "0px 0px 0px " + marginRight + "px"
6696
+ : marginLeft
6697
+ ? "0px " + marginLeft + "px 0px 0px"
6698
+ : "10px 0px",
6699
+ backgroundColor: dark
6700
+ ? theme.black.black900
6701
+ : light
6702
+ ? theme.black.white
6703
+ : theme.black.black900,
6704
+ color: dark
6705
+ ? theme.black.white
6706
+ : light
6707
+ ? theme.black.black800
6708
+ : theme.black.white,
6709
+ border: light ? "1px solid #CCCCCC" : null,
6710
+ fontWeight: arrow ? 700 : 400,
6711
+ };
6712
+ var classes = useStyles$a(styleProps);
6713
+ return (React__default.createElement(MaterialTooltip, __assign({ classes: { tooltip: classes.root, arrow: classes.arrow } }, other, { arrow: arrow }),
6714
+ React__default.createElement("div", { style: __assign({ width: "fit-content", height: "fit-content", display: "flex", alignItems: "center", justifyContent: "center" }, childrenStyle) }, children)));
6715
+ };
6716
+
6665
6717
  var ModalTransitionEffect = React__default.forwardRef(function ModalTransitionEffect(props, ref) {
6666
6718
  var open = props.in, slide = props.slide, children = props.children, onEnter = props.onEnter, onExited = props.onExited, style = props.style, other = __rest(props, ["in", "slide", "children", "onEnter", "onExited", "style"]);
6667
6719
  var defaultStyle = useSpring({
@@ -7151,15 +7203,21 @@ var Modal = React__default.forwardRef(function (props, ref) {
7151
7203
  secondaryButton || primaryButton ? (React__default.createElement(Box, { className: classes.footerButton },
7152
7204
  React__default.createElement(Box, { width: mobile && !buttonFullWidth && !footerDisplayColumn
7153
7205
  ? null
7154
- : "100%", marginRight: !footerDisplayColumn && secondaryButton ? 1 : 0 }, secondaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
7206
+ : "100%", marginRight: !footerDisplayColumn && secondaryButton ? 1 : 0 }, secondaryButton ? (secondaryButton.tooltip ? (React__default.createElement(Tooltip, __assign({}, secondaryButton.tooltip),
7207
+ React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
7208
+ ? secondaryButton.variant
7209
+ : "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title))) : (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn, variant: secondaryButton.variant
7155
7210
  ? secondaryButton.variant
7156
- : "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title)) : null),
7157
- React__default.createElement(Box, { width: "100%", marginBottom: footerDisplayColumn ? 1 : 0 }, primaryButton ? (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
7211
+ : "secondary", size: "small", onClick: secondaryButton.onClick, disabled: secondaryButton.disabled, loading: secondaryButton.loading, style: secondaryButton.style }, secondaryButton.title))) : null),
7212
+ React__default.createElement(Box, { width: "100%", marginBottom: footerDisplayColumn ? 1 : 0 }, primaryButton ? (primaryButton.tooltip ? (React__default.createElement(Tooltip, __assign({}, primaryButton.tooltip),
7213
+ React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
7214
+ ? primaryButton.variant
7215
+ : "primary", size: "small", onClick: primaryButton.onClick, disabled: primaryButton.disabled, loading: primaryButton.loading, style: primaryButton.style }, primaryButton.title))) : (React__default.createElement(Button, { fullWidth: buttonFullWidth || footerDisplayColumn || mobile, variant: primaryButton.variant
7158
7216
  ? primaryButton.variant
7159
- : "primary", size: "small", onClick: primaryButton.onClick, disabled: primaryButton.disabled, loading: primaryButton.loading, style: primaryButton.style }, primaryButton.title)) : null))) : null)))))));
7217
+ : "primary", size: "small", onClick: primaryButton.onClick, disabled: primaryButton.disabled, loading: primaryButton.loading, style: primaryButton.style }, primaryButton.title))) : null))) : null)))))));
7160
7218
  });
7161
7219
 
7162
- var useStyles$a = makeStyles$1(function () { return ({
7220
+ var useStyles$b = makeStyles$1(function () { return ({
7163
7221
  root: function (props) { return ({
7164
7222
  backgroundColor: props.backgroundColor,
7165
7223
  border: "1px solid " + props.borderColor,
@@ -7207,7 +7265,7 @@ var Banner = function (props) {
7207
7265
  height: height ? height : null,
7208
7266
  alignItems: mobile ? "flex-start" : alignStart ? "flex-start" : "center",
7209
7267
  };
7210
- var classes = useStyles$a(styleProps);
7268
+ var classes = useStyles$b(styleProps);
7211
7269
  var ref = useRef(null);
7212
7270
  useEffect(function () {
7213
7271
  if (ref.current) {
@@ -7233,7 +7291,7 @@ var Banner = function (props) {
7233
7291
  React__default.createElement(Typography, { variant: "caption2" }, children)));
7234
7292
  };
7235
7293
 
7236
- var useStyles$b = makeStyles$1(function () { return ({
7294
+ var useStyles$c = makeStyles$1(function () { return ({
7237
7295
  root: function (props) { return ({
7238
7296
  backgroundColor: props.backgroundColor,
7239
7297
  border: props.border,
@@ -7247,7 +7305,6 @@ var useStyles$b = makeStyles$1(function () { return ({
7247
7305
  fontSize: "0.75rem",
7248
7306
  lineHeight: "17px",
7249
7307
  fontWeight: 700,
7250
- marginRight: props.marginRight,
7251
7308
  color: props.color,
7252
7309
  }); },
7253
7310
  }); });
@@ -7289,11 +7346,10 @@ var Chip = function (props) {
7289
7346
  : variant === "danger"
7290
7347
  ? theme.danger.danger800
7291
7348
  : theme.primary.primary800,
7292
- marginRight: variant === "success" ? 4 : 0,
7293
7349
  };
7294
- var classes = useStyles$b(styleProps);
7350
+ var classes = useStyles$c(styleProps);
7295
7351
  return (React__default.createElement("div", __assign({ className: classes.root }, other),
7296
- label,
7352
+ React__default.createElement("span", { style: { marginRight: variant === "success" ? 4 : 0 } }, label),
7297
7353
  variant === "success" && !icon ? icon_success : icon));
7298
7354
  };
7299
7355
  var icon_success = (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -7322,58 +7378,6 @@ var CircularProgress = function (props) {
7322
7378
  } })));
7323
7379
  };
7324
7380
 
7325
- var useStyles$c = makeStyles$1(function (theme) { return ({
7326
- root: function (props) { return ({
7327
- margin: props.margin,
7328
- backgroundColor: props.backgroundColor,
7329
- color: props.color,
7330
- padding: props.padding,
7331
- boxShadow: theme.boxShadow.m,
7332
- border: props.border,
7333
- maxWidth: props.width,
7334
- fontSize: 12,
7335
- lineHeight: 1.4,
7336
- fontWeight: props.fontWeight,
7337
- }); },
7338
- arrow: function (props) { return ({
7339
- color: props.backgroundColor,
7340
- }); },
7341
- }); });
7342
- var Tooltip = function (props) {
7343
- var theme = useTheme$1();
7344
- var arrow = props.arrow, margin = props.margin, marginTop = props.marginTop, marginBottom = props.marginBottom, marginRight = props.marginRight, marginLeft = props.marginLeft, dark = props.dark, light = props.light, children = props.children, width = props.width, childrenStyle = props.childrenStyle, other = __rest(props, ["arrow", "margin", "marginTop", "marginBottom", "marginRight", "marginLeft", "dark", "light", "children", "width", "childrenStyle"]);
7345
- var styleProps = {
7346
- width: width ? width : 240,
7347
- padding: arrow ? "7.5px 12px" : 12,
7348
- margin: margin
7349
- ? margin
7350
- : marginTop
7351
- ? "0px 0px " + marginTop + "px 0px"
7352
- : marginBottom
7353
- ? marginBottom + "px 0px 0px 0px"
7354
- : marginRight
7355
- ? "0px 0px 0px " + marginRight + "px"
7356
- : marginLeft
7357
- ? "0px " + marginLeft + "px 0px 0px"
7358
- : "10px 0px",
7359
- backgroundColor: dark
7360
- ? theme.black.black900
7361
- : light
7362
- ? theme.black.white
7363
- : theme.black.black900,
7364
- color: dark
7365
- ? theme.black.white
7366
- : light
7367
- ? theme.black.black800
7368
- : theme.black.white,
7369
- border: light ? "1px solid #CCCCCC" : null,
7370
- fontWeight: arrow ? 700 : 400,
7371
- };
7372
- var classes = useStyles$c(styleProps);
7373
- return (React__default.createElement(MaterialTooltip, __assign({ classes: { tooltip: classes.root, arrow: classes.arrow } }, other, { arrow: arrow }),
7374
- React__default.createElement("div", { style: __assign({ width: "fit-content", height: "fit-content", display: "flex", alignItems: "center", justifyContent: "center" }, childrenStyle) }, children)));
7375
- };
7376
-
7377
7381
  function _extends() {
7378
7382
  _extends = Object.assign || function (target) {
7379
7383
  for (var i = 1; i < arguments.length; i++) {
@@ -12742,10 +12746,15 @@ var DatePicker = function (props) {
12742
12746
  var open = props.open, onClose = props.onClose, format = props.format, mobile = props.mobile, min = props.min, max = props.max, ModalProps = props.ModalProps, defaultValue = props.defaultValue, getValue = props.getValue, value = props.value, other = __rest(props, ["open", "onClose", "format", "mobile", "min", "max", "ModalProps", "defaultValue", "getValue", "value"]);
12743
12747
  var _a = useState(Number(new Date().getFullYear())), year = _a[0], setYear = _a[1];
12744
12748
  var _b = useState(Number(new Date().getMonth() + 1)), month = _b[0], setMonth = _b[1];
12745
- var _c = useState(1), nextMonth = _c[0], setNextMonth = _c[1];
12749
+ var _c = useState(Number(new Date().getMonth() + 2)), nextMonth = _c[0], setNextMonth = _c[1];
12746
12750
  var _d = useState(""), date = _d[0], setDate = _d[1];
12747
12751
  var _e = useState(false), isOpenMonthSelector = _e[0], setIsOpenMonthSelector = _e[1];
12748
12752
  var _f = useState(false), isClicked = _f[0], setIsClicked = _f[1];
12753
+ useEffect(function () {
12754
+ if (month === 12) {
12755
+ setNextMonth(1);
12756
+ }
12757
+ }, []);
12749
12758
  useEffect(function () {
12750
12759
  if (format === "month") {
12751
12760
  if (month % 2 === 0) {