@arcblock/ux 2.1.18 → 2.1.21

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.
Files changed (164) hide show
  1. package/lib/ActionButton/index.js +16 -8
  2. package/lib/ActivityIndicator/index.js +49 -36
  3. package/lib/Alert/index.js +25 -17
  4. package/lib/AnimationWaiter/index.js +44 -35
  5. package/lib/Async/index.js +15 -3
  6. package/lib/Badge/index.js +14 -4
  7. package/lib/Blocklet/blocklet.js +81 -62
  8. package/lib/BlockletNFT/index.js +95 -76
  9. package/lib/Button/wrap.js +13 -9
  10. package/lib/Center/index.js +6 -5
  11. package/lib/ClickToCopy/index.js +31 -21
  12. package/lib/CodeBlock/index.js +35 -27
  13. package/lib/ContactForm/index.js +46 -41
  14. package/lib/CookieConsent/index.js +33 -21
  15. package/lib/CountDown/index.js +50 -34
  16. package/lib/Datatable/CustomToolbar.js +138 -97
  17. package/lib/Datatable/DatatableContext.js +9 -12
  18. package/lib/Datatable/TableSearch.js +44 -27
  19. package/lib/Datatable/index.js +44 -28
  20. package/lib/Dialog/confirm.js +26 -13
  21. package/lib/Dialog/dialog.js +42 -26
  22. package/lib/DriftBot/index.js +2 -2
  23. package/lib/Earth/index.js +121 -107
  24. package/lib/Empty/index.js +19 -10
  25. package/lib/ErrorBoundary/fallback.js +18 -12
  26. package/lib/Footer/index.js +32 -26
  27. package/lib/Header/header.js +37 -21
  28. package/lib/Header/responsive-header.js +40 -30
  29. package/lib/Icon/image.js +22 -15
  30. package/lib/Icon/index.js +17 -7
  31. package/lib/Img/index.js +34 -32
  32. package/lib/InfoRow/index.js +23 -13
  33. package/lib/Layout/dashboard/index.js +66 -54
  34. package/lib/Layout/dashboard/sidebar.js +39 -26
  35. package/lib/Layout/dashboard-legacy/header.js +56 -38
  36. package/lib/Layout/dashboard-legacy/index.js +54 -44
  37. package/lib/Layout/dashboard-legacy/sidebar.js +48 -38
  38. package/lib/Layout/index.js +147 -111
  39. package/lib/Locale/context.js +8 -10
  40. package/lib/Locale/selector.js +55 -41
  41. package/lib/Logo/index.js +50 -30
  42. package/lib/Metric/index.js +30 -23
  43. package/lib/NFTDisplay/aspect-ratio-container.js +15 -6
  44. package/lib/NFTDisplay/broken.js +3 -3
  45. package/lib/NFTDisplay/index.js +29 -28
  46. package/lib/NFTDisplay/loading.js +6 -5
  47. package/lib/NFTDisplay/svg-embedder/img.js +10 -4
  48. package/lib/NFTDisplay/svg-embedder/inline-svg.js +14 -6
  49. package/lib/NavMenu/nav-menu.js +60 -49
  50. package/lib/PageScroller/index.js +29 -27
  51. package/lib/PageScroller/usePrevValue.js +1 -5
  52. package/lib/PricingTable/PricingPlan.js +46 -36
  53. package/lib/PricingTable/index.js +22 -20
  54. package/lib/QRCode/index.js +6 -9
  55. package/lib/RelativeTime/index.js +14 -5
  56. package/lib/Result/common.js +49 -44
  57. package/lib/Result/index.js +6 -6
  58. package/lib/Result/result.js +29 -18
  59. package/lib/Screenshot/index.js +32 -21
  60. package/lib/Spinner/index.js +3 -3
  61. package/lib/SplitButton/index.js +40 -24
  62. package/lib/Switch/index.js +12 -6
  63. package/lib/Tabs/index.js +18 -12
  64. package/lib/Tag/index.js +14 -4
  65. package/lib/Terminal/Player.js +108 -92
  66. package/lib/Terminal/index.js +3 -1
  67. package/lib/TextCollapse/index.js +18 -8
  68. package/lib/Toast/index.js +17 -14
  69. package/lib/Video/index.js +31 -25
  70. package/lib/Wallet/Action.js +37 -25
  71. package/lib/Wallet/Download.js +236 -181
  72. package/lib/Wallet/Open.js +6 -5
  73. package/lib/WechatPrompt/index.js +40 -28
  74. package/lib/withTheme/index.js +23 -9
  75. package/lib/withTracker/error_boundary.js +10 -7
  76. package/lib/withTracker/index.js +8 -4
  77. package/package.json +4 -4
  78. package/src/ActionButton/index.js +3 -4
  79. package/src/ActivityIndicator/index.js +4 -7
  80. package/src/Alert/index.js +4 -10
  81. package/src/AnimationWaiter/index.js +4 -2
  82. package/src/Async/index.js +4 -8
  83. package/src/Badge/index.js +2 -2
  84. package/src/Blocklet/blocklet.js +16 -27
  85. package/src/Blocklet/utils.js +3 -3
  86. package/src/BlockletNFT/index.js +7 -15
  87. package/src/Button/wrap.js +2 -2
  88. package/src/Center/index.js +0 -1
  89. package/src/ClickToCopy/index.js +5 -12
  90. package/src/CodeBlock/index.js +2 -7
  91. package/src/Colors/index.js +1 -0
  92. package/src/ContactForm/index.js +16 -16
  93. package/src/CookieConsent/index.js +3 -2
  94. package/src/CountDown/index.js +8 -8
  95. package/src/Datatable/CustomToolbar.js +8 -9
  96. package/src/Datatable/DatatableContext.js +3 -3
  97. package/src/Datatable/TableSearch.js +18 -13
  98. package/src/Datatable/index.js +13 -12
  99. package/src/Datatable/utils.js +19 -23
  100. package/src/Dialog/confirm.js +0 -1
  101. package/src/Dialog/dialog.js +7 -27
  102. package/src/Dialog/index.js +1 -0
  103. package/src/DriftBot/index.js +2 -2
  104. package/src/Earth/index.js +26 -44
  105. package/src/Empty/index.js +0 -1
  106. package/src/ErrorBoundary/fallback.js +2 -3
  107. package/src/Footer/index.js +3 -7
  108. package/src/Header/header.js +4 -5
  109. package/src/Header/responsive-header.js +4 -10
  110. package/src/Icon/image.js +0 -1
  111. package/src/Icon/index.js +8 -8
  112. package/src/Img/index.js +6 -6
  113. package/src/InfoRow/index.js +22 -21
  114. package/src/Layout/dashboard/index.js +9 -4
  115. package/src/Layout/dashboard/sidebar.js +4 -10
  116. package/src/Layout/dashboard-legacy/header.js +9 -15
  117. package/src/Layout/dashboard-legacy/index.js +4 -11
  118. package/src/Layout/dashboard-legacy/sidebar.js +7 -7
  119. package/src/Layout/index.js +12 -26
  120. package/src/Locale/browser-lang.js +2 -2
  121. package/src/Locale/context.js +7 -11
  122. package/src/Locale/selector.js +8 -8
  123. package/src/Logo/index.js +4 -6
  124. package/src/Metric/index.js +9 -10
  125. package/src/NFTDisplay/aspect-ratio-container.js +0 -1
  126. package/src/NFTDisplay/broken.js +0 -1
  127. package/src/NFTDisplay/index.js +10 -8
  128. package/src/NFTDisplay/loading.js +0 -1
  129. package/src/NFTDisplay/svg-embedder/img.js +1 -2
  130. package/src/NFTDisplay/svg-embedder/inline-svg.js +0 -1
  131. package/src/NavMenu/index.js +1 -0
  132. package/src/NavMenu/nav-menu.js +14 -27
  133. package/src/NavMenu/style.js +3 -3
  134. package/src/PageScroller/index.js +19 -35
  135. package/src/PageScroller/usePrevValue.js +1 -1
  136. package/src/PricingTable/PricingPlan.js +31 -30
  137. package/src/PricingTable/index.js +4 -5
  138. package/src/QRCode/index.js +3 -2
  139. package/src/RelativeTime/index.js +1 -5
  140. package/src/Result/common.js +19 -20
  141. package/src/Result/index.js +5 -6
  142. package/src/Result/result.js +2 -3
  143. package/src/Result/translations.js +1 -2
  144. package/src/Screenshot/index.js +10 -10
  145. package/src/Spinner/index.js +0 -1
  146. package/src/SplitButton/index.js +6 -19
  147. package/src/Switch/index.js +40 -41
  148. package/src/Tabs/index.js +2 -9
  149. package/src/Tag/index.js +2 -2
  150. package/src/Terminal/Player.js +7 -8
  151. package/src/Terminal/index.js +4 -3
  152. package/src/Terminal/util.js +3 -3
  153. package/src/TextCollapse/index.js +4 -10
  154. package/src/Theme/index.js +1 -8
  155. package/src/Toast/index.js +6 -10
  156. package/src/Util/index.js +15 -27
  157. package/src/Video/index.js +2 -8
  158. package/src/Wallet/Action.js +5 -6
  159. package/src/Wallet/Download.js +6 -7
  160. package/src/Wallet/Open.js +1 -2
  161. package/src/WechatPrompt/index.js +2 -7
  162. package/src/withTheme/index.js +5 -5
  163. package/src/withTracker/error_boundary.js +3 -3
  164. package/src/withTracker/index.js +2 -2
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Player from 'react-player';
4
4
  import styled from 'styled-components';
