@arcblock/ux 2.4.0 → 2.4.3

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 (125) hide show
  1. package/lib/ActivityIndicator/index.js +4 -6
  2. package/lib/Alert/index.js +3 -4
  3. package/lib/AnimationWaiter/index.js +3 -4
  4. package/lib/Badge/index.js +3 -3
  5. package/lib/Blocklet/blocklet.js +4 -6
  6. package/lib/Blocklet/utils.js +2 -5
  7. package/lib/BlockletNFT/index.js +4 -6
  8. package/lib/Center/index.js +3 -4
  9. package/lib/ClickToCopy/index.js +3 -3
  10. package/lib/CodeBlock/index.js +3 -4
  11. package/lib/ContactForm/index.js +3 -3
  12. package/lib/CookieConsent/index.js +3 -4
  13. package/lib/CountDown/index.js +3 -4
  14. package/lib/Datatable/CustomToolbar.js +5 -9
  15. package/lib/Datatable/TableSearch.js +3 -4
  16. package/lib/Datatable/index.js +5 -7
  17. package/lib/Dialog/dialog.js +5 -9
  18. package/lib/Earth/index.js +4 -6
  19. package/lib/Empty/index.js +3 -3
  20. package/lib/ErrorBoundary/fallback.js +4 -7
  21. package/lib/Footer/index.js +3 -4
  22. package/lib/Header/auto-hidden.js +3 -3
  23. package/lib/Header/header.js +4 -8
  24. package/lib/Header/responsive-header.js +5 -7
  25. package/lib/Icon/image.js +3 -4
  26. package/lib/Icon/index.js +3 -4
  27. package/lib/Img/index.js +3 -3
  28. package/lib/InfoRow/index.js +3 -5
  29. package/lib/Layout/dashboard/index.js +5 -9
  30. package/lib/Layout/dashboard/sidebar.js +3 -5
  31. package/lib/Layout/dashboard-legacy/header.js +3 -3
  32. package/lib/Layout/dashboard-legacy/index.js +3 -3
  33. package/lib/Layout/dashboard-legacy/sidebar.js +5 -7
  34. package/lib/Layout/index.js +4 -6
  35. package/lib/Locale/selector.js +4 -7
  36. package/lib/Logo/index.js +2 -3
  37. package/lib/Metric/index.js +3 -4
  38. package/lib/NFTDisplay/aspect-ratio-container.js +2 -4
  39. package/lib/NFTDisplay/broken.js +3 -3
  40. package/lib/NFTDisplay/index.js +3 -4
  41. package/lib/NFTDisplay/loading.js +2 -4
  42. package/lib/NFTDisplay/svg-embedder/inline-svg.js +4 -6
  43. package/lib/NavMenu/style.js +4 -7
  44. package/lib/PricingTable/PricingPlan.js +3 -3
  45. package/lib/PricingTable/index.js +3 -4
  46. package/lib/Result/common.js +4 -4
  47. package/lib/Result/result.js +3 -5
  48. package/lib/Screenshot/index.js +3 -4
  49. package/lib/SplitButton/index.js +4 -4
  50. package/lib/Switch/index.js +3 -3
  51. package/lib/Tabs/index.js +3 -3
  52. package/lib/Tag/index.js +4 -6
  53. package/lib/TextCollapse/index.js +2 -2
  54. package/lib/Theme/index.js +16 -0
  55. package/lib/Theme/theme-provider.js +10 -12
  56. package/lib/Theme/theme.js +4 -2
  57. package/lib/Video/index.js +3 -4
  58. package/lib/Wallet/Action.js +3 -4
  59. package/lib/Wallet/Download.js +3 -4
  60. package/lib/Wallet/Open.js +3 -3
  61. package/lib/WechatPrompt/index.js +3 -3
  62. package/lib/withTheme/index.js +18 -40
  63. package/package.json +4 -4
  64. package/src/ActivityIndicator/index.js +3 -3
  65. package/src/Alert/index.js +2 -2
  66. package/src/AnimationWaiter/index.js +3 -2
  67. package/src/Badge/index.js +1 -2
  68. package/src/Blocklet/blocklet.js +2 -3
  69. package/src/Blocklet/utils.js +2 -2
  70. package/src/BlockletNFT/index.js +2 -3
  71. package/src/Center/index.js +3 -2
  72. package/src/ClickToCopy/index.js +2 -1
  73. package/src/CodeBlock/index.js +2 -2
  74. package/src/ContactForm/index.js +2 -3
  75. package/src/CookieConsent/index.js +3 -2
  76. package/src/CountDown/index.js +2 -2
  77. package/src/Datatable/CustomToolbar.js +3 -4
  78. package/src/Datatable/TableSearch.js +2 -2
  79. package/src/Datatable/index.js +4 -4
  80. package/src/Dialog/dialog.js +3 -3
  81. package/src/Earth/index.js +3 -3
  82. package/src/Empty/index.js +3 -2
  83. package/src/ErrorBoundary/fallback.js +2 -3
  84. package/src/Footer/index.js +2 -2
  85. package/src/Header/auto-hidden.js +2 -1
  86. package/src/Header/header.js +2 -3
  87. package/src/Header/responsive-header.js +1 -2
  88. package/src/Icon/image.js +2 -2
  89. package/src/Icon/index.js +2 -2
  90. package/src/Img/index.js +1 -1
  91. package/src/InfoRow/index.js +3 -2
  92. package/src/Layout/dashboard/index.js +2 -3
  93. package/src/Layout/dashboard/sidebar.js +3 -3
  94. package/src/Layout/dashboard-legacy/header.js +1 -1
  95. package/src/Layout/dashboard-legacy/index.js +2 -2
  96. package/src/Layout/dashboard-legacy/sidebar.js +2 -4
  97. package/src/Layout/index.js +3 -3
  98. package/src/Locale/selector.js +2 -4
  99. package/src/Logo/index.js +3 -2
  100. package/src/Metric/index.js +2 -2
  101. package/src/NFTDisplay/aspect-ratio-container.js +3 -2
  102. package/src/NFTDisplay/broken.js +2 -1
  103. package/src/NFTDisplay/index.js +3 -2
  104. package/src/NFTDisplay/loading.js +2 -2
  105. package/src/NFTDisplay/svg-embedder/inline-svg.js +3 -2
  106. package/src/NavMenu/style.js +2 -2
  107. package/src/PricingTable/PricingPlan.js +2 -2
  108. package/src/PricingTable/index.js +2 -2
  109. package/src/Result/common.js +1 -1
  110. package/src/Result/result.js +3 -2
  111. package/src/Screenshot/index.js +2 -2
  112. package/src/SplitButton/index.js +2 -1
  113. package/src/Switch/index.js +1 -1
  114. package/src/Tabs/index.js +1 -1
  115. package/src/Tag/index.js +1 -3
  116. package/src/TextCollapse/index.js +2 -2
  117. package/src/Theme/index.js +1 -0
  118. package/src/Theme/theme-provider.js +8 -9
  119. package/src/Theme/theme.js +5 -3
  120. package/src/Video/index.js +2 -3
  121. package/src/Wallet/Action.js +2 -3
  122. package/src/Wallet/Download.js +2 -3
  123. package/src/Wallet/Open.js +2 -1
  124. package/src/WechatPrompt/index.js +2 -3
  125. package/src/withTheme/index.js +41 -54
