@arcblock/ux 2.4.2 → 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 +3 -8
  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 +4 -7
  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,9 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Box from '@mui/material/Box';
4
3
  import Container from '@mui/material/Container';
5
- import { useTheme } from '@mui/material/styles';
6
4
  import AutoHidden from './auto-hidden';
5
+ import { styled, useTheme } from '../Theme';
7
6
 
8
7
  /**
9
8
  * Header 组件
@@ -62,7 +61,7 @@ Header.defaultProps = {
62
61
  align: 'left',
63
62
  };
64
63
 
65
- const Root = styled.div`
64
+ const Root = styled('div')`
66
65
  position: relative;
67
66
  z-index: ${(props) => props.$theme.zIndex.appBar};
68
67
  font-size: 14px;
@@ -1,14 +1,13 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
  import MenuIcon from '@mui/icons-material/Menu';
5
4
  import CloseIcon from '@mui/icons-material/Close';
6
5
  import Button from '@mui/material/IconButton';
7
6
  import Container from '@mui/material/Container';
8
- import { useTheme } from '@mui/material/styles';
9
7
  import useMediaQuery from '@mui/material/useMediaQuery';
10
8
  import Drawer from '@mui/material/Drawer';
11
9
  import Header from './header';
10
+ import { styled, useTheme } from '../Theme';
12
11
 
13
12
  /**
14
13
  * ResponsiveHeader
package/src/Icon/image.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
 
4
3
  import Img from '../Img';
4
+ import { styled } from '../Theme';
5
5
 
6
6
  export default function ImageIcon({ name, size, alt, color, style, prefix, showBadge, ...rest }) {
7
7
  const src = `${prefix}/${name}-${color.replace(/^#/, '')}.png`;
@@ -39,7 +39,7 @@ ImageIcon.defaultProps = {
39
39
  showBadge: false,
40
40
  };
41
41
 
42
- const Div = styled.div`
42
+ const Div = styled('div')`
43
43
  position: relative;
44
44
  .badge-point {
45
45
  position: absolute;
package/src/Icon/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
 
5
4
  import colors from '../Colors';
5
+ import { styled } from '../Theme';
6
6
 
7
7
  const variants = {
8
8
  light: 'fal',
@@ -50,7 +50,7 @@ Icon.defaultProps = {
50
50
  style: {},
51
51
  };
52
52
 
53
- const Span = styled.span`
53
+ const Span = styled('span')`
54
54
  width: ${(props) => props.size * 2}px;
55
55
  height: ${(props) => props.size * 2}px;
56
56
  border-radius: 50%;
package/src/Img/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
- import { styled } from '@mui/material/styles';
3
2
  import PropTypes from 'prop-types';
4
3
  import { SvgIcon } from '@mui/material';
5
4
  import { useInView } from 'react-intersection-observer';
6
5
  import Alert from 'mdi-material-ui/Alert';
7
6
  import ImageIcon from 'mdi-material-ui/Image';
7
+ import { styled } from '../Theme';
8
8
 
9
9
  const PREFIX = 'Img';
10
10
 
@@ -1,9 +1,10 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import camelCase from 'lodash/camelCase';
3
3
  import upperFirst from 'lodash/upperFirst';
4
- import styled from '@emotion/styled';
5
4
  import Typography from '@mui/material/Typography';
6
5
 
6
+ import { styled } from '../Theme';
7
+
7
8
  function InfoRow({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }) {
8
9
  return (
9
10
  <Container layout={layout} width={nameWidth} {...rest}>
@@ -44,7 +45,7 @@ InfoRow.defaultProps = {
44
45
  layout: 'horizontal',
45
46
  };
46
47
 
47
- const Container = styled.div`
48
+ const Container = styled('div')`
48
49
  display: flex;
49
50
  flex-direction: ${(props) => (props.layout === 'vertical' ? 'column' : 'row')};
50
51
  justify-content: flex-start;
@@ -2,8 +2,6 @@ import { useEffect, useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { useLocation, matchPath } from 'react-router-dom';
4
4
  import Helmet from 'react-helmet';
5
- import styled from '@emotion/styled';
6
- import { useTheme } from '@mui/material/styles';
7
5
  import Container from '@mui/material/Container';
8
6
  import Hidden from '@mui/material/Hidden';
9
7
  import Box from '@mui/material/Box';
@@ -14,6 +12,7 @@ import NavMenu from '../../NavMenu';
14
12
  import Footer from '../../Footer';
15
13
  import Sidebar from './sidebar';
16
14
  import { Link } from './with-external-link';
15
+ import { styled, useTheme } from '../../Theme';
17
16
 
18
17
  // 监听 location 变化并关闭 header 中的 menu (确保 drawer - disablePortal:false, keepMounted:true)
19
18
  // 直接监听 menu 中 link 点击来触发 closeMenu 会有问题 (Suspense & lazy)
@@ -110,7 +109,7 @@ Dashboard.defaultProps = {
110
109
  dense: 'auto',
111
110
  };
112
111
 
113
- const Wrapper = styled.div`
112
+ const Wrapper = styled('div')`
114
113
  &.dashboard {
115
114
  display: flex;
116
115
  flex-direction: column;
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react/no-array-index-key */
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
-
5
3
  import Typography from '@mui/material/Typography';