@@ -23,13 +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
27
- title={url}
28
- style={styles}
29
- src={url}
30
- onLoad={() => setLoaded(true)}
31
- allowFullScreen="true"
32
- />
26
+ <iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen="true" />
33
27
  {!loaded && <CircularProgress className="loading-indicator" color="primary" />}
34
28
  </Placeholder>
35
29
  );
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import PropTypes from 'prop-types';
3
2
  import styled from 'styled-components';
4
3
 
@@ -75,7 +74,7 @@ const Content = styled.div`
75
74
  .wallet-action__logo {
76
75
  width: auto;
77
76
  height: auto;
78
- max-width: ${props => sizes.logo[props.size]}px;
77
+ max-width: ${(props) => sizes.logo[props.size]}px;
79
78
  margin-left: 5px;
80
79
  }
81
80
 
@@ -89,17 +88,17 @@ const Content = styled.div`
89
88
  }
90
89
 
91
90
  .wallet-action__action {
92
- font-size: ${props => sizes.font[props.size]}px;
91
+ font-size: ${(props) => sizes.font[props.size]}px;
93
92
  text-transform: capitalize;
94
93
  margin-bottom: 1px;
95
- color: ${props => props.color || colors.primary.main};
94
+ color: ${(props) => props.color || colors.primary.main};
96
95
  letter-spacing: 1px;
97
96
  }
