@arcblock/ux 1.17.21 → 2.0.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.
Files changed (99) hide show
  1. package/lib/ActionButton/index.js +1 -1
  2. package/lib/ActivityIndicator/index.js +2 -2
  3. package/lib/Alert/index.js +2 -2
  4. package/lib/Async/index.js +1 -1
  5. package/lib/Badge/index.js +1 -1
  6. package/lib/Blocklet/blocklet.js +5 -5
  7. package/lib/BlockletNFT/index.js +7 -7
  8. package/lib/Button/index.js +1 -1
  9. package/lib/Button/wrap.js +2 -21
  10. package/lib/ButtonGroup/index.js +2 -2
  11. package/lib/ClickToCopy/index.js +2 -2
  12. package/lib/CodeBlock/index.js +3 -3
  13. package/lib/ContactForm/index.js +3 -3
  14. package/lib/CookieConsent/index.js +7 -3
  15. package/lib/Dialog/dialog.js +10 -9
  16. package/lib/Footer/index.js +1 -1
  17. package/lib/Header/header.js +4 -4
  18. package/lib/Header/responsive-header.js +7 -7
  19. package/lib/Icon/index.js +1 -1
  20. package/lib/Img/index.js +12 -7
  21. package/lib/InfoRow/index.js +1 -1
  22. package/lib/Layout/dashboard/header.js +9 -9
  23. package/lib/Layout/dashboard/index.js +3 -3
  24. package/lib/Layout/dashboard/sidebar.js +6 -6
  25. package/lib/Layout/index.js +19 -16
  26. package/lib/Locale/selector.js +16 -11
  27. package/lib/NFTDisplay/broken.js +1 -1
  28. package/lib/NavMenu/nav-menu.js +1 -1
  29. package/lib/PageScroller/index.js +6 -2
  30. package/lib/PricingTable/PricingPlan.js +4 -4
  31. package/lib/PricingTable/index.js +2 -2
  32. package/lib/Result/common.js +3 -3
  33. package/lib/Result/index.js +3 -6
  34. package/lib/Result/result.js +3 -2
  35. package/lib/Spinner/index.js +2 -2
  36. package/lib/SplitButton/index.js +8 -8
  37. package/lib/Switch/index.js +3 -3
  38. package/lib/Tabs/index.js +26 -17
  39. package/lib/Tag/index.js +2 -2
  40. package/lib/TextCollapse/index.js +1 -1
  41. package/lib/Theme/index.js +51 -67
  42. package/lib/Toast/index.js +12 -11
  43. package/lib/Video/index.js +1 -1
  44. package/lib/Wallet/Action.js +1 -1
  45. package/lib/Wallet/Download.js +1 -1
  46. package/lib/Wallet/Open.js +1 -1
  47. package/lib/WechatPrompt/index.js +2 -2
  48. package/lib/withTheme/index.js +3 -3
  49. package/package.json +10 -8
  50. package/src/ActionButton/index.js +1 -1
  51. package/src/ActivityIndicator/index.js +2 -2
  52. package/src/Alert/index.js +2 -2
  53. package/src/Async/index.js +1 -1
  54. package/src/Badge/index.js +1 -1
  55. package/src/Blocklet/blocklet.js +4 -4
  56. package/src/BlockletNFT/index.js +7 -7
  57. package/src/Button/index.js +1 -1
  58. package/src/Button/wrap.js +2 -9
  59. package/src/ButtonGroup/index.js +2 -2
  60. package/src/ClickToCopy/index.js +2 -2
  61. package/src/CodeBlock/index.js +3 -3
  62. package/src/ContactForm/index.js +3 -3
  63. package/src/CookieConsent/index.js +4 -3
  64. package/src/Dialog/dialog.js +12 -9
  65. package/src/Footer/index.js +1 -1
  66. package/src/Header/header.js +5 -5
  67. package/src/Header/responsive-header.js +7 -7
  68. package/src/Icon/index.js +1 -0
  69. package/src/Img/index.js +12 -6
  70. package/src/InfoRow/index.js +1 -1
  71. package/src/Layout/dashboard/header.js +10 -10
  72. package/src/Layout/dashboard/index.js +3 -3
  73. package/src/Layout/dashboard/sidebar.js +10 -13
  74. package/src/Layout/index.js +18 -16
  75. package/src/Locale/selector.js +22 -17
  76. package/src/NFTDisplay/broken.js +1 -1
  77. package/src/NavMenu/nav-menu.js +1 -1
  78. package/src/PageScroller/index.js +4 -2
  79. package/src/PricingTable/PricingPlan.js +4 -4
  80. package/src/PricingTable/index.js +2 -2
  81. package/src/Result/common.js +3 -3
  82. package/src/Result/index.js +0 -2
  83. package/src/Result/result.js +3 -2
  84. package/src/Spinner/index.js +2 -2
  85. package/src/SplitButton/index.js +8 -8
  86. package/src/Switch/index.js +3 -3
  87. package/src/Tabs/index.js +16 -10
  88. package/src/Tag/index.js +2 -2
  89. package/src/TextCollapse/index.js +1 -1
  90. package/src/Theme/index.js +44 -57
  91. package/src/Toast/index.js +11 -11
  92. package/src/Video/index.js +1 -1
  93. package/src/Wallet/Action.js +1 -1
  94. package/src/Wallet/Download.js +1 -1
  95. package/src/Wallet/Open.js +1 -1
  96. package/src/WechatPrompt/index.js +2 -2
  97. package/src/withTheme/index.js +2 -2
  98. package/lib/Theme/responsiveFontSizes.js +0 -83
  99. package/src/Theme/responsiveFontSizes.js +0 -94
