@arcblock/ux 1.15.21 → 1.15.26
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/ActivityIndicator/index.js +6 -2
- package/lib/Alert/index.js +9 -7
- package/lib/Badge/index.js +11 -11
- package/lib/Button/wrap.js +12 -12
- package/lib/Colors/index.js +15 -0
- package/lib/Colors/themes/default.js +78 -0
- package/lib/Footer/index.js +1 -1
- package/lib/Icon/index.js +2 -2
- package/lib/Layout/dashboard/sidebar.js +3 -1
- package/lib/Tag/index.js +8 -8
- package/lib/Theme/index.js +59 -56
- package/lib/Util/index.js +55 -1
- package/lib/Wallet/Action.js +2 -2
- package/package.json +4 -4
|
@@ -11,9 +11,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
+
var _green = _interopRequireDefault(require("@material-ui/core/colors/green"));
|
|
15
|
+
|
|
16
|
+
var _blue = _interopRequireDefault(require("@material-ui/core/colors/blue"));
|
|
17
|
+
|
|
14
18
|
var _Logo = _interopRequireDefault(require("../Logo"));
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
17
21
|
|
|
18
22
|
const _excluded = ["messages", "interval"];
|
|
19
23
|
|
|
@@ -82,4 +86,4 @@ ActivityIndicator.defaultProps = {
|
|
|
82
86
|
const Div = _styledComponents.default.div.withConfig({
|
|
83
87
|
displayName: "ActivityIndicator__Div",
|
|
84
88
|
componentId: "sc-rsk6jb-0"
|
|
85
|
-
})(["&&{padding:20px;width:100%;height:100%;min-height:360px;z-index:100;transition:opacity 0.5s linear;display:flex;align-items:center;flex-direction:column;justify-content:center;}@keyframes orbit{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.pm-loader-text{color:", ";font-size:14px;text-align:center;position:relative;height:70px;-webkit-user-select:none;}.pm-loader-container{width:100%;height:100%;display:flex;align-items:center;flex-direction:column;justify-content:center;flex:1;}.pm-loader-atoms{width:100px;height:100px;display:flex;position:relative;align-items:center;justify-content:center;}.pm-loader-center-atom{top:32px;left:32px;width:32px;height:32px;position:absolute;border-radius:50%;}.pm-loader-orbit-1{top:20px;left:20px;width:56px;height:56px;position:absolute;border-radius:50%;border:1px solid ", ";}.pm-loader-orbit-2{top:8px;left:8px;width:80px;height:80px;border-radius:50%;position:absolute;border:1px solid ", ";}.pm-loader-orbit-3{top:-4px;left:-4px;width:104px;height:104px;position:absolute;border-radius:50%;border:1px solid ", ";}.pm-loader-atom-1{width:7px;height:7px;margin-top:4px;margin-left:4px;border-radius:50%;background-color:", ";transform-origin:24px 24px;animation:orbit 1s infinite;animation-timing-function:linear;-webkit-transform-origin:24px 24px;}.pm-loader-atom-2{width:7px;height:7px;margin-top:8px;margin-left:8px;border-radius:50%;background-color:", ";transform-origin:32px 32px;animation:orbit 2s infinite;animation-timing-function:linear;-webkit-transform-origin:32px 32px;}.pm-loader-atom-3{width:7px;height:7px;margin-top:11px;margin-left:11px;border-radius:50%;background-color:", ";transform-origin:41px 41px;animation:orbit 3s infinite;animation-timing-function:linear;-webkit-transform-origin:41px 41px;}"],
|
|
89
|
+
})(["&&{padding:20px;width:100%;height:100%;min-height:360px;z-index:100;transition:opacity 0.5s linear;display:flex;align-items:center;flex-direction:column;justify-content:center;}@keyframes orbit{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.pm-loader-text{color:", ";font-size:14px;text-align:center;position:relative;height:70px;-webkit-user-select:none;}.pm-loader-container{width:100%;height:100%;display:flex;align-items:center;flex-direction:column;justify-content:center;flex:1;}.pm-loader-atoms{width:100px;height:100px;display:flex;position:relative;align-items:center;justify-content:center;}.pm-loader-center-atom{top:32px;left:32px;width:32px;height:32px;position:absolute;border-radius:50%;}.pm-loader-orbit-1{top:20px;left:20px;width:56px;height:56px;position:absolute;border-radius:50%;border:1px solid ", ";}.pm-loader-orbit-2{top:8px;left:8px;width:80px;height:80px;border-radius:50%;position:absolute;border:1px solid ", ";}.pm-loader-orbit-3{top:-4px;left:-4px;width:104px;height:104px;position:absolute;border-radius:50%;border:1px solid ", ";}.pm-loader-atom-1{width:7px;height:7px;margin-top:4px;margin-left:4px;border-radius:50%;background-color:", ";transform-origin:24px 24px;animation:orbit 1s infinite;animation-timing-function:linear;-webkit-transform-origin:24px 24px;}.pm-loader-atom-2{width:7px;height:7px;margin-top:8px;margin-left:8px;border-radius:50%;background-color:", ";transform-origin:32px 32px;animation:orbit 2s infinite;animation-timing-function:linear;-webkit-transform-origin:32px 32px;}.pm-loader-atom-3{width:7px;height:7px;margin-top:11px;margin-left:11px;border-radius:50%;background-color:", ";transform-origin:41px 41px;animation:orbit 3s infinite;animation-timing-function:linear;-webkit-transform-origin:41px 41px;}"], _Colors.default.grey[900], _green.default[500], _blue.default[800], _Colors.default.grey[900], _green.default[500], _blue.default[800], _Colors.default.grey[900]);
|
package/lib/Alert/index.js
CHANGED
|
@@ -13,12 +13,14 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _blueGrey = _interopRequireDefault(require("@material-ui/core/colors/blueGrey"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
19
19
|
|
|
20
20
|
var _Util = require("../Util");
|
|
21
21
|
|
|
22
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
23
|
+
|
|
22
24
|
const _excluded = ["type", "children", "style", "className", "variant"];
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -30,25 +32,25 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
30
32
|
const types = {
|
|
31
33
|
error: {
|
|
32
34
|
icon: 'exclamation-circle',
|
|
33
|
-
color:
|
|
35
|
+
color: _Colors.default.error.main,
|
|
34
36
|
borderColor: '#e35b54',
|
|
35
37
|
backgroundColor: 'rgba(227, 91, 84, 0.2)'
|
|
36
38
|
},
|
|
37
39
|
warning: {
|
|
38
40
|
icon: 'exclamation-triangle',
|
|
39
|
-
color:
|
|
41
|
+
color: _Colors.default.warning.main,
|
|
40
42
|
borderColor: '#f7d040',
|
|
41
43
|
backgroundColor: 'rgba(247, 208, 64, 0.2)'
|
|
42
44
|
},
|
|
43
45
|
success: {
|
|
44
46
|
icon: 'check-circle',
|
|
45
|
-
color:
|
|
47
|
+
color: _Colors.default.success.main,
|
|
46
48
|
borderColor: '#89ddd9',
|
|
47
49
|
backgroundColor: 'rgba(137, 221, 217, 0.2)'
|
|
48
50
|
},
|
|
49
51
|
tip: {
|
|
50
52
|
icon: 'info-circle',
|
|
51
|
-
color:
|
|
53
|
+
color: _Colors.default.grey[500],
|
|
52
54
|
borderColor: '#222222',
|
|
53
55
|
backgroundColor: '#EEEEEE'
|
|
54
56
|
}
|
|
@@ -73,7 +75,7 @@ const Alert = props => {
|
|
|
73
75
|
borderColor
|
|
74
76
|
} = types[type] || types.success;
|
|
75
77
|
const styles = Object.assign({
|
|
76
|
-
color:
|
|
78
|
+
color: _blueGrey.default[500],
|
|
77
79
|
backgroundColor: variant === 'border' ? backgroundColor : 'transparent',
|
|
78
80
|
borderLeft: variant === 'border' ? "5px solid ".concat(borderColor) : 'none'
|
|
79
81
|
}, style);
|
package/lib/Badge/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
17
17
|
|
|
18
18
|
var _Util = require("../Util");
|
|
19
19
|
|
|
@@ -27,24 +27,24 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
27
27
|
|
|
28
28
|
const types = {
|
|
29
29
|
error: {
|
|
30
|
-
color:
|
|
31
|
-
backgroundColor:
|
|
30
|
+
color: _Colors.default.common.white,
|
|
31
|
+
backgroundColor: _Colors.default.error.main
|
|
32
32
|
},
|
|
33
33
|
warning: {
|
|
34
|
-
color:
|
|
35
|
-
backgroundColor:
|
|
34
|
+
color: _Colors.default.common.white,
|
|
35
|
+
backgroundColor: _Colors.default.warning.main
|
|
36
36
|
},
|
|
37
37
|
success: {
|
|
38
|
-
color:
|
|
39
|
-
backgroundColor:
|
|
38
|
+
color: _Colors.default.common.white,
|
|
39
|
+
backgroundColor: _Colors.default.success.main
|
|
40
40
|
},
|
|
41
41
|
primary: {
|
|
42
|
-
color:
|
|
43
|
-
backgroundColor:
|
|
42
|
+
color: _Colors.default.common.white,
|
|
43
|
+
backgroundColor: _Colors.default.primary.main
|
|
44
44
|
},
|
|
45
45
|
reverse: {
|
|
46
|
-
color:
|
|
47
|
-
backgroundColor:
|
|
46
|
+
color: _Colors.default.common.white,
|
|
47
|
+
backgroundColor: _Colors.default.grey[900]
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
package/lib/Button/wrap.js
CHANGED
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _Spinner = _interopRequireDefault(require("../Spinner"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
15
15
|
|
|
16
16
|
var _Util = require("../Util");
|
|
17
17
|
|
|
@@ -59,31 +59,31 @@ function _default(BaseComponent) {
|
|
|
59
59
|
|
|
60
60
|
if (rest.color === 'danger') {
|
|
61
61
|
if (rest.variant === 'contained') {
|
|
62
|
-
styles.backgroundColor =
|
|
63
|
-
styles.color =
|
|
62
|
+
styles.backgroundColor = _Colors.default.error.main;
|
|
63
|
+
styles.color = _Colors.default.common.white;
|
|
64
64
|
} else {
|
|
65
|
-
styles.borderColor =
|
|
66
|
-
styles.color =
|
|
65
|
+
styles.borderColor = _Colors.default.error.main;
|
|
66
|
+
styles.color = _Colors.default.error.main;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (!rest.color || rest.color === 'default') {
|
|
71
71
|
if (rest.variant === 'contained') {
|
|
72
|
-
styles.backgroundColor = isDisabled ?
|
|
73
|
-
styles.color =
|
|
72
|
+
styles.backgroundColor = isDisabled ? _Colors.default.grey[400] : _Colors.default.grey[900];
|
|
73
|
+
styles.color = _Colors.default.common.white;
|
|
74
74
|
} else {
|
|
75
|
-
styles.borderColor = isDisabled ?
|
|
76
|
-
styles.color = isDisabled ?
|
|
75
|
+
styles.borderColor = isDisabled ? _Colors.default.grey[400] : _Colors.default.grey[900];
|
|
76
|
+
styles.color = isDisabled ? _Colors.default.grey[400] : _Colors.default.grey[900];
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (rest.color === 'reverse') {
|
|
81
81
|
if (rest.variant === 'contained') {
|
|
82
82
|
styles.backgroundColor = 'rgba(255, 255, 255, 0.9)';
|
|
83
|
-
styles.color =
|
|
83
|
+
styles.color = _Colors.default.grey[900];
|
|
84
84
|
} else {
|
|
85
|
-
styles.borderColor =
|
|
86
|
-
styles.color =
|
|
85
|
+
styles.borderColor = _Colors.default.grey[900];
|
|
86
|
+
styles.color = _Colors.default.grey[900];
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _default.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _default = _interopRequireDefault(require("./themes/default"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 默认 colors, ABT 系列
|
|
10
|
+
*
|
|
11
|
+
* - colors object 结构是在 mui theme#palette object 基础上调整后的结构
|
|
12
|
+
* - 色值在 mui default theme 基础上将 figma 中常用的 colors 进行覆盖
|
|
13
|
+
* - 扩展一些常用色值 (如 DID 系列)
|
|
14
|
+
* - figma: https://www.figma.com/file/1qHyMF137EXOQpSFVByszG/UX-Library?node-id=295%3A1518
|
|
15
|
+
*/
|
|
16
|
+
const colors = {
|
|
17
|
+
common: {
|
|
18
|
+
black: '#000',
|
|
19
|
+
white: '#fff'
|
|
20
|
+
},
|
|
21
|
+
primary: {
|
|
22
|
+
main: '#4F6AF6'
|
|
23
|
+
},
|
|
24
|
+
// override
|
|
25
|
+
secondary: {
|
|
26
|
+
main: '#31AB86'
|
|
27
|
+
},
|
|
28
|
+
// override
|
|
29
|
+
error: {
|
|
30
|
+
main: '#F16E6E'
|
|
31
|
+
},
|
|
32
|
+
// override
|
|
33
|
+
warning: {
|
|
34
|
+
main: '#DE9E37'
|
|
35
|
+
},
|
|
36
|
+
// override
|
|
37
|
+
info: {
|
|
38
|
+
main: '#0775F8'
|
|
39
|
+
},
|
|
40
|
+
// override
|
|
41
|
+
success: {
|
|
42
|
+
main: '#34BE74'
|
|
43
|
+
},
|
|
44
|
+
// override
|
|
45
|
+
grey: {
|
|
46
|
+
50: '#fafafa',
|
|
47
|
+
100: '#f5f5f5',
|
|
48
|
+
200: '#eeeeee',
|
|
49
|
+
300: '#e0e0e0',
|
|
50
|
+
400: '#bdbdbd',
|
|
51
|
+
500: '#9e9e9e',
|
|
52
|
+
600: '#757575',
|
|
53
|
+
700: '#616161',
|
|
54
|
+
800: '#424242',
|
|
55
|
+
900: '#212121',
|
|
56
|
+
A100: '#d5d5d5',
|
|
57
|
+
A200: '#aaaaaa',
|
|
58
|
+
A400: '#303030',
|
|
59
|
+
A700: '#616161'
|
|
60
|
+
},
|
|
61
|
+
text: {
|
|
62
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
63
|
+
secondary: 'rgba(0, 0, 0, 0.54)',
|
|
64
|
+
disabled: 'rgba(0, 0, 0, 0.38)',
|
|
65
|
+
hint: 'rgba(0, 0, 0, 0.38)'
|
|
66
|
+
},
|
|
67
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
68
|
+
background: {
|
|
69
|
+
default: '#fff'
|
|
70
|
+
},
|
|
71
|
+
// 扩展色值, 适用于 did 相关的组件, 如果某些产品整体风格是 did 系列, 可以扩展出一个 did 系列的 theme
|
|
72
|
+
did: {
|
|
73
|
+
primary: '#4598FA',
|
|
74
|
+
secondary: '#49C3AD'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var _default = colors;
|
|
78
|
+
exports.default = _default;
|
package/lib/Footer/index.js
CHANGED
|
@@ -76,4 +76,4 @@ Footer.defaultProps = {
|
|
|
76
76
|
const Container = _styledComponents.default.div.withConfig({
|
|
77
77
|
displayName: "Footer__Container",
|
|
78
78
|
componentId: "sc-1qpifuv-0"
|
|
79
|
-
})(["margin-top:64px;padding:24px 0 32px;border-top:1px solid ", ";box-sizing:border-box;width:100%;.footer{display:flex;align-items:center;justify-content:space-between;@media (max-width:540px){flex-direction:column;align-items:flex-start;justify-content:flex-start;}.footer-item{color:", ";display:flex;align-items:center;flex-wrap:wrap;font-size:0.9rem;}.footer-brand{margin-left:8px;margin-right:8px;}}"], props => props.dark ? props.theme.
|
|
79
|
+
})(["margin-top:64px;padding:24px 0 32px;border-top:1px solid ", ";box-sizing:border-box;width:100%;.footer{display:flex;align-items:center;justify-content:space-between;@media (max-width:540px){flex-direction:column;align-items:flex-start;justify-content:flex-start;}.footer-item{color:", ";display:flex;align-items:center;flex-wrap:wrap;font-size:0.9rem;}.footer-brand{margin-left:8px;margin-right:8px;}}"], props => props.dark ? props.theme.palette.grey[900] : '#dee2e7', props => props.theme.palette.grey[900]);
|
package/lib/Icon/index.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
|
|
14
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
15
15
|
|
|
16
16
|
const _excluded = ["name", "color", "size", "variant", "rounded", "style", "className", "forwardedRef"];
|
|
17
17
|
|
|
@@ -73,7 +73,7 @@ Icon.propTypes = {
|
|
|
73
73
|
Icon.defaultProps = {
|
|
74
74
|
rounded: false,
|
|
75
75
|
variant: 'light',
|
|
76
|
-
color:
|
|
76
|
+
color: _Colors.default.grey[900],
|
|
77
77
|
className: '',
|
|
78
78
|
size: 24,
|
|
79
79
|
style: {}
|
|
@@ -19,6 +19,8 @@ var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
|
19
19
|
|
|
20
20
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
21
21
|
|
|
22
|
+
var _teal = _interopRequireDefault(require("@material-ui/core/colors/teal"));
|
|
23
|
+
|
|
22
24
|
var _image = _interopRequireDefault(require("../../Icon/image"));
|
|
23
25
|
|
|
24
26
|
var _Logo = _interopRequireDefault(require("../../Logo"));
|
|
@@ -105,7 +107,7 @@ const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255
|
|
|
105
107
|
const MenuItem = (0, _styledComponents.default)(_Button.default).withConfig({
|
|
106
108
|
displayName: "sidebar__MenuItem",
|
|
107
109
|
componentId: "sc-gaosgy-1"
|
|
108
|
-
})(["&&{display:block;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;}.MuiButton-label{display:flex;flex-direction:column;justify-content:center;align-items:center;}}"], props => props.selected ? gradient : '', props => props.selected ?
|
|
110
|
+
})(["&&{display:block;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;}.MuiButton-label{display:flex;flex-direction:column;justify-content:center;align-items:center;}}"], props => props.selected ? gradient : '', props => props.selected ? _teal.default.A700 : 'transparent', gradient, _teal.default.A700);
|
|
109
111
|
|
|
110
112
|
var _default = (0, _reactRouterDom.withRouter)((0, _withTheme.default)(Sidebar));
|
|
111
113
|
|
package/lib/Tag/index.js
CHANGED
|
@@ -13,10 +13,10 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
15
15
|
|
|
16
|
-
var _Theme = require("../Theme");
|
|
17
|
-
|
|
18
16
|
var _Util = require("../Util");
|
|
19
17
|
|
|
18
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
19
|
+
|
|
20
20
|
const _excluded = ["type", "content", "children", "style", "className", "forwardedRef"];
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -27,24 +27,24 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
27
27
|
|
|
28
28
|
const types = {
|
|
29
29
|
error: {
|
|
30
|
-
color:
|
|
30
|
+
color: _Colors.default.error.main,
|
|
31
31
|
backgroundColor: 'rgba(227, 91, 84, 0.2)'
|
|
32
32
|
},
|
|
33
33
|
warning: {
|
|
34
|
-
color:
|
|
34
|
+
color: _Colors.default.warning.main,
|
|
35
35
|
backgroundColor: 'rgba(247, 208, 64, 0.2)'
|
|
36
36
|
},
|
|
37
37
|
success: {
|
|
38
|
-
color:
|
|
38
|
+
color: _Colors.default.success.main,
|
|
39
39
|
backgroundColor: '#eafbd9'
|
|
40
40
|
},
|
|
41
41
|
primary: {
|
|
42
|
-
color:
|
|
42
|
+
color: _Colors.default.primary.main,
|
|
43
43
|
backgroundColor: '#ECEFFF'
|
|
44
44
|
},
|
|
45
45
|
reverse: {
|
|
46
|
-
color:
|
|
47
|
-
backgroundColor:
|
|
46
|
+
color: '#fff',
|
|
47
|
+
backgroundColor: '#222'
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
package/lib/Theme/index.js
CHANGED
|
@@ -3,77 +3,59 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.create =
|
|
6
|
+
exports.create = void 0;
|
|
7
7
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
|
|
10
10
|
var _responsiveFontSizes = _interopRequireDefault(require("./responsiveFontSizes"));
|
|
11
11
|
|
|
12
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
13
|
+
|
|
14
|
+
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
|
15
|
+
|
|
12
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
dark: '#4A707C',
|
|
18
|
-
gray: '#222222',
|
|
19
|
-
minor: '#9B9B9B',
|
|
20
|
-
darkText: '#DCDCDC',
|
|
21
|
-
background: '#F7F8F8',
|
|
22
|
-
yellow: '#FFCF71',
|
|
23
|
-
green: '#44cdc6',
|
|
24
|
-
red: '#D0021B',
|
|
25
|
-
blue: '#4E6AF6',
|
|
26
|
-
primary: '#222222',
|
|
27
|
-
black: '#222222',
|
|
28
|
-
secondary: '#44cdc6',
|
|
29
|
-
mint: '#44cdc6',
|
|
30
|
-
textSecondary: '#4A4A4A',
|
|
31
|
-
active: '#5b9025',
|
|
32
|
-
danger: '#D0021B',
|
|
33
|
-
lightGrey: '#BCBCBC'
|
|
34
|
-
}; // https://material-ui.com/customization/default-theme/
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
35
21
|
|
|
36
|
-
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
23
|
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
// https://material-ui.com/customization/default-theme/
|
|
29
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
38
30
|
const create = function create() {
|
|
39
|
-
let {
|
|
31
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
32
|
+
{
|
|
40
33
|
mode = 'light',
|
|
41
34
|
pageWidth = 'md',
|
|
42
35
|
palette,
|
|
43
36
|
typography,
|
|
44
37
|
overrides
|
|
45
|
-
} =
|
|
46
|
-
|
|
38
|
+
} = _ref,
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
|
|
41
|
+
const theme = (0, _styles.createTheme)(_objectSpread({
|
|
47
42
|
themeName: 'ArcBlock',
|
|
48
|
-
palette: Object.assign({
|
|
49
|
-
primary: {
|
|
50
|
-
main: colors.blue,
|
|
51
|
-
contrastText: colors.white
|
|
52
|
-
},
|
|
53
|
-
secondary: {
|
|
54
|
-
main: colors.mint,
|
|
55
|
-
contrastText: colors.white
|
|
56
|
-
},
|
|
57
|
-
danger: {
|
|
58
|
-
main: colors.danger,
|
|
59
|
-
contrastText: colors.white
|
|
60
|
-
},
|
|
61
|
-
text: {
|
|
62
|
-
primary: '#404040',
|
|
63
|
-
contrast: colors.white
|
|
64
|
-
},
|
|
43
|
+
palette: Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
|
65
44
|
background: {
|
|
66
|
-
paper: mode === 'light' ?
|
|
67
|
-
default: mode === 'light' ?
|
|
45
|
+
paper: mode === 'light' ? _Colors.default.common.white : _Colors.default.grey[900],
|
|
46
|
+
default: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
68
47
|
},
|
|
69
48
|
type: mode
|
|
70
|
-
}, palette || {}),
|
|
49
|
+
}), palette || {}),
|
|
71
50
|
typography: Object.assign({
|
|
72
51
|
useNextVariants: true,
|
|
73
52
|
color: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
|
54
|
+
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
|
55
|
+
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
|
56
|
+
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
|
57
|
+
main: mode === 'light' ? '#222222' : _Colors.default.common.white,
|
|
58
|
+
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
|
77
59
|
},
|
|
78
60
|
fontSize: 16,
|
|
79
61
|
fontFamily: ['Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
|
|
@@ -92,7 +74,7 @@ const create = function create() {
|
|
|
92
74
|
},
|
|
93
75
|
MuiToolbar: {
|
|
94
76
|
root: {
|
|
95
|
-
background: mode === 'light' ?
|
|
77
|
+
background: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
96
78
|
}
|
|
97
79
|
},
|
|
98
80
|
MuiTableCell: {
|
|
@@ -105,10 +87,10 @@ const create = function create() {
|
|
|
105
87
|
},
|
|
106
88
|
head: {
|
|
107
89
|
textTransform: 'uppercase',
|
|
108
|
-
color: mode === 'light' ?
|
|
90
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
109
91
|
},
|
|
110
92
|
body: {
|
|
111
|
-
color: mode === 'light' ?
|
|
93
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
112
94
|
}
|
|
113
95
|
},
|
|
114
96
|
MuiChip: {
|
|
@@ -131,17 +113,38 @@ const create = function create() {
|
|
|
131
113
|
},
|
|
132
114
|
MuiTypography: {
|
|
133
115
|
body1: {
|
|
134
|
-
color: mode === 'light' ?
|
|
116
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
135
117
|
},
|
|
136
118
|
body2: {
|
|
137
|
-
color: mode === 'light' ?
|
|
119
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
138
120
|
}
|
|
139
121
|
}
|
|
140
122
|
}, overrides || {}),
|
|
141
123
|
pageWidth,
|
|
142
|
-
colors,
|
|
124
|
+
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
|
125
|
+
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
|
126
|
+
colors: {
|
|
127
|
+
white: '#FFFFFF',
|
|
128
|
+
dark: '#4A707C',
|
|
129
|
+
gray: '#222222',
|
|
130
|
+
minor: '#9B9B9B',
|
|
131
|
+
darkText: '#DCDCDC',
|
|
132
|
+
background: '#F7F8F8',
|
|
133
|
+
yellow: '#FFCF71',
|
|
134
|
+
green: '#44cdc6',
|
|
135
|
+
red: '#D0021B',
|
|
136
|
+
blue: '#4E6AF6',
|
|
137
|
+
primary: '#222222',
|
|
138
|
+
black: '#222222',
|
|
139
|
+
secondary: '#44cdc6',
|
|
140
|
+
mint: '#44cdc6',
|
|
141
|
+
textSecondary: '#4A4A4A',
|
|
142
|
+
active: '#5b9025',
|
|
143
|
+
danger: '#D0021B',
|
|
144
|
+
lightGrey: '#BCBCBC'
|
|
145
|
+
},
|
|
143
146
|
mode
|
|
144
|
-
});
|
|
147
|
+
}, rest));
|
|
145
148
|
const enhanced = (0, _responsiveFontSizes.default)(theme, {
|
|
146
149
|
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
|
147
150
|
disableAlign: false,
|
package/lib/Util/index.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.setDateTool = setDateTool;
|
|
|
11
11
|
exports.getDateTool = getDateTool;
|
|
12
12
|
exports.formatToDate = formatToDate;
|
|
13
13
|
exports.formatToDatetime = formatToDatetime;
|
|
14
|
+
exports.openWebWallet = openWebWallet;
|
|
14
15
|
exports.formatUptime = exports.str2color = exports.getTimezone = exports.getBackground = exports.getColor = void 0;
|
|
15
16
|
|
|
16
17
|
var _padStart = _interopRequireDefault(require("lodash/padStart"));
|
|
@@ -31,6 +32,13 @@ function parseQuery(str) {
|
|
|
31
32
|
return memo;
|
|
32
33
|
}, {});
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @param {number} opts.expireInDays
|
|
37
|
+
* @param {string} opts.path
|
|
38
|
+
* @param {domain} opts.domain
|
|
39
|
+
* @param {boolean} opts.returnDomain if === false, opts.domain will be skipped
|
|
40
|
+
*/
|
|
41
|
+
|
|
34
42
|
|
|
35
43
|
function getCookieOptions() {
|
|
36
44
|
let expireInDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
@@ -56,7 +64,11 @@ function getCookieOptions() {
|
|
|
56
64
|
domain: opts.domain || ''
|
|
57
65
|
};
|
|
58
66
|
|
|
59
|
-
if (typeof window === 'undefined' || opts.domain) {
|
|
67
|
+
if (typeof window === 'undefined' || opts.domain || opts.returnDomain === false) {
|
|
68
|
+
if (opts.returnDomain === false) {
|
|
69
|
+
delete options.domain;
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
return options;
|
|
61
73
|
}
|
|
62
74
|
|
|
@@ -266,4 +278,46 @@ function formatToDatetime(date) {
|
|
|
266
278
|
locale,
|
|
267
279
|
tz
|
|
268
280
|
});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function openWebWallet(_ref3) {
|
|
284
|
+
let {
|
|
285
|
+
webWalletUrl,
|
|
286
|
+
action = 'login',
|
|
287
|
+
locale = 'en',
|
|
288
|
+
url,
|
|
289
|
+
windowFeatures
|
|
290
|
+
} = _ref3;
|
|
291
|
+
const defaultWindowFeatures = {
|
|
292
|
+
toolbar: 'no',
|
|
293
|
+
location: 'no',
|
|
294
|
+
status: 'no',
|
|
295
|
+
menubar: 'no',
|
|
296
|
+
scrollbars: 'yes',
|
|
297
|
+
resizable: 'yes',
|
|
298
|
+
// iphone 8plus size
|
|
299
|
+
width: 414,
|
|
300
|
+
height: 736
|
|
301
|
+
};
|
|
302
|
+
const windowUrl = "".concat(webWalletUrl, "?action=").concat(action, "&locale=").concat(locale, "&url=").concat(encodeURIComponent(url));
|
|
303
|
+
const mergedWindowFeatures = Object.assign({}, defaultWindowFeatures, windowFeatures);
|
|
304
|
+
|
|
305
|
+
const getWindowWidth = win => {
|
|
306
|
+
return win.innerWidth || win.document.documentElement.clientWidth || win.document.body.clientWidth;
|
|
307
|
+
}; // 默认在浏览器右上角弹出窗口
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
if (!('left' in mergedWindowFeatures)) {
|
|
311
|
+
const winWidth = getWindowWidth(window.top || window);
|
|
312
|
+
const winLeft = window.screenLeft || window.screenX;
|
|
313
|
+
mergedWindowFeatures.left = winWidth + winLeft - mergedWindowFeatures.width;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (!('top' in mergedWindowFeatures)) {
|
|
317
|
+
const winTop = window.screenTop || window.screenY;
|
|
318
|
+
mergedWindowFeatures.top = winTop;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const strWindowFeatures = Object.keys(mergedWindowFeatures).map(key => "".concat(key, "=").concat(mergedWindowFeatures[key])).join(',');
|
|
322
|
+
window.open(windowUrl, 'targetWindow', strWindowFeatures);
|
|
269
323
|
}
|
package/lib/Wallet/Action.js
CHANGED
|
@@ -17,7 +17,7 @@ var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
|
|
|
17
17
|
|
|
18
18
|
var _Util = require("../Util");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
21
21
|
|
|
22
22
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
23
23
|
|
|
@@ -100,4 +100,4 @@ const sizes = {
|
|
|
100
100
|
const Content = _styledComponents.default.div.withConfig({
|
|
101
101
|
displayName: "Action__Content",
|
|
102
102
|
componentId: "sc-zuf4zr-0"
|
|
103
|
-
})(["display:flex;justify-content:center;align-items:center;&:hover{opacity:0.9;}.wallet-action__logo{width:auto;height:auto;max-width:", "px;margin-left:5px;}.wallet-action__text{padding:8px;display:flex;height:100%;flex-direction:column;justify-content:space-between;align-items:flex-start;}.wallet-action__action{font-size:", "px;text-transform:capitalize;margin-bottom:1px;color:", ";letter-spacing:1px;}.wallet-action__title{font-size:", "px;text-transform:capitalize;color:", ";letter-spacing:1px;}"], props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color ||
|
|
103
|
+
})(["display:flex;justify-content:center;align-items:center;&:hover{opacity:0.9;}.wallet-action__logo{width:auto;height:auto;max-width:", "px;margin-left:5px;}.wallet-action__text{padding:8px;display:flex;height:100%;flex-direction:column;justify-content:space-between;align-items:flex-start;}.wallet-action__action{font-size:", "px;text-transform:capitalize;margin-bottom:1px;color:", ";letter-spacing:1px;}.wallet-action__title{font-size:", "px;text-transform:capitalize;color:", ";letter-spacing:1px;}"], props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color || _Colors.default.primary.main, props => sizes.font[props.size] * 1.5, props => props.color || _Colors.default.primary.main);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.26",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=16.12.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "8a7c124f0e96d768d52239970309264eac5770ef",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^1.15.
|
|
58
|
-
"@arcblock/react-hooks": "^1.15.
|
|
57
|
+
"@arcblock/icons": "^1.15.26",
|
|
58
|
+
"@arcblock/react-hooks": "^1.15.26",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@material-ui/core": "^4.12.3",
|
|
61
61
|
"@material-ui/icons": "4.11.2",
|