98
97
 
99
98
  .wallet-action__title {
100
- font-size: ${props => sizes.font[props.size] * 1.5}px;
99
+ font-size: ${(props) => sizes.font[props.size] * 1.5}px;
101
100
  text-transform: capitalize;
102
- color: ${props => props.color || colors.primary.main};
101
+ color: ${(props) => props.color || colors.primary.main};
103
102
  letter-spacing: 1px;
104
103
  }
105
104
  `;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import PropTypes from 'prop-types';
3
2
  import styled from 'styled-components';
4
3
 
@@ -100,17 +99,17 @@ WalletDownload.defaultProps = {
100
99
 
101
100
  const Container = styled.div`
102
101
  display: flex;
103
- flex-direction: ${props => (props.layout === 'vertical' ? 'column' : 'row')};
102
+ flex-direction: ${(props) => (props.layout === 'vertical' ? 'column' : 'row')};
104
103
  align-items: center;
105
104
 
106
105
  .download-title {
107
- margin-right: ${props => (props.layout === 'vertical' ? '0' : '16px')};
108
- margin-bottom: ${props => (props.layout === 'vertical' ? '16px' : '0')};
106
+ margin-right: ${(props) => (props.layout === 'vertical' ? '0' : '16px')};
107
+ margin-bottom: ${(props) => (props.layout === 'vertical' ? '16px' : '0')};
109
108
  }
110
109
 
111
110
  .download-store-list {
112
111
  display: flex;
113
- flex-direction: ${props => (props.storeLayout === 'vertical' ? 'column' : 'row')};
112
+ flex-direction: ${(props) => (props.storeLayout === 'vertical' ? 'column' : 'row')};
114
113
  justify-content: space-between;
115
114
  align-items: center;
116
115
 
@@ -118,8 +117,8 @@ const Container = styled.div`
118
117
  padding: 0;
119
118
  margin: 0;
120
119
 
121
- margin-right: ${props => (props.storeLayout === 'vertical' ? '0' : '16px')};
122
- margin-bottom: ${props => (props.storeLayout === 'vertical' ? '16px' : '0')};
120
+ margin-right: ${(props) => (props.storeLayout === 'vertical' ? '0' : '16px')};
121
+ margin-bottom: ${(props) => (props.storeLayout === 'vertical' ? '16px' : '0')};
123
122
 
124
123
  &:last-of-type {
125
124
  margin-right: 0;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import PropTypes from 'prop-types';
3
2
  import styled from 'styled-components';
4
3
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
@@ -45,6 +44,6 @@ const Button = styled(Fab)`
45
44
  transform-origin: 50% 50%;
46
45
  transform: translateX(-50%);
47
46
  min-width: 120px;
48
- z-index: ${props => props.theme.zIndex.tooltip};
47
+ z-index: ${(props) => props.theme.zIndex.tooltip};
49
48
  }