@@ -1,10 +1,10 @@
1
1
  // https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
2
- import { createTheme, responsiveFontSizes } from '@mui/material/styles';
2
+ import { createTheme as _createTheme, responsiveFontSizes } from '@mui/material/styles';
3
3
  import '@fontsource/lato/400.css';
4
4
  import '@fontsource/lato/700.css';
5
5
  import colors from '../Colors';
6
6
 
7
- const muiDarkTheme = createTheme({ palette: { mode: 'dark' } });
7
+ const muiDarkTheme = _createTheme({ palette: { mode: 'dark' } });
8
8
 
9
9
  // https://material-ui.com/customization/default-theme/
10
10
  // eslint-disable-next-line import/prefer-default-export
@@ -37,7 +37,7 @@ export const create = ({ mode = 'light', pageWidth = 'md', palette, typography,
37
37
  palette || {}
38
38
  );
39
39
 
40
- const theme = createTheme({
40
+ const theme = _createTheme({
41
41
  themeName: 'ArcBlock',
42
42
  palette: _palette,
43
43
  typography: Object.assign(
@@ -162,3 +162,5 @@ export const create = ({ mode = 'light', pageWidth = 'md', palette, typography,
162
162
 
163
163
  return enhanced;
164
164
  };
165
+
166
+ export const createTheme = create;
@@ -1,11 +1,10 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Player from 'react-player';
4
- import styled from '@emotion/styled';
5
-
6
4
  import CircularProgress from '@mui/material/CircularProgress';
7
5
 
8
6
  import { mergeProps } from '../Util';
7
+ import { styled } from '../Theme';
9
8
 
10
9
  const { string, number, array, oneOfType, object } = PropTypes;
11
10
 
@@ -50,7 +49,7 @@ Video.defaultProps = {
50
49
  style: {},
51
50
  };
52
51
 
53
- const Placeholder = styled.div`
52
+ const Placeholder = styled('div')`
54
53
  background-color: #222222;
55
54
  display: flex;
56
55
  justify-content: center;
@@ -1,12 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
-
4
2
  import Typography from '@mui/material/Typography';
5
3
 
6
4
  import logo from './images/abtwallet.png';
7
5
  import { mergeProps } from '../Util';
8
6
  import colors from '../Colors';
9
7
  import Button from '../Button';
8
+ import { styled } from '../Theme';
10
9
 
11
10
  export default function WalletAction(props) {
12
11
  const newProps = mergeProps(props, WalletAction, ['style']);
@@ -62,7 +61,7 @@ const sizes = {
62
61
  },
63
62
  };
64
63
 
65
- const Content = styled.div`
64
+ const Content = styled('div')`
66
65
  display: flex;
67
66
  justify-content: center;
68
67
  align-items: center;
@@ -1,6 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
-
4
2
  import Typography from '@mui/material/Typography';
5
3
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
6
4
 
@@ -10,6 +8,7 @@ import { ReactComponent as AndroidDownloadIcon } from './images/android_download
10
8
 
11
9
  import Button from '../Button';
12
10
  import { mergeProps } from '../Util';
11
+ import { styled } from '../Theme';
13
12
 
14
13
  export default function WalletDownload(props) {
15
14
  const browser = useBrowser();
@@ -97,7 +96,7 @@ WalletDownload.defaultProps = {
97
96
  locale: 'zh',
98
97
  };
99
98
 
100
- const Container = styled.div`
99
+ const Container = styled('div')`
101
100
  display: flex;
102
101
  flex-direction: ${(props) => (props.layout === 'vertical' ? 'column' : 'row')};
103
102
  align-items: center;
@@ -1,8 +1,9 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
4
3
  import Fab from '@mui/material/Fab';
5
4
 
5
+ import { styled } from '../Theme';
6
+
6
7
  export default function OpenInWallet({ locale, link }) {
7
8
  const buttonText = locale === 'zh' ? '在 DID 钱包打开' : 'Open in DID Wallet';
8
9
  const browser = useBrowser();
@@ -1,11 +1,10 @@
1
- import styled from '@emotion/styled';
2
-
3
1
  import Typography from '@mui/material/Typography';
4
2
  import Dialog from '@mui/material/Dialog';
5
3
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
6
4
 
7
5
  import IosImage from './images/ios.png';
8
6
  import AndroidImage from './images/android.png';
7
+ import { styled } from '../Theme';
9
8
 
10
9
  export default function WechatPrompt() {
11
10
  const browser = useBrowser();
@@ -45,7 +44,7 @@ export default function WechatPrompt() {
45
44
  );
46
45
  }
47
46
 
48
- const Container = styled.div`
47
+ const Container = styled('div')`
49
48
  .wechat-title {
50
49
  height: 80px;
51
50
  line-height: 80px;
@@ -1,74 +1,61 @@
1
- import * as React from 'react';
2
- import { Global, ThemeProvider, css } from '@emotion/react';
3
- import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
1
+ import { useEffect } from 'react';
2
+ import { Global, css } from '@emotion/react';
4
3
  import CssBaseline from '@mui/material/CssBaseline';
5
4
 
6
- import { create } from '../Theme';
5
+ import { createTheme, ThemeProvider } from '../Theme';
7
6
 
8
- const globalStyles = css`
9
- font-family: ${(props) => props.theme.typography.fontFamily};
10
- color: ${(props) => props.theme.typography.color.main};
7
+ function withTheme(Component, { mode = 'light', pageWidth = 'md', palette, typography } = {}) {
8
+ const theme = createTheme({ mode, pageWidth, palette, typography });
11
9
 
12
- a,
13
- a:hover,
14
- a:active {
15
- text-decoration: none;
16
- color: ${(props) => props.theme.palette.primary.dark};
17
- }
10
+ const globalStyles = css`
11
+ font-family: ${theme.typography.fontFamily};
12
+ color: ${theme.typography.color.main};
18
13
 
19
- a:hover {
20
- color: ${(props) => props.theme.palette.primary.main};
21
- }
14
+ a,
15
+ a:hover,
16
+ a:active {
17
+ text-decoration: none;
18
+ color: ${theme.palette.primary.dark};
19
+ }
22
20
 
23
- .section--latest-post {
24
- p:last-of-type {
25
- margin: 0;
21
+ a:hover {
22
+ color: ${theme.palette.primary.main};
26
23
  }
27
- }
28
24
 
29
- .has-scrolled {
30
- .section--footnotes {
31
- position: static !important;
32
- transition-property: background-color;
33
- transition-duration: 600ms;
34
- transition-timing-function: ease;
35
- .footnote__title {
36
- color: #fff;
25
+ .section--latest-post {
26
+ p:last-of-type {
27
+ margin: 0;
37
28
  }
38
29
  }
39
- }
40
- `;
41
30
 
42
- function withTheme(Component, { mode = 'light', pageWidth = 'md', palette, typography } = {}) {
43
- class WithTheme extends React.Component {
44
- constructor(props) {
45
- super(props);
46
-
47
- this.theme = create({ mode, pageWidth, palette, typography });
31
+ .has-scrolled {
32
+ .section--footnotes {
33
+ position: static !important;
34
+ transition-property: background-color;
35
+ transition-duration: 600ms;
36
+ transition-timing-function: ease;
37
+ .footnote__title {
38
+ color: #fff;
39
+ }
40
+ }
48
41
  }
42
+ `;
49
43
 
50
- componentDidMount() {
51
- // Remove the server-side injected CSS.
44
+ return function WithTheme(props) {
45
+ useEffect(() => {
52
46
  const jssStyles = document.querySelector('#jss-server-side');
53
47
  if (jssStyles && jssStyles.parentNode) {
54
48
  jssStyles.parentNode.removeChild(jssStyles);
55
49
  }
56
- }
57
-
58
- render() {
59
- return (
60
- <MuiThemeProvider theme={this.theme}>
61
- <CssBaseline />
62
- <Global styles={globalStyles} />
63
- <ThemeProvider theme={this.theme}>
64
- <Component {...this.props} />
65
- </ThemeProvider>
66
- </MuiThemeProvider>
67
- );
68
- }
69
- }
70
-
71
- return WithTheme;
50
+ }, []);
51
+ return (
52
+ <ThemeProvider theme={theme}>
53
+ <CssBaseline />
54
+ <Global styles={globalStyles} />
55
+ <Component {...props} />
56
+ </ThemeProvider>
57
+ );
58
+ };
72
59
  }
73
60
 
74
61
  export default withTheme;