@arcblock/ux 1.16.45 → 1.16.48
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/Center/index.js +30 -4
- package/lib/Theme/index.js +15 -1
- package/package.json +4 -4
- package/src/Center/index.js +26 -3
- package/src/Theme/index.js +14 -0
package/lib/Center/index.js
CHANGED
|
@@ -9,17 +9,43 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {string} relative 容器相对尺寸,默认相对屏幕(screen),可设置为父容器(parent)
|
|
19
|
+
* @returns react component element
|
|
20
|
+
*/
|
|
15
21
|
function Center(_ref) {
|
|
16
22
|
let {
|
|
17
|
-
children
|
|
23
|
+
children,
|
|
24
|
+
relative
|
|
18
25
|
} = _ref;
|
|
19
|
-
|
|
26
|
+
let style = {};
|
|
27
|
+
|
|
28
|
+
if (relative === 'parent') {
|
|
29
|
+
style = {
|
|
30
|
+
width: '100%',
|
|
31
|
+
height: '100%'
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(Div, {
|
|
36
|
+
style: style
|
|
37
|
+
}, children);
|
|
20
38
|
}
|
|
21
39
|
|
|
22
40
|
const Div = _styledComponents.default.div.withConfig({
|
|
23
41
|
displayName: "Center__Div",
|
|
24
42
|
componentId: "sc-1kmxe8v-0"
|
|
25
|
-
})(["flex:1;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;"]);
|
|
43
|
+
})(["flex:1;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;"]);
|
|
44
|
+
|
|
45
|
+
Center.propTypes = {
|
|
46
|
+
children: _propTypes.default.any.isRequired,
|
|
47
|
+
relative: _propTypes.default.string
|
|
48
|
+
};
|
|
49
|
+
Center.defaultProps = {
|
|
50
|
+
relative: 'screen'
|
|
51
|
+
};
|
package/lib/Theme/index.js
CHANGED
|
@@ -61,7 +61,16 @@ const create = function create() {
|
|
|
61
61
|
main: mode === 'light' ? '#222222' : _Colors.default.common.white,
|
|
62
62
|
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
|
63
63
|
},
|
|
64
|
-
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
|
|
64
|
+
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
|
65
|
+
// 按最新设计规范, 只使用 400/700
|
|
66
|
+
fontWeightLight: 400,
|
|
67
|
+
fontWeightRegular: 400,
|
|
68
|
+
fontWeightMedium: 700,
|
|
69
|
+
fontWeightBold: 700,
|
|
70
|
+
// button 默认使用粗体
|
|
71
|
+
button: {
|
|
72
|
+
fontWeight: 700
|
|
73
|
+
}
|
|
65
74
|
}, typography || {}),
|
|
66
75
|
overrides: Object.assign({
|
|
67
76
|
MuiButton: {
|
|
@@ -69,6 +78,11 @@ const create = function create() {
|
|
|
69
78
|
boxShadow: 'none'
|
|
70
79
|
}
|
|
71
80
|
},
|
|
81
|
+
MuiButtonGroup: {
|
|
82
|
+
contained: {
|
|
83
|
+
boxShadow: 'none'
|
|
84
|
+
}
|
|
85
|
+
},
|
|
72
86
|
MuiAppBar: {
|
|
73
87
|
root: {
|
|
74
88
|
height: 80
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.48",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"react": ">=16.12.0",
|
|
54
54
|
"react-ga": "^2.7.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6fb13a2226018acdb6c94afa583aec471f007530",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@arcblock/icons": "^1.16.
|
|
59
|
-
"@arcblock/react-hooks": "^1.16.
|
|
58
|
+
"@arcblock/icons": "^1.16.48",
|
|
59
|
+
"@arcblock/react-hooks": "^1.16.48",
|
|
60
60
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
61
61
|
"@fontsource/lato": "^4.5.3",
|
|
62
62
|
"@material-ui/core": "^4.12.3",
|
package/src/Center/index.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {string} relative 容器相对尺寸,默认相对屏幕(screen),可设置为父容器(parent)
|
|
8
|
+
* @returns react component element
|
|
9
|
+
*/
|
|
10
|
+
export default function Center({ children, relative }) {
|
|
11
|
+
let style = {};
|
|
12
|
+
|
|
13
|
+
if (relative === 'parent') {
|
|
14
|
+
style = {
|
|
15
|
+
width: '100%',
|
|
16
|
+
height: '100%',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return <Div style={style}>{children}</Div>;
|
|
7
21
|
}
|
|
8
22
|
|
|
9
23
|
const Div = styled.div`
|
|
@@ -15,3 +29,12 @@ const Div = styled.div`
|
|
|
15
29
|
justify-content: center;
|
|
16
30
|
align-items: center;
|
|
17
31
|
`;
|
|
32
|
+
|
|
33
|
+
Center.propTypes = {
|
|
34
|
+
children: PropTypes.any.isRequired,
|
|
35
|
+
relative: PropTypes.string,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Center.defaultProps = {
|
|
39
|
+
relative: 'screen',
|
|
40
|
+
};
|
package/src/Theme/index.js
CHANGED
|
@@ -53,6 +53,15 @@ export const create = ({
|
|
|
53
53
|
'"Segoe UI Emoji"',
|
|
54
54
|
'"Segoe UI Symbol"',
|
|
55
55
|
].join(','),
|
|
56
|
+
// 按最新设计规范, 只使用 400/700
|
|
57
|
+
fontWeightLight: 400,
|
|
58
|
+
fontWeightRegular: 400,
|
|
59
|
+
fontWeightMedium: 700,
|
|
60
|
+
fontWeightBold: 700,
|
|
61
|
+
// button 默认使用粗体
|
|
62
|
+
button: {
|
|
63
|
+
fontWeight: 700,
|
|
64
|
+
},
|
|
56
65
|
},
|
|
57
66
|
typography || {}
|
|
58
67
|
),
|
|
@@ -63,6 +72,11 @@ export const create = ({
|
|
|
63
72
|
boxShadow: 'none',
|
|
64
73
|
},
|
|
65
74
|
},
|
|
75
|
+
MuiButtonGroup: {
|
|
76
|
+
contained: {
|
|
77
|
+
boxShadow: 'none',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
66
80
|
MuiAppBar: {
|
|
67
81
|
root: {
|
|
68
82
|
height: 80,
|