@@ -9,25 +9,25 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
12
+ var _CheckCircle = _interopRequireDefault(require("@mui/icons-material/CheckCircle"));
13
13
 
14
- var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));
14
+ var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
15
15
 
16
- var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
16
+ var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
17
17
 
18
- var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
18
+ var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
19
19
 
20
- var _Warning = _interopRequireDefault(require("@material-ui/icons/Warning"));
20
+ var _Warning = _interopRequireDefault(require("@mui/icons-material/Warning"));
21
21
 
22
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
22
+ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
23
23
 
24
- var _Snackbar = _interopRequireDefault(require("@material-ui/core/Snackbar"));
24
+ var _Snackbar = _interopRequireDefault(require("@mui/material/Snackbar"));
25
25
 
26
- var _SnackbarContent = _interopRequireDefault(require("@material-ui/core/SnackbarContent"));
26
+ var _SnackbarContent = _interopRequireDefault(require("@mui/material/SnackbarContent"));
27
27
 
28
- var _colors = require("@material-ui/core/colors");
28
+ var _colors = require("@mui/material/colors");
29
29
 
30
- var _styles = require("@material-ui/core/styles");
30
+ var _styles = require("@mui/styles");
31
31
 
32
32
  const _excluded = ["className", "message", "onClose", "variant"];
33
33
 
@@ -93,7 +93,8 @@ function SnackbarContentWrapper(props) {
93
93
  key: "close",
94
94
  "aria-label": "close",
95
95
  color: "inherit",
96
- onClick: onClose
96
+ onClick: onClose,
97
+ size: "large"
97
98
  }, /*#__PURE__*/_react.default.createElement(_Close.default, {
98
99
  className: classes.icon
99
100
  }))]
@@ -13,7 +13,7 @@ var _reactPlayer = _interopRequireDefault(require("react-player"));
13
13
 
14
14
  var _styledComponents = _interopRequireDefault(require("styled-components"));
15
15
 
16
- var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
16
+ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
17
17
 
18
18
  var _Util = require("../Util");
19
19
 
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
14
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
15
 
16
16
  var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
17
17
 
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
14
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
15
 
16
16
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
17
17
 
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
15
15
 
16
- var _Fab = _interopRequireDefault(require("@material-ui/core/Fab"));
16
+ var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
@@ -9,9 +9,9 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _styledComponents = _interopRequireDefault(require("styled-components"));
11
11
 
12
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
12
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
13
 
14
- var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
14
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
15
15
 
16
16
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
17
17
 
@@ -9,9 +9,9 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _styledComponents = require("styled-components");
11
11
 
12
- var _styles = require("@material-ui/core/styles");
12
+ var _styles = require("@mui/material/styles");
13
13
 
14
- var _CssBaseline = _interopRequireDefault(require("@material-ui/core/CssBaseline"));
14
+ var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
15
15
 
16
16
  var _Theme = require("../Theme");
17
17
 
@@ -48,7 +48,7 @@ function withTheme(Component) {
48
48
  }