50
49
  `;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import Typography from '@mui/material/Typography';
@@ -25,9 +24,7 @@ export default function WechatPrompt() {
25
24
  <Container>
26
25
  <Typography className="wechat-title">1. 轻触右上方菜单</Typography>
27
26
  <div className="wechat-tip">
28
- <Typography className="wechat-tip-text">
29
- 2. 点击“在浏览器打开”,才能调起 DID 钱包
30
- </Typography>
27
+ <Typography className="wechat-tip-text">2. 点击“在浏览器打开”,才能调起 DID 钱包</Typography>
31
28
  <img className="wechat-tip-img" src={AndroidImage} alt="Open in Android Browser" />
32
29
  </div>
33
30
  </Container>
@@ -40,9 +37,7 @@ export default function WechatPrompt() {
40
37
  <Container>
41
38
  <Typography className="wechat-title">1. 轻触右上方菜单</Typography>
42
39
  <div className="wechat-tip">
43
- <Typography className="wechat-tip-text">
44
- 2. 点击“在Safari中打开”,才能调起 DID 钱包
45
- </Typography>
40
+ <Typography className="wechat-tip-text">2. 点击“在Safari中打开”,才能调起 DID 钱包</Typography>
46
41
  <img className="wechat-tip-img" src={IosImage} alt="Open in Safari" />
47
42
  </div>
48
43
  </Container>
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { ThemeProvider, createGlobalStyle } from 'styled-components';
3
3
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
4
  import CssBaseline from '@mui/material/CssBaseline';
@@ -6,16 +6,16 @@ import CssBaseline from '@mui/material/CssBaseline';
6
6
  import { create } from '../Theme';
7
7
 
8
8
  const GlobalStyle = createGlobalStyle`
9
- font-family: ${props => props.theme.typography.fontFamily};
10
- color: ${props => props.theme.typography.color.main};
9
+ font-family: ${(props) => props.theme.typography.fontFamily};
10
+ color: ${(props) => props.theme.typography.color.main};
11
11
 
12
12
  a, a:hover, a:active {
13
13
  text-decoration: none;
14
- color: ${props => props.theme.palette.primary.dark};
14
+ color: ${(props) => props.theme.palette.primary.dark};
15
15
  }
16
16
 
17
17
  a:hover {
18
- color: ${props => props.theme.palette.primary.main};
18
+ color: ${(props) => props.theme.palette.primary.main};
19
19
  }
20
20
 
21
21
  .section--latest-post {
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable import/no-unresolved */
2
- import React from 'react';
2
+ import { Component } from 'react';
3
3
  import * as Sentry from '@sentry/browser';
4
4
 
5
5
  import Alert from '../Alert';
6
6
 
7
- export default class ErrorBoundary extends React.Component {
7
+ export default class ErrorBoundary extends Component {
8
8
  constructor(props) {
9
9
  super(props);
10
10
  this.state = { error: null };
@@ -13,7 +13,7 @@ export default class ErrorBoundary extends React.Component {
13
13
  componentDidCatch(error, info) {
14
14
  this.setState({ error });
15
15
 
16
- Sentry.withScope(scope => {
16
+ Sentry.withScope((scope) => {
17
17
  scope.setExtras(info);
18
18
  Sentry.captureException(error);
19
19
  });
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/no-deprecated */
2
2
  /* eslint-disable react/static-property-placement */
3
3
  /* eslint-disable import/no-unresolved */
4
- import React, { Component } from 'react';
4
+ import { Component } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import ReactGA from 'react-ga';
7
7
  import * as Sentry from '@sentry/browser';
@@ -23,7 +23,7 @@ export default (WrappedComponent, options = {}) => {
23
23
  });
24
24
  }
25
25
 
26
- const trackPage = page => {
26
+ const trackPage = (page) => {
27
27
  if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
28
28
  return;
29
29
  }