@arcblock/ux 1.17.21 → 2.0.2
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/lib/ActionButton/index.js +1 -1
- package/lib/ActivityIndicator/index.js +5 -7
- package/lib/Alert/index.js +3 -3
- package/lib/Async/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/Blocklet/blocklet.js +5 -5
- package/lib/BlockletNFT/index.js +7 -7
- package/lib/Button/index.js +1 -1
- package/lib/Button/wrap.js +2 -21
- package/lib/ButtonGroup/index.js +2 -2
- package/lib/ClickToCopy/index.js +2 -2
- package/lib/CodeBlock/index.js +3 -3
- package/lib/ContactForm/index.js +3 -3
- package/lib/CookieConsent/index.js +7 -3
- package/lib/Dialog/dialog.js +10 -9
- package/lib/Footer/index.js +1 -1
- package/lib/Header/header.js +4 -4
- package/lib/Header/responsive-header.js +7 -7
- package/lib/Icon/index.js +1 -1
- package/lib/Img/index.js +12 -7
- package/lib/InfoRow/index.js +1 -1
- package/lib/Layout/dashboard/header.js +9 -9
- package/lib/Layout/dashboard/index.js +3 -3
- package/lib/Layout/dashboard/sidebar.js +6 -6
- package/lib/Layout/index.js +19 -16
- package/lib/Locale/selector.js +16 -11
- package/lib/NFTDisplay/broken.js +1 -1
- package/lib/NavMenu/nav-menu.js +1 -1
- package/lib/PageScroller/index.js +6 -2
- package/lib/PricingTable/PricingPlan.js +4 -4
- package/lib/PricingTable/index.js +2 -2
- package/lib/Result/common.js +3 -3
- package/lib/Result/index.js +3 -6
- package/lib/Result/result.js +3 -2
- package/lib/Spinner/index.js +2 -2
- package/lib/SplitButton/index.js +8 -8
- package/lib/Switch/index.js +60 -60
- package/lib/Tabs/index.js +26 -17
- package/lib/Tag/index.js +2 -2
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/index.js +51 -67
- package/lib/Toast/index.js +12 -11
- package/lib/Video/index.js +1 -1
- package/lib/Wallet/Action.js +1 -1
- package/lib/Wallet/Download.js +1 -1
- package/lib/Wallet/Open.js +1 -1
- package/lib/WechatPrompt/index.js +2 -2
- package/lib/withTheme/index.js +3 -3
- package/package.json +10 -8
- package/src/ActionButton/index.js +1 -1
- package/src/ActivityIndicator/index.js +1 -2
- package/src/Alert/index.js +2 -2
- package/src/Async/index.js +1 -1
- package/src/Badge/index.js +1 -1
- package/src/Blocklet/blocklet.js +4 -4
- package/src/BlockletNFT/index.js +7 -7
- package/src/Button/index.js +1 -1
- package/src/Button/wrap.js +2 -9
- package/src/ButtonGroup/index.js +2 -2
- package/src/ClickToCopy/index.js +2 -2
- package/src/CodeBlock/index.js +3 -3
- package/src/ContactForm/index.js +3 -3
- package/src/CookieConsent/index.js +4 -3
- package/src/Dialog/dialog.js +12 -9
- package/src/Footer/index.js +1 -1
- package/src/Header/header.js +5 -5
- package/src/Header/responsive-header.js +7 -7
- package/src/Icon/index.js +1 -0
- package/src/Img/index.js +12 -6
- package/src/InfoRow/index.js +1 -1
- package/src/Layout/dashboard/header.js +10 -10
- package/src/Layout/dashboard/index.js +3 -3
- package/src/Layout/dashboard/sidebar.js +10 -13
- package/src/Layout/index.js +18 -16
- package/src/Locale/selector.js +22 -17
- package/src/NFTDisplay/broken.js +1 -1
- package/src/NavMenu/nav-menu.js +1 -1
- package/src/PageScroller/index.js +4 -2
- package/src/PricingTable/PricingPlan.js +4 -4
- package/src/PricingTable/index.js +2 -2
- package/src/Result/common.js +3 -3
- package/src/Result/index.js +0 -2
- package/src/Result/result.js +3 -2
- package/src/Spinner/index.js +2 -2
- package/src/SplitButton/index.js +8 -8
- package/src/Switch/index.js +44 -48
- package/src/Tabs/index.js +16 -10
- package/src/Tag/index.js +2 -2
- package/src/TextCollapse/index.js +1 -1
- package/src/Theme/index.js +44 -57
- package/src/Toast/index.js +11 -11
- package/src/Video/index.js +1 -1
- package/src/Wallet/Action.js +1 -1
- package/src/Wallet/Download.js +1 -1
- package/src/Wallet/Open.js +1 -1
- package/src/WechatPrompt/index.js +2 -2
- package/src/withTheme/index.js +2 -2
- package/lib/Theme/responsiveFontSizes.js +0 -83
- package/src/Theme/responsiveFontSizes.js +0 -94
package/lib/Theme/index.js
CHANGED
|
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.create = void 0;
|
|
7
7
|
|
|
8
|
-
var _styles = require("@material
|
|
8
|
+
var _styles = require("@mui/material/styles");
|
|
9
9
|
|
|
10
10
|
require("@fontsource/lato/400.css");
|
|
11
11
|
|
|
12
12
|
require("@fontsource/lato/700.css");
|
|
13
13
|
|
|
14
|
-
var _responsiveFontSizes = _interopRequireDefault(require("./responsiveFontSizes"));
|
|
15
|
-
|
|
16
14
|
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
17
15
|
|
|
18
16
|
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
|
@@ -29,8 +27,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
29
27
|
|
|
30
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
const muiDarkTheme = (0, _styles.createTheme)({
|
|
31
|
+
palette: {
|
|
32
|
+
mode: 'dark'
|
|
33
|
+
}
|
|
34
|
+
}); // https://material-ui.com/customization/default-theme/
|
|
33
35
|
// eslint-disable-next-line import/prefer-default-export
|
|
36
|
+
|
|
34
37
|
const create = function create() {
|
|
35
38
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
36
39
|
{
|
|
@@ -42,15 +45,26 @@ const create = function create() {
|
|
|
42
45
|
} = _ref,
|
|
43
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
47
|
|
|
48
|
+
// palette 考虑 light & dark mode, dark mode 需要持续完善
|
|
49
|
+
// - 能配合 ColorModeContext 使用
|
|
50
|
+
// - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
|
|
51
|
+
const _palette = mode === 'light' ? Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
|
52
|
+
background: {
|
|
53
|
+
paper: _Colors.default.common.white,
|
|
54
|
+
default: _Colors.default.background.default
|
|
55
|
+
},
|
|
56
|
+
mode
|
|
57
|
+
}), palette || {}) : Object.assign(_objectSpread(_objectSpread({}, muiDarkTheme.palette), {}, {
|
|
58
|
+
background: {
|
|
59
|
+
paper: _Colors.default.grey[900],
|
|
60
|
+
default: _Colors.default.grey[900]
|
|
61
|
+
},
|
|
62
|
+
mode
|
|
63
|
+
}), palette || {});
|
|
64
|
+
|
|
45
65
|
const theme = (0, _styles.createTheme)(_objectSpread({
|
|
46
66
|
themeName: 'ArcBlock',
|
|
47
|
-
palette:
|
|
48
|
-
background: {
|
|
49
|
-
paper: mode === 'light' ? _Colors.default.common.white : _Colors.default.grey[900],
|
|
50
|
-
default: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
51
|
-
},
|
|
52
|
-
type: mode
|
|
53
|
-
}), palette || {}),
|
|
67
|
+
palette: _palette,
|
|
54
68
|
typography: Object.assign({
|
|
55
69
|
useNextVariants: true,
|
|
56
70
|
color: {
|
|
@@ -72,70 +86,40 @@ const create = function create() {
|
|
|
72
86
|
fontWeight: 700
|
|
73
87
|
}
|
|
74
88
|
}, typography || {}),
|
|
75
|
-
|
|
89
|
+
components: _objectSpread({
|
|
76
90
|
MuiButton: {
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
styleOverrides: {
|
|
92
|
+
root: {
|
|
93
|
+
boxShadow: 'none'
|
|
94
|
+
}
|
|
79
95
|
}
|
|
80
96
|
},
|
|
81
97
|
MuiButtonGroup: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
MuiAppBar: {
|
|
87
|
-
root: {
|
|
88
|
-
height: 80
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
MuiToolbar: {
|
|
92
|
-
root: {
|
|
93
|
-
background: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
98
|
+
styleOverrides: {
|
|
99
|
+
root: {
|
|
100
|
+
boxShadow: 'none'
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
},
|
|
96
104
|
MuiTableCell: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
MuiChip: {
|
|
113
|
-
root: {
|
|
114
|
-
padding: '3px',
|
|
115
|
-
height: '24px',
|
|
116
|
-
fontSize: '12px',
|
|
117
|
-
marginRight: '10px'
|
|
118
|
-
},
|
|
119
|
-
label: {
|
|
120
|
-
paddingLeft: '5px',
|
|
121
|
-
paddingRight: '5px',
|
|
122
|
-
marginRight: '5px'
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
MuiTooltip: {
|
|
126
|
-
tooltip: {
|
|
127
|
-
fontSize: '14px'
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
MuiTypography: {
|
|
131
|
-
body1: {
|
|
132
|
-
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
133
|
-
},
|
|
134
|
-
body2: {
|
|
135
|
-
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
105
|
+
styleOverrides: {
|
|
106
|
+
root: {
|
|
107
|
+
borderBottomWidth: '0',
|
|
108
|
+
paddingTop: '14px',
|
|
109
|
+
paddingBottom: '14px',
|
|
110
|
+
paddingLeft: 0,
|
|
111
|
+
paddingRight: '30px'
|
|
112
|
+
},
|
|
113
|
+
head: {
|
|
114
|
+
textTransform: 'uppercase',
|
|
115
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
116
|
+
},
|
|
117
|
+
body: {
|
|
118
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
119
|
+
}
|
|
136
120
|
}
|
|
137
121
|
}
|
|
138
|
-
}, overrides
|
|
122
|
+
}, overrides),
|
|
139
123
|
pageWidth,
|
|
140
124
|
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
|
141
125
|
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
|
@@ -161,7 +145,7 @@ const create = function create() {
|
|
|
161
145
|
},
|
|
162
146
|
mode
|
|
163
147
|
}, rest));
|
|
164
|
-
const enhanced = (0,
|
|
148
|
+
const enhanced = (0, _styles.responsiveFontSizes)(theme, {
|
|
165
149
|
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
|
166
150
|
disableAlign: false,
|
|
167
151
|
factor: 3,
|
package/lib/Toast/index.js
CHANGED
|
@@ -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("@
|
|
12
|
+
var _CheckCircle = _interopRequireDefault(require("@mui/icons-material/CheckCircle"));
|
|
13
13
|
|
|
14
|
-
var _Error = _interopRequireDefault(require("@
|
|
14
|
+
var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
15
15
|
|
|
16
|
-
var _Info = _interopRequireDefault(require("@
|
|
16
|
+
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
17
17
|
|
|
18
|
-
var _Close = _interopRequireDefault(require("@
|
|
18
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
19
19
|
|
|
20
|
-
var _Warning = _interopRequireDefault(require("@
|
|
20
|
+
var _Warning = _interopRequireDefault(require("@mui/icons-material/Warning"));
|
|
21
21
|
|
|
22
|
-
var _IconButton = _interopRequireDefault(require("@material
|
|
22
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
23
23
|
|
|
24
|
-
var _Snackbar = _interopRequireDefault(require("@material
|
|
24
|
+
var _Snackbar = _interopRequireDefault(require("@mui/material/Snackbar"));
|
|
25
25
|
|
|
26
|
-
var _SnackbarContent = _interopRequireDefault(require("@material
|
|
26
|
+
var _SnackbarContent = _interopRequireDefault(require("@mui/material/SnackbarContent"));
|
|
27
27
|
|
|
28
|
-
var _colors = require("@material
|
|
28
|
+
var _colors = require("@mui/material/colors");
|
|
29
29
|
|
|
30
|
-
var _styles = require("@
|
|
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
|
}))]
|
package/lib/Video/index.js
CHANGED
|
@@ -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
|
|
16
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
17
17
|
|
|
18
18
|
var _Util = require("../Util");
|
|
19
19
|
|
package/lib/Wallet/Action.js
CHANGED
|
@@ -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
|
|
14
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
15
|
|
|
16
16
|
var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
|
|
17
17
|
|
package/lib/Wallet/Download.js
CHANGED
|
@@ -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
|
|
14
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
15
|
|
|
16
16
|
var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
|
|
17
17
|
|
package/lib/Wallet/Open.js
CHANGED
|
@@ -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
|
|
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
|
|
12
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
13
13
|
|
|
14
|
-
var _Dialog = _interopRequireDefault(require("@material
|
|
14
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
15
15
|
|
|
16
16
|
var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
|
|
17
17
|
|
package/lib/withTheme/index.js
CHANGED
|
@@ -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
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
13
|
|
|
14
|
-
var _CssBaseline = _interopRequireDefault(require("@material
|
|
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.
|
|
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": "
|
|
3
|
+
"version": "2.0.2",
|
|
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": ">=
|
|
53
|
+
"react": ">=18.1.0",
|
|
54
54
|
"react-ga": "^2.7.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "319d3e6d884b5f79311edca8aab7a9ed17a17b74",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@arcblock/icons": "^
|
|
59
|
-
"@arcblock/react-hooks": "^
|
|
58
|
+
"@arcblock/icons": "^2.0.2",
|
|
59
|
+
"@arcblock/react-hooks": "^2.0.2",
|
|
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
|
|
63
|
-
"@material
|
|
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": "^
|
|
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",
|
|
@@ -1,8 +1,7 @@
|
|
|
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
|
|
5
|
-
import blue from '@material-ui/core/colors/blue';
|
|
4
|
+
import { green, blue } from '@mui/material/colors';
|
|
6
5
|
|
|
7
6
|
import Logo from '../Logo';
|
|
8
7
|
import colors from '../Colors';
|
package/src/Alert/index.js
CHANGED
|
@@ -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
|
|
5
|
-
import blueGrey from '@material
|
|
4
|
+
import Typography from '@mui/material/Typography';
|
|
5
|
+
import { blueGrey } from '@mui/material/colors';
|
|
6
6
|
|
|
7
7
|
import Icon from '../Icon';
|
|
8
8
|
import { mergeProps } from '../Util';
|
package/src/Async/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import CircularProgress from '@material
|
|
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 {
|
package/src/Badge/index.js
CHANGED
|
@@ -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
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
6
|
|
|
7
7
|
import colors from '../Colors';
|
|
8
8
|
import { mergeProps } from '../Util';
|
package/src/Blocklet/blocklet.js
CHANGED
|
@@ -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
|
|
5
|
-
import CircularProgress from '@material
|
|
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 '@
|
|
8
|
-
import useMediaQuery from '@material
|
|
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';
|
package/src/BlockletNFT/index.js
CHANGED
|
@@ -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
|
|
5
|
-
import Typography from '@material
|
|
6
|
-
import CircularProgress from '@material
|
|
7
|
-
import useMediaQuery from '@material
|
|
8
|
-
import useTheme from '@
|
|
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('
|
|
242
|
-
const isDownMd = useMediaQuery(theme.breakpoints.down('
|
|
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
|
package/src/Button/index.js
CHANGED
package/src/Button/wrap.js
CHANGED
|
@@ -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',
|
package/src/ButtonGroup/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ButtonGroup from '@material
|
|
1
|
+
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
2
2
|
import wrap from '../Button/wrap';
|
|
3
3
|
|
|
4
|
-
// deprecated, ux ButtonGroup 组件废弃, 建议直接使用 @material
|
|
4
|
+
// deprecated, ux ButtonGroup 组件废弃, 建议直接使用 @mui/material/ButtonGroup
|
|
5
5
|
// (该定制组件原本目的是调整 ButtonGroup 的圆角, 但最新设计规范已经不再使用较大的圆角, 改为使用 mui button 默认的圆角)
|
|
6
6
|
export default wrap(ButtonGroup);
|
package/src/ClickToCopy/index.js
CHANGED
|
@@ -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
|
|
7
|
-
import Typography from '@material
|
|
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';
|
package/src/CodeBlock/index.js
CHANGED
|
@@ -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
|
|
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 '@
|
|
27
|
-
import CheckIcon from '@
|
|
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);
|
package/src/ContactForm/index.js
CHANGED
|
@@ -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
|
|
9
|
-
import CircularProgress from '@material
|
|
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="
|
|
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
|
|
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={
|
|
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>}
|
package/src/Dialog/dialog.js
CHANGED
|
@@ -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
|
|
5
|
-
import MuiDialogContent from '@material
|
|
6
|
-
import DialogActions from '@material
|
|
7
|
-
import IconButton from '@material
|
|
8
|
-
import useMediaQuery from '@material
|
|
9
|
-
import { useTheme } from '@
|
|
10
|
-
import CloseIcon from '@
|
|
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('
|
|
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
|
|
51
|
+
<IconButton
|
|
52
|
+
className="ux-dialog_closeButton"
|
|
53
|
+
onClick={e => handleOnClose(e, 'closeButton')}
|
|
54
|
+
size="large">
|
|
52
55
|
<CloseIcon />
|
|
53
56
|
</IconButton>
|
|
54
57
|
);
|
package/src/Footer/index.js
CHANGED
|
@@ -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
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
6
|
|
|
7
7
|
import { mergeProps } from '../Util';
|
|
8
8
|
import Logo from '../Logo';
|
package/src/Header/header.js
CHANGED
|
@@ -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
|
|
5
|
-
import Container from '@material
|
|
6
|
-
import useTheme from '@
|
|
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('
|
|
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('
|
|
141
|
+
${props => props.$theme.breakpoints.down('md')} {
|
|
142
142
|
.header-container {
|
|
143
143
|
height: 56px;
|
|
144
144
|
}
|