49
49
 
50
50
  render() {
51
- return /*#__PURE__*/_react.default.createElement(_styles.MuiThemeProvider, {
51
+ return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
52
52
  theme: this.theme
53
53
  }, /*#__PURE__*/_react.default.createElement(_CssBaseline.default, null), /*#__PURE__*/_react.default.createElement(GlobalStyle, {
54
54
  theme: this.theme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "1.17.21",
3
+ "version": "2.0.0",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -50,17 +50,19 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@sentry/browser": "^5.0.8",
53
- "react": ">=16.12.0",
53
+ "react": ">=18.1.0",
54
54
  "react-ga": "^2.7.0"
55
55
  },
56
- "gitHead": "72ee6788c33de8033ac6fcc884554c9e2bdb0849",
56
+ "gitHead": "e246936f30652b6d526c33b1462f8ad5e93e7722",
57
57
  "dependencies": {
58
- "@arcblock/icons": "^1.17.21",
59
- "@arcblock/react-hooks": "^1.17.21",
58
+ "@arcblock/icons": "^2.0.0",
59
+ "@arcblock/react-hooks": "^2.0.0",
60
60
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
61
+ "@emotion/react": "^11.9.0",
62
+ "@emotion/styled": "^11.8.1",
61
63
  "@fontsource/lato": "^4.5.3",
62
- "@material-ui/core": "^4.12.3",
63
- "@material-ui/icons": "4.11.2",
64
+ "@mui/icons-material": "^5.6.2",
65
+ "@mui/material": "^5.6.4",
64
66
  "@solana/qr-code-styling": "^1.6.0-beta.0",
65
67
  "axios": "^0.21.2",
66
68
  "base64-url": "^2.3.3",
@@ -72,7 +74,7 @@
72
74
  "is-svg": "^4.3.1",
73
75
  "js-cookie": "^2.2.0",
74
76
  "lodash": "^4.17.21",
75
- "mdi-material-ui": "^6.22.1",
77
+ "mdi-material-ui": "^7.2.0",
76
78
  "react-cookie-consent": "^6.4.1",
77
79
  "react-helmet": "^6.1.0",
78
80
  "react-intersection-observer": "^8.31.1",
@@ -56,7 +56,7 @@ ActionButton.defaultProps = {
56
56
  color: '',
57
57
  border: '',
58
58
  width: '',
59
- theme: 'default',
59
+ theme: 'inherit',
60
60
  variant: 'outlined',
61
61
  size: 'large',
62
62
  children: null,
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import green from '@material-ui/core/colors/green';
5
- import blue from '@material-ui/core/colors/blue';
4
+ import green from '@mui/material/colors/green';
5
+ import blue from '@mui/material/colors/blue';
6
6
 
7
7
  import Logo from '../Logo';
8
8
  import colors from '../Colors';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Typography from '@material-ui/core/Typography';
5
- import blueGrey from '@material-ui/core/colors/blueGrey';
4
+ import Typography from '@mui/material/Typography';
5
+ import blueGrey from '@mui/material/colors/blueGrey';
6
6
 
7
7
  import Icon from '../Icon';
8
8
  import { mergeProps } from '../Util';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import CircularProgress from '@material-ui/core/CircularProgress';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
4
 
5
5
  export default function LoadAsyncComponent(importComponent, key = 'default', showProgress = true) {
6
6
  class AsyncComponent extends React.Component {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Typography from '@material-ui/core/Typography';
5
+ import Typography from '@mui/material/Typography';
6
6
 
7
7
  import colors from '../Colors';
8
8
  import { mergeProps } from '../Util';
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import PropTypes from 'prop-types';
4
- import Typography from '@material-ui/core/Typography';
5
- import CircularProgress from '@material-ui/core/CircularProgress';
4
+ import Typography from '@mui/material/Typography';
5
+ import CircularProgress from '@mui/material/CircularProgress';
6
6
  import Avatar from '@arcblock/did-connect/lib/Avatar';
7
- import useTheme from '@material-ui/core/styles/useTheme';
8
- import useMediaQuery from '@material-ui/core/useMediaQuery';
7
+ import { useTheme } from '@mui/styles';
8
+ import useMediaQuery from '@mui/material/useMediaQuery';
9
9
 
10
10
  import Button from '../Button';
11
11
  import Img from '../Img';
@@ -1,11 +1,11 @@
1
1
  import React, { useRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import PropTypes from 'prop-types';
4
- import Portal from '@material-ui/core/Portal';
5
- import Typography from '@material-ui/core/Typography';
6
- import CircularProgress from '@material-ui/core/CircularProgress';
7
- import useMediaQuery from '@material-ui/core/useMediaQuery';
8
- import useTheme from '@material-ui/core/styles/useTheme';
4
+ import Portal from '@mui/material/Portal';
5
+ import Typography from '@mui/material/Typography';
6
+ import CircularProgress from '@mui/material/CircularProgress';
7
+ import useMediaQuery from '@mui/material/useMediaQuery';
8
+ import useTheme from '@mui/styles/useTheme';
9
9
  import Avatar from '@arcblock/did-connect/lib/Avatar';
10
10
 
11
11
  import Icon from '../Icon';
@@ -238,8 +238,8 @@ export default function BlockletNFT({
238
238
  const _onMainClick = wrapHandler(onMainClick);
239
239
 
240
240
  const theme = useTheme();
241
- const isDownSm = useMediaQuery(theme.breakpoints.down('sm'));
242
- const isDownMd = useMediaQuery(theme.breakpoints.down('md'));
241
+ const isDownSm = useMediaQuery(theme.breakpoints.down('md'));
242
+ const isDownMd = useMediaQuery(theme.breakpoints.down('lg'));
243
243
  const isUpLg = useMediaQuery(theme.breakpoints.up('lg'));
244
244
 
245
245
  // If size is auto, need calculate actual size according to screen size
@@ -1,4 +1,4 @@
1
- import Button from '@material-ui/core/Button';
1
+ import Button from '@mui/material/Button';
2
2
  import wrap from './wrap';
3
3
 
4
4
  export default wrap(Button);
@@ -8,14 +8,6 @@ import colors from '../Colors';
8
8
  import { mergeProps } from '../Util';
9
9
 
10
10
  const extendedColors = {
11
- danger: {
12
- contained: { backgroundColor: colors.error.main, color: colors.common.white },
13
- outlined: { borderColor: colors.error.main, color: colors.error.main },
14
- },
15
- warning: {
16
- contained: { backgroundColor: colors.warning.main, color: colors.common.white },
17
- outlined: { borderColor: colors.warning.main, color: colors.warning.main },
18
- },
19
11
  did: {
20
12
  contained: { backgroundColor: colors.did.primary, color: colors.common.white },
21
13
  outlined: { borderColor: colors.did.primary, color: colors.did.primary },
@@ -44,8 +36,9 @@ export default function (BaseComponent) {
44
36
  default:
45
37
  }
46
38
 
47
- // mui 只支持 4 种 color 值: default/inherit/primary/secondary (传入这 4 种之外的值会报 warning),
39
+ // mui v4 只支持 4 种 color 值: default/inherit/primary/secondary (传入这 4 种之外的值会报 warning),
48
40
  // 这里扩展 danger/warning/reverse/did 四种 color
41
+ // !! 已升级到 mui v5, error/warning 等 color 已经默认支持, extendedColors 只扩展了 did/reverse
49
42
  const matched = extendedColors[color] && extendedColors[color][rest.variant];
50
43
  const styles = Object.assign({}, style, {
51
44
  boxShadow: 'none',
@@ -1,6 +1,6 @@
1
- import ButtonGroup from '@material-ui/core/ButtonGroup';
1
+ import ButtonGroup from '@mui/material/ButtonGroup';
2
2
  import wrap from '../Button/wrap';
3
3
 
4
- // deprecated, ux ButtonGroup 组件废弃, 建议直接使用 @material-ui/core/ButtonGroup
4
+ // deprecated, ux ButtonGroup 组件废弃, 建议直接使用 @mui/material/ButtonGroup
5
5
  // (该定制组件原本目的是调整 ButtonGroup 的圆角, 但最新设计规范已经不再使用较大的圆角, 改为使用 mui button 默认的圆角)
6
6
  export default wrap(ButtonGroup);
@@ -3,8 +3,8 @@ import Copy from 'copy-to-clipboard';
3
3
  import PropTypes from 'prop-types';
4
4
  import useWindowSize from 'react-use/lib/useWindowSize';
5
5
 
6
- import Tooltip from '@material-ui/core/Tooltip';
7
- import Typography from '@material-ui/core/Typography';
6
+ import Tooltip from '@mui/material/Tooltip';
7
+ import Typography from '@mui/material/Typography';
8
8
  import styled from 'styled-components';
9
9
 
10
10
  import Toast from '../Toast';
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import styled from 'styled-components';
5
5
  import Copy from 'copy-to-clipboard';
6
- import Button from '@material-ui/core/IconButton';
6
+ import Button from '@mui/material/IconButton';
7
7
  import useMountedState from 'react-use/lib/useMountedState';
8
8
 
9
9
  import hljs from 'highlight.js/lib/highlight';
@@ -23,8 +23,8 @@ import plaintext from 'highlight.js/lib/languages/plaintext';
23
23
 
24
24
  import 'highlight.js/styles/atom-one-dark.css';
25
25
 
26
- import CopyIcon from '@material-ui/icons/FileCopy';
27
- import CheckIcon from '@material-ui/icons/Check';
26
+ import CopyIcon from '@mui/icons-material/FileCopy';
27
+ import CheckIcon from '@mui/icons-material/Check';
28
28
  import colors from '../Colors';
29
29
 
30
30
  hljs.registerLanguage('javascript', javascript);
@@ -5,8 +5,8 @@ import PropTypes from 'prop-types';
5
5
  import styled from 'styled-components';
6
6
  import axios from 'axios';
7
7
 
8
- import Typography from '@material-ui/core/Typography';
9
- import CircularProgress from '@material-ui/core/CircularProgress';
8
+ import Typography from '@mui/material/Typography';
9
+ import CircularProgress from '@mui/material/CircularProgress';
10
10
 
11
11
  import { mergeProps } from '../Util';
12
12
  import Button from '../Button';
@@ -116,7 +116,7 @@ export default class ContactForm extends React.Component {
116
116
  <Button
117
117
  variant="outlined"
118
118
  type="submit"
119
- color="default"
119
+ color="inherit"
120
120
  size="large"
121
121
  disabled={loading}
122
122
  className="subscribe-btn-empty">
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Button from '@material-ui/core/Button';
4
+ import Button from '@mui/material/Button';
5
5
  import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
6
6
 
7
7
  export { resetCookieConsentValue };
@@ -19,6 +19,8 @@ const translations = {
19
19
  },
20
20
  };
21
21
 
22
+ const AcceptButton = props => <Button variant="contained" {...props} />;
23
+
22
24
  /**
23
25
  * DefaultCookieConsent, 对 react-cookie-consent package 封装, 以便 arcblock 内部产品可以快速使用
24
26
  * - 默认内容
@@ -34,9 +36,8 @@ export default function DefaultCookieConsent({ children, locale, style, ...rest
34
36
  <CookieConsent
35
37
  disableStyles
36
38
  disableButtonStyles
37
- ButtonComponent={Button}
39
+ ButtonComponent={AcceptButton}
38
40
  buttonText={translations[locale].agree}
39
- buttonClasses="MuiButton-contained MuiButton-containedPrimary"
40
41
  buttonStyle={{ marginTop: 16, padding: '6px 16px' }}
41
42
  {...rest}>
42
43
  {children || <p style={{ margin: 0 }}>{translations[locale].content}</p>}
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import MuiDialog from '@material-ui/core/Dialog';
5
- import MuiDialogContent from '@material-ui/core/DialogContent';
6
- import DialogActions from '@material-ui/core/DialogActions';
7
- import IconButton from '@material-ui/core/IconButton';
8
- import useMediaQuery from '@material-ui/core/useMediaQuery';
9
- import { useTheme } from '@material-ui/core/styles';
10
- import CloseIcon from '@material-ui/icons/Close';
4
+ import MuiDialog from '@mui/material/Dialog';
5
+ import MuiDialogContent from '@mui/material/DialogContent';
6
+ import DialogActions from '@mui/material/DialogActions';
7
+ import IconButton from '@mui/material/IconButton';
8
+ import useMediaQuery from '@mui/material/useMediaQuery';
9
+ import { useTheme } from '@mui/styles';
10
+ import CloseIcon from '@mui/icons-material/Close';
11
11
 
12
12
  /**
13
13
  * Dialog
@@ -29,7 +29,7 @@ const Dialog = ({
29
29
  }) => {
30
30
  const theme = useTheme();
31
31
  // 不管是否是 mobile 设备, 只要屏宽 < sm, dialog 就处于 mobile 模式
32
- const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
32
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
33
33
  const showHeader = title || showCloseButton || toolbar;
34
34
  const handleOnClose = (e, reason) => {
35
35
  // escapeKeyDown/backdropClick
@@ -48,7 +48,10 @@ const Dialog = ({
48
48
  );
49
49
 
50
50
  const closeButton = (
51
- <IconButton className="ux-dialog_closeButton" onClick={e => handleOnClose(e, 'closeButton')}>
51
+ <IconButton
52
+ className="ux-dialog_closeButton"
53
+ onClick={e => handleOnClose(e, 'closeButton')}
54
+ size="large">
52
55
  <CloseIcon />
53
56
  </IconButton>
54
57
  );
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import styled from 'styled-components';
5
- import Typography from '@material-ui/core/Typography';
5
+ import Typography from '@mui/material/Typography';
6
6
 
7
7
  import { mergeProps } from '../Util';
8
8
  import Logo from '../Logo';
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Box from '@material-ui/core/Box';
5
- import Container from '@material-ui/core/Container';
6
- import useTheme from '@material-ui/core/styles/useTheme';
4
+ import Box from '@mui/material/Box';
5
+ import Container from '@mui/material/Container';
6
+ import useTheme from '@mui/styles/useTheme';
7
7
 
8
8
  /**
9
9
  * Header 组件
@@ -128,7 +128,7 @@ const Root = styled.div`
128
128
  display: flex;
129
129
  align-items: center;
130
130
  }
131
- ${props => props.$theme.breakpoints.down('md')} {
131
+ ${props => props.$theme.breakpoints.down('lg')} {
132
132
  .header-brand {
133
133
  margin-right: 12px;
134
134
  .header-brand-title {
@@ -138,7 +138,7 @@ const Root = styled.div`
138
138
  }
139
139
  }
140
140
  }
141
- ${props => props.$theme.breakpoints.down('sm')} {
141
+ ${props => props.$theme.breakpoints.down('md')} {
142
142
  .header-container {
143
143
  height: 56px;
144
144
  }
@@ -1,11 +1,11 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import MenuIcon from '@material-ui/icons/Menu';
5
- import Button from '@material-ui/core/IconButton';
6
- import useTheme from '@material-ui/core/styles/useTheme';
7
- import useMediaQuery from '@material-ui/core/useMediaQuery';
8
- import Drawer from '@material-ui/core/Drawer';
4
+ import MenuIcon from '@mui/icons-material/Menu';
5
+ import Button from '@mui/material/IconButton';
6
+ import useTheme from '@mui/styles/useTheme';
7
+ import useMediaQuery from '@mui/material/useMediaQuery';
8
+ import Drawer from '@mui/material/Drawer';
9
9
  import Header from './header';
10
10
 
11
11
  /**
@@ -17,7 +17,7 @@ import Header from './header';
17
17
  */
18
18
  function ResponsiveHeader({ menu, prepend, children, ...rest }) {
19
19
  const theme = useTheme();
20
- const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
20
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
21
21
  const [drawerOpen, setDrawerOpen] = useState(false);
22
22
  const _children =
23
23
  typeof children === 'function'
@@ -81,7 +81,7 @@ const Root = styled(Header)`
81
81
  .header-menu {
82
82
  display: none;
83
83
  }
84
- ${props => props.$theme.breakpoints.down('sm')} {
84
+ ${props => props.$theme.breakpoints.down('md')} {
85
85
  .header-menu {
86
86
  display: block;
87
87
  }
package/src/Icon/index.js CHANGED
@@ -10,6 +10,7 @@ const variants = {
10
10
  solid: 'fas',
11
11
  };
12
12
 
13
+ // eslint-disable-next-line react/prop-types
13
14
  const Icon = ({ name, color, size, variant, rounded, style, className, forwardedRef, ...rest }) => {
14
15
  const content = (
15
16
  <i
package/src/Img/index.js CHANGED
@@ -1,12 +1,19 @@
1
1
  import React, { useEffect, useMemo, useState } from 'react';
2
+ import { styled } from '@mui/material/styles';
2
3
  import PropTypes from 'prop-types';
3
- import { makeStyles, SvgIcon } from '@material-ui/core';
4
+ import { SvgIcon } from '@mui/material';
4
5
  import { useInView } from 'react-intersection-observer';
5
6
  import Alert from 'mdi-material-ui/Alert';
6
7
  import ImageIcon from 'mdi-material-ui/Image';
7
8
 
8
- const useStyles = makeStyles(() => ({
9
- root: {
9
+ const PREFIX = 'Img';
10
+
11
+ const classes = {
12
+ root: `${PREFIX}-root`,
13
+ };
14
+
15
+ const Root = styled('div')(() => ({
16
+ [`& .${classes.root}`]: {
10
17
  position: 'relative',
11
18
  overflow: 'hidden',
12
19
  '& .image--state, & .image--img': {
@@ -56,7 +63,6 @@ function Img({
56
63
  onSuccess,
57
64
  ...rest
58
65
  }) {
59
- const classes = useStyles();
60
66
  const [ref, inView] = lazy ? useInView({ threshold: 0, triggerOnce: true }) : [null, true];
61
67
 
62
68
  const [imgState, setImgState] = useState('init');
@@ -117,7 +123,7 @@ function Img({
117
123
 
118
124
  return (
119
125
  // paddingTop 要求元素本身的宽度为 100%,所以只能加一个外层元素去限制宽度
120
- <div ref={ref} style={outerStyle} {...rest}>
126
+ <Root ref={ref} style={outerStyle} {...rest}>
121
127
  <div className={`image ${className} ${classes.root}`} style={mergedStyle}>
122
128
  {!fallback && imgState === 'error' && (
123
129
  <div className="image--state" title="loading image">
@@ -131,7 +137,7 @@ function Img({
131
137
  )}
132
138
  {imgState === 'loaded' && <img className="image--img" src={src} alt={alt} />}
133
139
  </div>
134
- </div>
140
+ </Root>
135
141
  );
136
142
  }
137
143
 
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import camelCase from 'lodash/camelCase';
4
4
  import upperFirst from 'lodash/upperFirst';
5
5
  import styled from 'styled-components';
6
- import Typography from '@material-ui/core/Typography';
6
+ import Typography from '@mui/material/Typography';
7
7
 
8
8
  const InfoRow = ({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }) => (
9
9
  <Container layout={layout} width={nameWidth} {...rest}>
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Button from '@material-ui/core/IconButton';
5
- import AppBar from '@material-ui/core/AppBar';
6
- import Toolbar from '@material-ui/core/Toolbar';
7
- import Box from '@material-ui/core/Box';
8
- import Typography from '@material-ui/core/Typography';
9
- import Hidden from '@material-ui/core/Hidden';
10
- import MenuIcon from '@material-ui/icons/Menu';
4
+ import Button from '@mui/material/IconButton';
5
+ import AppBar from '@mui/material/AppBar';
6
+ import Toolbar from '@mui/material/Toolbar';
7
+ import Box from '@mui/material/Box';
8
+ import Typography from '@mui/material/Typography';
9
+ import Hidden from '@mui/material/Hidden';
10
+ import MenuIcon from '@mui/icons-material/Menu';
11
11
  import { Link } from 'react-router-dom';
12
12
 
13
13
  import Logo from '../../Logo';
14
14
 
15
15
  const StyledAppBar = styled(AppBar)`
16
16
  && {
17
- z-index: ${props => props.theme.zIndex.drawer + 1};
17
+ z-index: ${props => props.theme.zIndex.drawer};
18
18
  background: ${props => props.theme.palette.background.default};
19
19
  box-shadow: none;
20
20
  top: 0;
@@ -71,7 +71,7 @@ const StyledAppBar = styled(AppBar)`
71
71
  .header-menu {
72
72
  display: none;
73
73
  }
74
- ${props => props.theme.breakpoints.down('sm')} {
74
+ ${props => props.theme.breakpoints.down('md')} {
75
75
  .header-title {
76
76
  display: none;
77
77
  }
@@ -116,7 +116,7 @@ export default function Header({
116
116
  <MenuIcon />
117
117
  </Button>
118
118
  <Link to={homeUrl} className="header-link">
119
- <Hidden smDown>
119
+ <Hidden mdDown>
120
120
  <div className="header-logo">{logo || <Logo showText={false} />}</div>
121
121
  </Hidden>
122
122
  <div className="header-title">