@arcblock/ux 1.17.2 → 1.17.5

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = ResultWrapper;
6
+ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -35,7 +35,7 @@ const componentsKeyByStatus = Object.keys(common).reduce((acc, cur) => _objectSp
35
35
  [common[cur].status || cur]: common[cur]
36
36
  }), {});
37
37
 
38
- function ResultWrapper(_ref) {
38
+ const ResultWrapper = _ref => {
39
39
  let {
40
40
  status
41
41
  } = _ref,
@@ -51,11 +51,16 @@ function ResultWrapper(_ref) {
51
51
  }
52
52
 
53
53
  return /*#__PURE__*/_react.default.createElement(_result.default, rest);
54
- }
54
+ };
55
55
 
56
- ResultWrapper.propTypes = {
56
+ ResultWrapper.propTypes = _objectSpread(_objectSpread({
57
57
  status: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
58
- };
58
+ }, _result.default.propTypes), {}, {
59
+ title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element])
60
+ });
59
61
  ResultWrapper.defaultProps = {
60
- status: ''
61
- };
62
+ status: '',
63
+ title: ''
64
+ };
65
+ var _default = ResultWrapper;
66
+ exports.default = _default;
@@ -21,7 +21,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
21
21
 
22
22
  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; }
23
23
 
24
- function Result(_ref) {
24
+ const Result = _ref => {
25
25
  let {
26
26
  icon,
27
27
  title,
@@ -44,20 +44,20 @@ function Result(_ref) {
44
44
  }, description) : description, /*#__PURE__*/_react.default.createElement(_Box.default, {
45
45
  mt: 3
46
46
  }, extra));
47
- }
47
+ };
48
48
 
49
49
  Result.propTypes = {
50
- icon: _propTypes.default.any,
51
- title: _propTypes.default.any.isRequired,
52
- description: _propTypes.default.any,
50
+ icon: _propTypes.default.element,
51
+ title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]).isRequired,
52
+ description: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
53
53
  actions: _propTypes.default.any,
54
- extra: _propTypes.default.any
54
+ extra: _propTypes.default.element
55
55
  };
56
56
  Result.defaultProps = {
57
- icon: '',
57
+ icon: undefined,
58
58
  description: '',
59
59
  actions: null,
60
- extra: null
60
+ extra: undefined
61
61
  };
62
62
 
63
63
  const Root = _styledComponents.default.div.withConfig({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "1.17.2",
3
+ "version": "1.17.5",
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": "b4ad05835c48de8bab476985ed5dcdf53a2e9b5d",
56
+ "gitHead": "d7487bcc642ff0bc1c4a40b7aef019cbf4210275",
57
57
  "dependencies": {
58
- "@arcblock/icons": "^1.17.2",
59
- "@arcblock/react-hooks": "^1.17.2",
58
+ "@arcblock/icons": "^1.17.5",
59
+ "@arcblock/react-hooks": "^1.17.5",
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",
@@ -8,7 +8,7 @@ const componentsKeyByStatus = Object.keys(common).reduce(
8
8
  {}
9
9
  );
10
10
 
11
- export default function ResultWrapper({ status, ...rest }) {
11
+ const ResultWrapper = ({ status, ...rest }) => {
12
12
  if (status) {
13
13
  if (componentsKeyByStatus[status]) {
14
14
  const Component = componentsKeyByStatus[status];
@@ -21,11 +21,16 @@ export default function ResultWrapper({ status, ...rest }) {
21
21
  );
22
22
  }
23
23
  return <Result {...rest} />;
24
- }
24
+ };
25
25
 
26
26
  ResultWrapper.propTypes = {
27
27
  status: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
28
+ ...Result.propTypes,
29
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
28
30
  };
29
31
  ResultWrapper.defaultProps = {
30
32
  status: '',
33
+ title: '',
31
34
  };
35
+
36
+ export default ResultWrapper;
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import Box from '@material-ui/core/Box';
5
5
 
6
- function Result({ icon, title, description, extra, ...rest }) {
6
+ const Result = ({ icon, title, description, extra, ...rest }) => {
7
7
  return (
8
8
  <Root {...rest}>
9
9
  {icon}
@@ -26,20 +26,20 @@ function Result({ icon, title, description, extra, ...rest }) {
26
26
  <Box mt={3}>{extra}</Box>
27
27
  </Root>
28
28
  );
29
- }
29
+ };
30
30
 
31
31
  Result.propTypes = {
32
- icon: PropTypes.any,
33
- title: PropTypes.any.isRequired,
34
- description: PropTypes.any,
32
+ icon: PropTypes.element,
33
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
34
+ description: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
35
35
  actions: PropTypes.any,
36
- extra: PropTypes.any,
36
+ extra: PropTypes.element,
37
37
  };
38
38
  Result.defaultProps = {
39
- icon: '',
39
+ icon: undefined,
40
40
  description: '',
41
41
  actions: null,
42
- extra: null,
42
+ extra: undefined,
43
43
  };
44
44
 
45
45
  const Root = styled.div`