6
4
  import { teal } from '@mui/material/colors';
7
5
  import clsx from 'clsx';
6
+
8
7
  import { NavLink } from './with-external-link';
8
+ import { styled } from '../../Theme';
9
9
 
10
10
  // 渲染 links, 为 group links 添加分隔线, 返回展平后的、包含分隔线元素的 links 数组
11
11
  function renderLinks(links) {
@@ -66,7 +66,7 @@ Sidebar.defaultProps = {
66
66
 
67
67
  const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))';
68
68
 
69
- const Root = styled.div`
69
+ const Root = styled('div')`
70
70
  display: flex;
71
71
  flex-direction: column;
72
72
  ul {
@@ -1,5 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Button from '@mui/material/IconButton';
4
3
  import AppBar from '@mui/material/AppBar';
5
4
  import Toolbar from '@mui/material/Toolbar';
@@ -10,6 +9,7 @@ import MenuIcon from '@mui/icons-material/Menu';
10
9
  import { Link } from 'react-router-dom';
11
10
 
12
11
  import Logo from '../../Logo';
12
+ import { styled } from '../../Theme';
13
13
 
14
14
  const StyledAppBar = styled(AppBar)`
15
15
  && {
@@ -1,7 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Helmet from 'react-helmet';
4
- import styled from '@emotion/styled';
5
4
  import Container from '@mui/material/Container';
6
5
  import Box from '@mui/material/Box';
7
6
  import Drawer from '@mui/material/Drawer';
@@ -10,8 +9,9 @@ import useWindowSize from 'react-use/lib/useWindowSize';
10
9
  import Sidebar from './sidebar';
11
10
  import Header from './header';
12
11
  import Footer from '../../Footer';
12
+ import { styled } from '../../Theme';
13
13
 
14
- const Wrapper = styled.div`
14
+ const Wrapper = styled('div')`
15
15
  &.dashboard {
16
16
  display: flex;
17
17
  flex-direction: column;
@@ -1,15 +1,13 @@
1
1
  import { memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
-
5
3
  import { Link, useLocation } from 'react-router-dom';
6
- import { useTheme } from '@mui/material/styles';
7
4
  import Button from '@mui/material/Button';
8
5
  import Typography from '@mui/material/Typography';
9
6
  import { teal } from '@mui/material/colors';
10
7
 
11
8
  import ImageIcon from '../../Icon/image';
12
9
  import Logo from '../../Logo';
10
+ import { styled, useTheme } from '../../Theme';
13
11
 
14
12
  export default function Sidebar({ images, links, prefix, addons, logo, ...rest }) {
15
13
  const theme = useTheme();
@@ -61,7 +59,7 @@ Sidebar.defaultProps = {
61
59
  logo: null,
62
60
  };
63
61
 
64
- const MenuItems = memo(styled.div`
62
+ const MenuItems = memo(styled('div')`
65
63
  flex: 1;
66
64
  display: flex;
67
65
  flex-direction: column;
@@ -1,6 +1,5 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
  import Helmet from 'react-helmet';
5
4
  import Link from '@mui/material/Link';
6
5
 
@@ -20,6 +19,7 @@ import Footer from '../Footer';
20
19
  import OpenInWallet from '../Wallet/Open';
21
20
  import Icon from '../Icon';
22
21
  import Logo from '../Logo';
22
+ import { styled } from '../Theme';
23
23
 
24
24
  export default function Layout({
25
25
  title,
@@ -192,7 +192,7 @@ Layout.defaultProps = {
192
192
  ),
193
193
  };
194
194
 
195
- const Div = styled.div`
195
+ const Div = styled('div')`
196
196
  width: 100%;
197
197
  min-height: 100vh;
198
198
  display: flex;
@@ -277,7 +277,7 @@ const Div = styled.div`
277
277
  }
278
278
  `;
279
279
 
280
- const DrawerDiv = styled.nav`
280
+ const DrawerDiv = styled('nav')`
281
281
  width: 240px;
282
282
  .drawer-paper {
283
283
  width: 240px;
@@ -1,9 +1,6 @@
1
1
  /* eslint-disable react/jsx-no-bind */
2
2
  import { useState, useContext, useRef, useMemo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from '@emotion/styled';
5
-
6
- import { useTheme } from '@mui/material/styles';
7
4
  import Button from '@mui/material/Button';
8
5
  import Typography from '@mui/material/Typography';
9
6
  import IconButton from '@mui/material/IconButton';
@@ -18,6 +15,7 @@ import GlobeIcon from '@arcblock/icons/lib/Globe';
18
15
  import { getColor, getBackground } from '../Util';
19
16
 
20
17
  import { LocaleContext, languages } from './context';
18
+ import { styled, useTheme } from '../Theme';
21
19
 
22
20
  function LocaleSelector(props) {
23
21
  const { showText, popperProps, popperType, icon: Icon, ...rest } = props;
@@ -123,7 +121,7 @@ LocaleSelector.defaultProps = {
123
121
 
124
122
  export default LocaleSelector;
125
123
 
126
- const Div = styled.div`
124
+ const Div = styled('div')`
127
125
  display: inline-block;
128
126
 
129
127
  .trigger {
package/src/Logo/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
2
+
3
+ import { styled } from '../Theme';
3
4
 
4
5
  import { ReactComponent as LightLogo } from './images/logo-light-top.svg';
5
6
  import { ReactComponent as LightText } from './images/logo-light-text.svg';
@@ -32,7 +33,7 @@ Logo.defaultProps = {
32
33
  showLogo: true,
33
34
  };
34
35
 
35
- const Container = styled.span`
36
+ const Container = styled('span')`
36
37
  display: inline-flex;
37
38
  flex-direction: ${(props) => (props.layout === 'horizontal' ? 'row' : 'column')};
38
39
  justify-content: center;
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
 
5
4
  import ImageIcon from '../Icon/image';
5
+ import { styled } from '../Theme';
6
6
 
7
7
  export default function Metric({ icon, value, name, url, animated, LinkComponent, prefix }) {
8
8
  const metric = (
@@ -40,7 +40,7 @@ Metric.defaultProps = {
40
40
  prefix: '/images',
41
41
  };
42
42
 
43
- const Container = styled.div`
43
+ const Container = styled('div')`
44
44
  border-left: 1px solid ${(props) => props.theme.typography.color.main};
45
45
  padding: 10px 0 10px 16px;
46
46
  @media (max-width: ${(props) => props.theme.breakpoints.values.sm}px) {
@@ -1,5 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
2
+
3
+ import { styled } from '../Theme';
3
4
 
4
5
  function AspectRatioContainer({ aspect, children, ...rest }) {
5
6
  return (
@@ -14,7 +15,7 @@ AspectRatioContainer.propTypes = {
14
15
  children: PropTypes.node.isRequired,
15
16
  };
16
17
 
17
- const Root = styled.span`
18
+ const Root = styled('span')`
18
19
  display: block;
19
20
  position: relative;
20
21
  width: 100%;
@@ -1,6 +1,7 @@
1
- import styled from '@emotion/styled';
2
1
  import BrokenImage from '@mui/icons-material/BrokenImage';
3
2
 
3
+ import { styled } from '../Theme';
4
+
4
5
  export default function Broken() {
5
6
  return <Root className="nft-display-broken" />;
6
7
  }
@@ -1,18 +1,19 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  import { useRef, useEffect, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from '@emotion/styled';
5
4
  import clsx from 'clsx';
6
5
  import { Buffer } from 'buffer';
7
6
  import get from 'lodash/get';
8
7
  import pako from 'pako';
9
8
  import base64 from 'base64-url';
10
9
  import isSvg from 'is-svg';
10
+
11
11
  import AspectRatioContainer from './aspect-ratio-container';
12
12
  import ImgSvgEmbedder from './svg-embedder/img';
13
13
  import InlineSvgEmbedder from './svg-embedder/inline-svg';
14
14
  import DefaultLoading from './loading';
15
15
  import DefaultBrokenImage from './broken';
16
+ import { styled } from '../Theme';
16
17
 
17
18
  /**
18
19
  * 从 assetState 中获取 nft data, 兼容新旧两种类型的数据结构, 建议将该方法的返回值传入 NFTDisplay 组件的 data prop
@@ -220,7 +221,7 @@ NFTDisplay.defaultProps = {
220
221
  onCompleted: () => {},
221
222
  };
222
223
 
223
- const Root = styled.div`
224
+ const Root = styled('div')`
224
225
  display: flex;
225
226
  justify-content: center;
226
227
  align-items: center;
@@ -1,10 +1,10 @@
1
- import styled from '@emotion/styled';
1
+ import { styled } from '../Theme';
2
2
 
3
3
  export default function Loading() {
4
4
  return <Root className="nft-display__loading">loading...</Root>;
5
5
  }
6
6
 
7
- const Root = styled.span`
7
+ const Root = styled('span')`
8
8
  display: flex;
9
9
  justify-content: center;
10
10
  align-items: center;
@@ -1,7 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import root from 'react-shadow/emotion';
4
3
 
4
+ import { styled } from '../../Theme';
5
+
5
6
  /**
6
7
  * inline svg 的方式嵌入 svg, 使用 shadow DOM 避免样式污染
7
8
  */
@@ -23,7 +24,7 @@ const Root = styled(root.span)`
23
24
  height: 100%;
24
25
  `;
25
26
 
26
- const Inner = styled.div`
27
+ const Inner = styled('div')`
27
28
  &,
28
29
  & > svg {
29
30
  height: 100%;
@@ -1,6 +1,6 @@
1
- import styled from '@emotion/styled';
1
+ import { styled } from '../Theme';
2
2
 
3
- const NavMenuBase = styled.nav`
3
+ const NavMenuBase = styled('nav')`
4
4
  background-color: ${(props) => props.$bgColor};
5
5
  font-size: 16px;
6
6
  ul {
@@ -1,11 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
-
4
2
  import Card from '@mui/material/Card';
5
3
  import Button from '@mui/material/Button';
6
4
  import CardContent from '@mui/material/CardContent';
7
5
  import Typography from '@mui/material/Typography';
8
6
 
7
+ import { styled } from '../Theme';
8
+
9
9
  function PricingPlan({ plan }) {
10
10
  return (
11
11
  <PlanCard $shadow>
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Grid from '@mui/material/Grid';
4
3
 
5
4
  import PricingPlan from './PricingPlan';
5
+ import { styled } from '../Theme';
6
6
 
7
7
  function PricingTable({ plans }) {
8
8
  if (plans && plans.length > 0) {
@@ -28,7 +28,7 @@ PricingTable.propTypes = {
28
28
  plans: PropTypes.array.isRequired,
29
29
  };
30
30
 
31
- const Div = styled.div`
31
+ const Div = styled('div')`
32
32
  padding: 100px 0;
33
33
  text-align: center;
34
34
  background-color: ${(props) => (props.variant === 'even' ? '#fbfbfb' : '#ffffff')};
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable no-param-reassign */
3
- import { useTheme } from '@mui/material/styles';
4
3
  import InfoIcon from '@mui/icons-material/Info';
5
4
  import CancelRoundedIcon from '@mui/icons-material/CancelRounded';
6
5
  import Result from './result';
7
6
  import translations from './translations';
8
7
  import { useLocaleContext } from '../Locale/context';
8
+ import { useTheme } from '../Theme';
9
9
 
10
10
  // 优先使用显式指定的 locale, 再尝试使用 context 中的 locale, 最后使用默认 'en'
11
11
  const useLocale = (locale) => {
@@ -1,7 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Box from '@mui/material/Box';
4
3
 
4
+ import { styled } from '../Theme';
5
+
5
6
  function Result({ icon, title, description, extra, ...rest }) {
6
7
  return (
7
8
  <Root {...rest}>
@@ -42,7 +43,7 @@ Result.defaultProps = {
42
43
  extra: undefined,
43
44
  };
44
45
 
45
- const Root = styled.div`
46
+ const Root = styled('div')`
46
47
  box-sizing: border-box;
47
48
  display: flex;
48
49
  flex-direction: column;
@@ -1,8 +1,8 @@
1
1
  import { createElement, Children, cloneElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
 
5
4
  import { mergeProps } from '../Util';
5
+ import { styled } from '../Theme';
6
6
 
7
7
  import './devices.css';
8
8
 
@@ -144,7 +144,7 @@ function Screenshot(props) {
144
144
  );
145
145
  }
146
146
 
147
- const Div = styled.div`
147
+ const Div = styled('div')`
148
148
  @media (max-width: ${(props) => types[props.type].width}px) {
149
149
  transform-origin: 0 0;
150
150
  transform: scale(${(props) => types[props.type].scale});
@@ -1,6 +1,5 @@
1
1
  import { useState, useRef, isValidElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
  import ExpandMore from '@mui/icons-material/ExpandMore';
5
4
  import Popper from '@mui/material/Popper';
6
5
  import Paper from '@mui/material/Paper';
@@ -10,6 +9,8 @@ import MenuItem from '@mui/material/MenuItem';
10
9
  import ButtonGroup from '@mui/material/ButtonGroup';
11
10
  import Button from '@mui/material/Button';
12
11
 
12
+ import { styled } from '../Theme';
13
+
13
14
  /**
14
15
  * SplitButton allows the user to execute a default action which is bound to a Button or to choose a predefined action from a drop-down list.
15
16
  */
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
- import { styled } from '@mui/material/styles';
3
2
  import FormControlLabel from '@mui/material/FormControlLabel';
4
3
  import MuiSwitch from '@mui/material/Switch';
4
+ import { styled } from '../Theme';
5
5
 
6
6
  // 参考: https://mui.com/material-ui/react-switch/#customization
7
7
  const IOSSwitch = styled((props) => <MuiSwitch focusVisibleClassName=".Mui-focusVisible" disableRipple {...props} />)(
package/src/Tabs/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { styled } from '@mui/material/styles';
2
1
  import PropTypes from 'prop-types';
3
2
  import MuiTabs from '@mui/material/Tabs';
4
3
  import MuiTab from '@mui/material/Tab';
4
+ import { styled } from '../Theme';
5
5
 
6
6
  const PREFIX = 'index';
7
7
 
package/src/Tag/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
-
5
3
  import Typography from '@mui/material/Typography';
6
- import { useTheme } from '@mui/material/styles';
7
4
 
8
5
  import { mergeProps } from '../Util';
9
6
  import colors from '../Colors';
7
+ import { useTheme, styled } from '../Theme';
10
8
 
11
9
  const types = {
12
10
  error: {
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
-
3
2
  import Typography from '@mui/material/Typography';
4
- import styled from '@emotion/styled';
3
+
4
+ import { styled } from '../Theme';
5
5
 
6
6
  export default function TextCollapse({
7
7
  children,
@@ -1,2 +1,3 @@
1
1
  export * from './theme';
2
+ export { styled, useTheme } from '@mui/material/styles';
2
3
  export { default as ThemeProvider } from './theme-provider';
@@ -1,11 +1,10 @@
1
1
  import PropTypes from 'prop-types';
2
- import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
3
2
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
3
  import StyledEngineProvider from '@mui/material/StyledEngineProvider';
5
4
  import CssBaseline from '@mui/material/CssBaseline';
6
- import { create } from './theme';
5
+ import { createTheme } from './theme';
7
6
 
8
- const defaultTheme = create();
7
+ const defaultTheme = createTheme();
9
8
 
10
9
  /**
11
10
  * 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
@@ -15,10 +14,8 @@ export default function ThemeProvider({ children, theme, injectFirst }) {
15
14
  // injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
16
15
  <StyledEngineProvider injectFirst={injectFirst}>
17
16
  <MuiThemeProvider theme={theme}>
18
- <EmotionThemeProvider theme={theme}>
19
- <CssBaseline />
20
- {children}
21
- </EmotionThemeProvider>
17
+ <CssBaseline />
18
+ {children}
22
19
  </MuiThemeProvider>
23
20
  </StyledEngineProvider>
24
21
  );
@@ -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;