@arcblock/ux 2.1.43 → 2.1.44

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.
@@ -148,7 +148,6 @@ function CodeBlock(_ref) {
148
148
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_IconButton.default, {
149
149
  className: "copy-button",
150
150
  onClick: onCopy,
151
- tabIndex: "-1",
152
151
  color: "primary",
153
152
  disabled: copied,
154
153
  children: [!copied && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileCopy.default, {
@@ -181,4 +180,4 @@ const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monos
181
180
  const Pre = _styledComponents.default.pre.withConfig({
182
181
  displayName: "CodeBlock__Pre",
183
182
  componentId: "sc-1bpapaq-0"
184
- })(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:block;}}code{counter-reset:line;counter-increment:line;padding:16px;font-family:", ";color:#fff;*{font-family:", ";}}.hljs *{white-space:normal;}"], fontFamily, _Colors.default.primary.main, fontFamily, fontFamily);
183
+ })(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:flex;}}code{counter-reset:line;counter-increment:line;padding:16px;font-family:", ";color:#fff;*{font-family:", ";}}.hljs *{white-space:normal;}"], fontFamily, _Colors.default.primary.main, fontFamily, fontFamily);
@@ -83,8 +83,8 @@ function FixWidthNumber(_ref) {
83
83
 
84
84
  class CountDown extends _react.Component {
85
85
  constructor(props) {
86
+ super(props);
86
87
  const newProps = (0, _Util.mergeProps)(props, CountDown, ['dark', 'endTime', 'style']);
87
- super(newProps);
88
88
  this.state = getRemaining(newProps.endTime);
89
89
  this.timer = null;
90
90
  }
@@ -31,8 +31,9 @@ function Footer(props) {
31
31
  brand,
32
32
  dark
33
33
  } = newProps;
34
- const endYear = new Date().getFullYear();
35
- const copyYear = endYear === copyStart ? endYear : "".concat(copyStart, "-").concat(endYear);
34
+ const endYearString = "".concat(new Date().getFullYear());
35
+ const copyStartString = "".concat(copyStart);
36
+ const copyYear = endYearString === copyStartString ? endYearString : "".concat(copyStartString, "-").concat(endYearString);
36
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
37
38
  className: className,
38
39
  style: style,
@@ -73,7 +74,7 @@ function Footer(props) {
73
74
  Footer.propTypes = {
74
75
  dark: _propTypes.default.bool,
75
76
  className: _propTypes.default.string,
76
- copyStart: _propTypes.default.string,
77
+ copyStart: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
77
78
  brand: _propTypes.default.string,
78
79
  style: _propTypes.default.object
79
80
  };
@@ -74,7 +74,7 @@ InfoRow.defaultProps = {
74
74
  const resetName = name.split(' ').map(x => (0, _upperFirst.default)((0, _camelCase.default)(x))).join(' ');
75
75
  return typeof name === 'string' ? resetName : name;
76
76
  },
77
- valueComponent: 'p',
77
+ valueComponent: 'div',
78
78
  layout: 'horizontal'
79
79
  };
80
80
 
@@ -31,7 +31,7 @@ function Metric(_ref) {
31
31
  className: "metric__image",
32
32
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_image.default, {
33
33
  name: icon,
34
- alt: name,
34
+ alt: typeof name === 'string' ? name : '',
35
35
  size: 30,
36
36
  prefix: prefix,
37
37
  color: "#222222"
@@ -59,7 +59,7 @@ function Metric(_ref) {
59
59
  Metric.propTypes = {
60
60
  icon: _propTypes.default.string.isRequired,
61
61
  value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
62
- name: _propTypes.default.string.isRequired,
62
+ name: _propTypes.default.node.isRequired,
63
63
  animated: _propTypes.default.bool,
64
64
  url: _propTypes.default.string,
65
65
  LinkComponent: _propTypes.default.any,
@@ -26,7 +26,7 @@ function PricingPlan(_ref) {
26
26
  plan
27
27
  } = _ref;
28
28
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanCard, {
29
- shadow: true,
29
+ $shadow: true,
30
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
31
31
  className: "card-header",
32
32
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -77,4 +77,4 @@ PricingPlan.propTypes = {
77
77
  const PlanCard = (0, _styledComponents.default)(_Card.default).withConfig({
78
78
  displayName: "PricingPlan__PlanCard",
79
79
  componentId: "sc-11tuq1x-0"
80
- })(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props.shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)');
80
+ })(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)');
@@ -29,7 +29,10 @@ function PricingTable(_ref) {
29
29
  container: true,
30
30
  spacing: 2,
31
31
  justifyContent: "center",
32
- children: plans.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
32
+ children: plans.map((x, index) =>
33
+ /*#__PURE__*/
34
+ // eslint-disable-next-line react/no-array-index-key
35
+ (0, _jsxRuntime.jsx)(_Grid.default, {
33
36
  item: true,
34
37
  className: "plan-item",
35
38
  xs: 12,
@@ -38,7 +41,7 @@ function PricingTable(_ref) {
38
41
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PricingPlan.default, {
39
42
  plan: x
40
43
  })
41
- }, x.id))
44
+ }, index))
42
45
  })
43
46
  });
44
47
  }
@@ -166,7 +166,9 @@ function Screenshot(props) {
166
166
  className: "device-frame",
167
167
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
168
168
  className: "device-content",
169
- children: findChildren(_react.Children.toArray(children))
169
+ children: findChildren(_react.Children.toArray(children)).map((item, index) => /*#__PURE__*/(0, _react.cloneElement)(item, {
170
+ key: index
171
+ }))
170
172
  })
