@arcblock/ux 2.4.2 → 2.4.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.
Files changed (129) 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/BaseScreenshot/index.js +84 -0
  49. package/lib/Screenshot/BaseScreenshot/shells/Phone.js +57 -0
  50. package/lib/Screenshot/index.js +123 -10
  51. package/lib/SplitButton/index.js +4 -4
  52. package/lib/Switch/index.js +3 -3
  53. package/lib/Tabs/index.js +3 -3
  54. package/lib/Tag/index.js +4 -6
  55. package/lib/TextCollapse/index.js +2 -2
  56. package/lib/Theme/index.js +16 -0
  57. package/lib/Theme/theme-provider.js +3 -8
  58. package/lib/Theme/theme.js +4 -2
  59. package/lib/Video/index.js +3 -4
  60. package/lib/Wallet/Action.js +3 -4
  61. package/lib/Wallet/Download.js +3 -4
  62. package/lib/Wallet/Open.js +3 -3
  63. package/lib/WechatPrompt/index.js +3 -3
  64. package/lib/withTheme/index.js +18 -40
  65. package/package.json +4 -4
  66. package/src/ActivityIndicator/index.js +3 -3
  67. package/src/Alert/index.js +2 -2
  68. package/src/AnimationWaiter/index.js +3 -2
  69. package/src/Badge/index.js +1 -2
  70. package/src/Blocklet/blocklet.js +2 -3
  71. package/src/Blocklet/utils.js +2 -2
  72. package/src/BlockletNFT/index.js +2 -3
  73. package/src/Center/index.js +3 -2
  74. package/src/ClickToCopy/index.js +2 -1
  75. package/src/CodeBlock/index.js +2 -2
  76. package/src/ContactForm/index.js +2 -3
  77. package/src/CookieConsent/index.js +3 -2
  78. package/src/CountDown/index.js +2 -2
  79. package/src/Datatable/CustomToolbar.js +3 -4
  80. package/src/Datatable/TableSearch.js +2 -2
  81. package/src/Datatable/index.js +4 -4
  82. package/src/Dialog/dialog.js +3 -3
  83. package/src/Earth/index.js +3 -3
  84. package/src/Empty/index.js +3 -2
  85. package/src/ErrorBoundary/fallback.js +2 -3
  86. package/src/Footer/index.js +2 -2
  87. package/src/Header/auto-hidden.js +2 -1
  88. package/src/Header/header.js +2 -3
  89. package/src/Header/responsive-header.js +1 -2
  90. package/src/Icon/image.js +2 -2
  91. package/src/Icon/index.js +2 -2
  92. package/src/Img/index.js +1 -1
  93. package/src/InfoRow/index.js +3 -2
  94. package/src/Layout/dashboard/index.js +2 -3
  95. package/src/Layout/dashboard/sidebar.js +3 -3
  96. package/src/Layout/dashboard-legacy/header.js +1 -1
  97. package/src/Layout/dashboard-legacy/index.js +2 -2
  98. package/src/Layout/dashboard-legacy/sidebar.js +2 -4
  99. package/src/Layout/index.js +3 -3
  100. package/src/Locale/selector.js +2 -4
  101. package/src/Logo/index.js +3 -2
  102. package/src/Metric/index.js +2 -2
  103. package/src/NFTDisplay/aspect-ratio-container.js +3 -2
  104. package/src/NFTDisplay/broken.js +2 -1
  105. package/src/NFTDisplay/index.js +3 -2
  106. package/src/NFTDisplay/loading.js +2 -2
  107. package/src/NFTDisplay/svg-embedder/inline-svg.js +3 -2
  108. package/src/NavMenu/style.js +4 -4
  109. package/src/PricingTable/PricingPlan.js +2 -2
  110. package/src/PricingTable/index.js +2 -2
  111. package/src/Result/common.js +1 -1
  112. package/src/Result/result.js +3 -2
  113. package/src/Screenshot/BaseScreenshot/index.jsx +77 -0
  114. package/src/Screenshot/BaseScreenshot/shells/Phone.jsx +33 -0
  115. package/src/Screenshot/index.js +99 -7
  116. package/src/SplitButton/index.js +2 -1
  117. package/src/Switch/index.js +1 -1
  118. package/src/Tabs/index.js +1 -1
  119. package/src/Tag/index.js +1 -3
  120. package/src/TextCollapse/index.js +2 -2
  121. package/src/Theme/index.js +1 -0
  122. package/src/Theme/theme-provider.js +4 -7
  123. package/src/Theme/theme.js +5 -3
  124. package/src/Video/index.js +2 -3
  125. package/src/Wallet/Action.js +2 -3
  126. package/src/Wallet/Download.js +2 -3
  127. package/src/Wallet/Open.js +2 -1
  128. package/src/WechatPrompt/index.js +2 -3
  129. package/src/withTheme/index.js +41 -54
@@ -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;