171
173
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
172
174
  className: "device-stripe"
package/lib/Tabs/index.js CHANGED
@@ -58,7 +58,7 @@ function Tabs(_ref2) {
58
58
  rest = _objectWithoutProperties(_ref2, _excluded);
59
59
 
60
60
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTabs, _objectSpread(_objectSpread({
61
- scrollButtons: "on",
61
+ scrollButtons: "auto",
62
62
  variant: "scrollable",
63
63
  value: current,
64
64
  onChange: (_, newValue) => _onChange(newValue),
@@ -63,7 +63,7 @@ function Video(props) {
63
63
  style: styles,
64
64
  src: url,
65
65
  onLoad: () => setLoaded(true),
66
- allowFullScreen: "true"
66
+ allowFullScreen: true
67
67
  }), !loaded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
68
68
  className: "loading-indicator",
69
69
  color: "primary"
@@ -84,7 +84,7 @@ function WalletAction(props) {
84
84
 
85
85
  WalletAction.propTypes = {
86
86
  action: _propTypes.default.string,
87
- size: _propTypes.default.oneOf(['large', 'medium', 'small']),
87
+ size: _propTypes.default.oneOf(['xlarge', 'large', 'medium', 'small']),
88
88
  textLayout: _propTypes.default.oneOf(['vertical', 'horizontal']),
89
89
  style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string])
90
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.1.43",
3
+ "version": "2.1.44",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -52,10 +52,10 @@
52
52
  "react": ">=18.1.0",
53
53
  "react-ga": "^2.7.0"
54
54
  },
55
- "gitHead": "a9cd5a9d9c5e58bba3a4adbf13069ebc37120515",
55
+ "gitHead": "20e72c7ddc7f6f67d2b14782044bfc8e9609ca36",
56
56
  "dependencies": {
57
- "@arcblock/icons": "^2.1.43",
58
- "@arcblock/react-hooks": "^2.1.43",
57
+ "@arcblock/icons": "^2.1.44",
58
+ "@arcblock/react-hooks": "^2.1.44",
59
59
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
60
60
  "@emotion/react": "^11.9.0",
61
61
  "@emotion/styled": "^11.8.1",
@@ -74,7 +74,7 @@ export default function CodeBlock({ code, language, children, ...rest }) {
74
74
  dangerouslySetInnerHTML={{ __html: hljs.highlightAuto(source, [language]).value }}
75
75
  />
76
76
  </span>
77
- <Button className="copy-button" onClick={onCopy} tabIndex="-1" color="primary" disabled={copied}>
77
+ <Button className="copy-button" onClick={onCopy} color="primary" disabled={copied}>
78
78
  {!copied && <CopyIcon style={{ color: '#fff', fontSize: 16 }} />}
79
79
  {copied && <CheckIcon style={{ color: '#fff', fontSize: 16 }} />}
80
80
  </Button>
@@ -134,7 +134,7 @@ const Pre = styled.pre`
134
134
 
135
135
  &:hover {
136
136
  .copy-button {
137
- display: block;
137
+ display: flex;
138
138
  }
139
139
  }
140
140
 
@@ -43,8 +43,8 @@ function FixWidthNumber({ number, label, length = 2 }) {
43
43
 
44
44
  export default class CountDown extends Component {
45
45
  constructor(props) {
46
+ super(props);
46
47
  const newProps = mergeProps(props, CountDown, ['dark', 'endTime', 'style']);
47
- super(newProps);
48
48
  this.state = getRemaining(newProps.endTime);
49
49
  this.timer = null;
50
50
  }
@@ -11,8 +11,9 @@ export default function Footer(props) {
11
11
  const newProps = mergeProps(props, Footer, ['dark', 'style']);
12
12
  const { className, copyStart, style, brand, dark } = newProps;
13
13
 
14
- const endYear = new Date().getFullYear();
15
- const copyYear = endYear === copyStart ? endYear : `${copyStart}-${endYear}`;
14
+ const endYearString = `${new Date().getFullYear()}`;
15
+ const copyStartString = `${copyStart}`;
16
+ const copyYear = endYearString === copyStartString ? endYearString : `${copyStartString}-${endYearString}`;
16
17
 
17
18
  return (
18
19
  <Container className={className} style={style} dark={dark}>
@@ -35,7 +36,7 @@ export default function Footer(props) {
35
36
  Footer.propTypes = {
36
37
  dark: PropTypes.bool,
37
38
  className: PropTypes.string,
38
- copyStart: PropTypes.string,
39
+ copyStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
39
40
  brand: PropTypes.string,
40
41
  style: PropTypes.object,
41
42
  };
@@ -40,7 +40,7 @@ InfoRow.defaultProps = {
40
40
 
41
41
  return typeof name === 'string' ? resetName : name;
42
42
  },
43
- valueComponent: 'p',
43
+ valueComponent: 'div',
44
44
  layout: 'horizontal',
45
45
  };
46
46
 
@@ -8,7 +8,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
8
8
  const metric = (
9
9
  <>
10
10
  <div className="metric__image">
11
- <ImageIcon name={icon} alt={name} size={30} prefix={prefix} color="#222222" />
11
+ <ImageIcon name={icon} alt={typeof name === 'string' ? name : ''} size={30} prefix={prefix} color="#222222" />
12
12
  </div>
13
13
  <div>
14
14
  <div
@@ -26,7 +26,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
26
26
  Metric.propTypes = {
27
27
  icon: PropTypes.string.isRequired,
28
28
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
29
- name: PropTypes.string.isRequired,
29
+ name: PropTypes.node.isRequired,
30
30
  animated: PropTypes.bool,
31
31
  url: PropTypes.string,
32
32
  LinkComponent: PropTypes.any,
@@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography';
8
8
 
9
9
  function PricingPlan({ plan }) {
10
10
  return (
11
- <PlanCard shadow>
11
+ <PlanCard $shadow>
12
12
  <div className="card-header">
13
13
  <div className="title">{plan.name}</div>
14
14
  </div>
@@ -54,7 +54,7 @@ const PlanCard = styled(Card)`
54
54
  }
55
55
 
56
56
  && {
57
- ${(props) => (props.shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)')}
57
+ ${(props) => (props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)')}
58
58
  }
59
59
 
60
60
  .card-header {
@@ -9,8 +9,9 @@ function PricingTable({ plans }) {
9
9
  return (
10
10
  <Div variant="even">
11
11
  <Grid container spacing={2} justifyContent="center">
12
- {plans.map((x) => (
13
- <Grid item className="plan-item" key={x.id} xs={12} sm={6} md={3}>
12
+ {plans.map((x, index) => (
13
+ // eslint-disable-next-line react/no-array-index-key
14
+ <Grid item className="plan-item" key={index} xs={12} sm={6} md={3}>
14
15
  <PricingPlan plan={x} />
15
16
  </Grid>
16
17
  ))}
@@ -1,4 +1,4 @@
1
- import { createElement, Children } from 'react';
1
+ import { createElement, Children, cloneElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
@@ -130,7 +130,10 @@ function Screenshot(props) {
130
130
  contentRadius={borderRadius}
131
131
  contentZIndex={zIndex}>
132
132
  <div className="device-frame">
133
- <div className="device-content">{findChildren(Children.toArray(children))}</div>
133
+ <div className="device-content">
134
+ {/* eslint-disable-next-line react/no-array-index-key */}
135
+ {findChildren(Children.toArray(children)).map((item, index) => cloneElement(item, { key: index }))}
136
+ </div>
134
137
  </div>
135
138
  <div className="device-stripe" />
136
139
  <div className="device-header" />
package/src/Tabs/index.js CHANGED
@@ -24,7 +24,7 @@ const StyledMuiTabs = styled(MuiTabs)(({ theme }) => ({
24
24
  export default function Tabs({ tabs, current, onChange, ...rest }) {
25
25
  return (
26
26
  <StyledMuiTabs
27
- scrollButtons="on"
27
+ scrollButtons="auto"
28
28
  variant="scrollable"
29
29
  value={current}
30
30
  onChange={(_, newValue) => onChange(newValue)}
@@ -23,7 +23,7 @@ export default function Video(props) {
23
23
  if (url.indexOf('v.qq.com') > 0) {
24
24
  return (
25
25
  <Placeholder style={{ width, height }}>
26
- <iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen="true" />
26
+ <iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen />
27
27
  {!loaded && <CircularProgress className="loading-indicator" color="primary" />}
28
28
  </Placeholder>
29
29
  );
@@ -35,7 +35,7 @@ export default function WalletAction(props) {
35
35
 
36
36
  WalletAction.propTypes = {
37
37
  action: PropTypes.string,
38
- size: PropTypes.oneOf(['large', 'medium', 'small']),
38
+ size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small']),
39
39
  textLayout: PropTypes.oneOf(['vertical', 'horizontal']),
40
40
  style: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
41
41
  };