@arcblock/ux 2.2.4 → 2.4.1

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 (117) hide show
  1. package/lib/ActivityIndicator/index.js +7 -9
  2. package/lib/Alert/index.js +6 -5
  3. package/lib/AnimationWaiter/index.js +6 -5
  4. package/lib/Badge/index.js +6 -5
  5. package/lib/Blocklet/blocklet.js +6 -5
  6. package/lib/Blocklet/utils.js +6 -5
  7. package/lib/BlockletNFT/index.js +6 -5
  8. package/lib/Center/index.js +6 -5
  9. package/lib/ClickToCopy/index.js +6 -5
  10. package/lib/CodeBlock/index.js +6 -5
  11. package/lib/ContactForm/index.js +6 -5
  12. package/lib/CookieConsent/index.js +6 -5
  13. package/lib/CountDown/index.js +6 -5
  14. package/lib/Datatable/CustomToolbar.js +7 -9
  15. package/lib/Datatable/DatatableContext.js +2 -2
  16. package/lib/Datatable/TableSearch.js +6 -5
  17. package/lib/Datatable/index.js +12 -15
  18. package/lib/Dialog/dialog.js +8 -10
  19. package/lib/Earth/index.js +7 -9
  20. package/lib/Empty/index.js +6 -5
  21. package/lib/ErrorBoundary/fallback.js +6 -5
  22. package/lib/Footer/index.js +6 -6
  23. package/lib/Header/auto-hidden.js +6 -5
  24. package/lib/Header/header.js +6 -5
  25. package/lib/Header/responsive-header.js +7 -9
  26. package/lib/Icon/image.js +6 -5
  27. package/lib/Icon/index.js +6 -5
  28. package/lib/InfoRow/index.js +6 -5
  29. package/lib/Layout/dashboard/index.js +12 -18
  30. package/lib/Layout/dashboard/sidebar.js +15 -10
  31. package/lib/Layout/dashboard-legacy/header.js +6 -5
  32. package/lib/Layout/dashboard-legacy/index.js +6 -5
  33. package/lib/Layout/dashboard-legacy/sidebar.js +10 -17
  34. package/lib/Layout/index.js +7 -9
  35. package/lib/Locale/selector.js +6 -5
  36. package/lib/Logo/index.js +6 -5
  37. package/lib/Metric/index.js +6 -6
  38. package/lib/NFTDisplay/aspect-ratio-container.js +6 -5
  39. package/lib/NFTDisplay/broken.js +6 -5
  40. package/lib/NFTDisplay/index.js +6 -5
  41. package/lib/NFTDisplay/loading.js +6 -5
  42. package/lib/NFTDisplay/svg-embedder/inline-svg.js +9 -11
  43. package/lib/NavMenu/style.js +8 -13
  44. package/lib/PricingTable/PricingPlan.js +6 -5
  45. package/lib/PricingTable/index.js +6 -5
  46. package/lib/Result/result.js +6 -5
  47. package/lib/Screenshot/index.js +6 -5
  48. package/lib/SplitButton/index.js +7 -9
  49. package/lib/Tag/index.js +6 -5
  50. package/lib/TextCollapse/index.js +6 -5
  51. package/lib/Theme/theme-provider.js +9 -7
  52. package/lib/Video/index.js +6 -5
  53. package/lib/Wallet/Action.js +6 -5
  54. package/lib/Wallet/Download.js +6 -5
  55. package/lib/Wallet/Open.js +6 -5
  56. package/lib/WechatPrompt/index.js +6 -5
  57. package/lib/withTheme/index.js +9 -5
  58. package/lib/withTracker/index.js +19 -34
  59. package/package.json +6 -8
  60. package/src/ActivityIndicator/index.js +1 -1
  61. package/src/Alert/index.js +1 -1
  62. package/src/AnimationWaiter/index.js +1 -1
  63. package/src/Badge/index.js +1 -1
  64. package/src/Blocklet/blocklet.js +1 -1
  65. package/src/Blocklet/utils.js +1 -1
  66. package/src/BlockletNFT/index.js +1 -1
  67. package/src/Center/index.js +1 -1
  68. package/src/ClickToCopy/index.js +1 -1
  69. package/src/CodeBlock/index.js +1 -1
  70. package/src/ContactForm/index.js +1 -1
  71. package/src/CookieConsent/index.js +1 -1
  72. package/src/CountDown/index.js +1 -1
  73. package/src/Datatable/CustomToolbar.js +1 -1
  74. package/src/Datatable/DatatableContext.js +2 -2
  75. package/src/Datatable/TableSearch.js +1 -1
  76. package/src/Datatable/index.js +5 -4
  77. package/src/Dialog/dialog.js +1 -1
  78. package/src/Earth/index.js +1 -1
  79. package/src/Empty/index.js +1 -1
  80. package/src/ErrorBoundary/fallback.js +1 -1
  81. package/src/Footer/index.js +1 -1
  82. package/src/Header/auto-hidden.js +1 -1
  83. package/src/Header/header.js +1 -1
  84. package/src/Header/responsive-header.js +1 -1
  85. package/src/Icon/image.js +1 -1
  86. package/src/Icon/index.js +1 -1
  87. package/src/InfoRow/index.js +1 -1
  88. package/src/Layout/dashboard/index.js +4 -6
  89. package/src/Layout/dashboard/sidebar.js +4 -3
  90. package/src/Layout/dashboard-legacy/header.js +1 -1
  91. package/src/Layout/dashboard-legacy/index.js +1 -1
  92. package/src/Layout/dashboard-legacy/sidebar.js +4 -6
  93. package/src/Layout/index.js +1 -1
  94. package/src/Locale/selector.js +1 -1
  95. package/src/Logo/index.js +1 -1
  96. package/src/Metric/index.js +1 -1
  97. package/src/NFTDisplay/aspect-ratio-container.js +1 -1
  98. package/src/NFTDisplay/broken.js +1 -1
  99. package/src/NFTDisplay/index.js +1 -1
  100. package/src/NFTDisplay/loading.js +1 -1
  101. package/src/NFTDisplay/svg-embedder/inline-svg.js +2 -2
  102. package/src/NavMenu/style.js +1 -1
  103. package/src/PricingTable/PricingPlan.js +1 -1
  104. package/src/PricingTable/index.js +1 -1
  105. package/src/Result/result.js +1 -1
  106. package/src/Screenshot/index.js +1 -1
  107. package/src/SplitButton/index.js +1 -1
  108. package/src/Tag/index.js +1 -1
  109. package/src/TextCollapse/index.js +1 -1
  110. package/src/Theme/theme-provider.js +7 -6
  111. package/src/Video/index.js +1 -1
  112. package/src/Wallet/Action.js +1 -1
  113. package/src/Wallet/Download.js +1 -1
  114. package/src/Wallet/Open.js +1 -1
  115. package/src/WechatPrompt/index.js +1 -1
  116. package/src/withTheme/index.js +6 -4
  117. package/src/withTracker/index.js +20 -33
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import { green, blue } from '@mui/material/colors';
5
5
 
6
6
  import Logo from '../Logo';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Typography from '@mui/material/Typography';
4
4
  import { blueGrey } from '@mui/material/colors';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import PropTypes from 'prop-types';
4
4
  import Lottie from 'react-lottie-player';
5
5
  import lottieJson from './default-animation.json';
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
6
 
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
  import PropTypes from 'prop-types';
3
3
  import Typography from '@mui/material/Typography';
4
4
  import CircularProgress from '@mui/material/CircularProgress';
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  const ActionButton = styled.div`
4
4
  background-color: transparent !important;
@@ -1,5 +1,5 @@
1
1
  import { useRef } from 'react';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import PropTypes from 'prop-types';
4
4
  import Portal from '@mui/material/Portal';
5
5
  import Typography from '@mui/material/Typography';
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  /**
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import useWindowSize from 'react-use/lib/useWindowSize';
3
3
  import Tooltip from '@mui/material/Tooltip';
4
4
  import Typography from '@mui/material/Typography';
5
- import styled from 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import useCopy from './hook';
7
7
  import Toast, { ToastProvider } from '../Toast';
8
8
  import { mergeProps } from '../Util';
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import Copy from 'copy-to-clipboard';
6
6
  import Button from '@mui/material/IconButton';
7
7
  import useMountedState from 'react-use/lib/useMountedState';
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable react/static-property-placement */
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import styled from 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import axios from 'axios';
7
7
 
8
8
  import Typography from '@mui/material/Typography';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Button from '@mui/material/Button';
4
4
  import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import { getColor, mergeProps } from '../Util';
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { useState, useRef, useEffect, isValidElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { TableFilter, TableViewCol } from 'mui-datatables';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import ReactToPrint, { PrintContextConsumer } from 'react-to-print';
6
6
  import IconButton from '@mui/material/IconButton';
7
7
  import Tooltip from '@mui/material/Tooltip';
@@ -5,7 +5,7 @@ const DatatableContext = createContext({});
5
5
  const { Provider } = DatatableContext;
6
6
 
7
7
  // eslint-disable-next-line react/prop-types
8
- function DatatableProvide({ children }) {
8
+ function DatatableProvider({ children }) {
9
9
  const [customButtons, setCustomButtons] = useState([]);
10
10
  const [loading, setLoading] = useState(false);
11
11
  const [disabled, setDisabled] = useState(false);
@@ -29,4 +29,4 @@ function useDatatableContext() {
29
29
  return useContext(DatatableContext);
30
30
  }
31
31
 
32
- export { DatatableProvide, useDatatableContext };
32
+ export { DatatableProvider, useDatatableContext };
@@ -5,7 +5,7 @@ import Tooltip from '@mui/material/Tooltip';
5
5
  import SearchIcon from '@mui/icons-material/Search';
6
6
  import TextField from '@mui/material/TextField';
7
7
  import ClearIcon from '@mui/icons-material/Clear';
8
- import styled from 'styled-components';
8
+ import styled from '@emotion/styled';
9
9
  import clsx from 'clsx';
10
10
  import { useDatatableContext } from './DatatableContext';
11
11
 
@@ -2,7 +2,8 @@
2
2
  import { useEffect, useRef, isValidElement } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import MUIDataTable, { TableFilterList, TableFooter } from 'mui-datatables';
5
- import styled, { css } from 'styled-components';
5
+ import styled from '@emotion/styled';
6
+ import { css } from '@emotion/react';
6
7
  import isObject from 'lodash/isObject';
7
8
  import cloneDeep from 'lodash/cloneDeep';
8
9
  import get from 'lodash/get';
@@ -10,13 +11,13 @@ import clsx from 'clsx';
10
11
  import Empty from '../Empty';
11
12
  import Spinner from '../Spinner';
12
13
  import CustomToolbar from './CustomToolbar';
13
- import { DatatableProvide, useDatatableContext } from './DatatableContext';
14
+ import { DatatableProvider, useDatatableContext } from './DatatableContext';
14
15
 
15
16
  export default function Datatable({ ...props }) {
16
17
  return (
17
- <DatatableProvide>
18
+ <DatatableProvider>
18
19
  <ReDatatable {...props} />
19
- </DatatableProvide>
20
+ </DatatableProvider>
20
21
  );
21
22
  }
22
23
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import MuiDialog from '@mui/material/Dialog';
4
4
  import MuiDialogContent from '@mui/material/DialogContent';
5
5
  import DialogActions from '@mui/material/DialogActions';
@@ -2,7 +2,7 @@
2
2
  import { useReducer, useRef, useEffect } from 'react';
3
3
  import useSpring from 'react-use/lib/useSpring';
4
4
  import PropTypes from 'prop-types';
5
- import styled from 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import * as d3 from 'd3-geo';
7
7
  import * as topojson from 'topojson-client';
8
8
  import versor from 'versor';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Icon from '../Icon';
4
4
 
5
5
  const Wrapper = styled.div`
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import { useTheme } from '@mui/material/styles';
4
4
  import { red } from '@mui/material/colors';
5
5
  import Button from '../Button';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-unused-prop-types */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import Typography from '@mui/material/Typography';
5
5
  import MuiContainer from '@mui/material/Container';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
  import Container from '@mui/material/Container';
5
5
  import { useTheme } from '@mui/material/styles';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import MenuIcon from '@mui/icons-material/Menu';
5
5
  import CloseIcon from '@mui/icons-material/Close';
6
6
  import Button from '@mui/material/IconButton';
package/src/Icon/image.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Img from '../Img';
5
5
 
package/src/Icon/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import colors from '../Colors';
6
6
 
@@ -1,7 +1,7 @@
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 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import Typography from '@mui/material/Typography';
6
6
 
7
7
  function InfoRow({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }) {
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { withRouter, useLocation, matchPath } from 'react-router-dom';
3
+ import { useLocation, matchPath } from 'react-router-dom';
4
4
  import Helmet from 'react-helmet';
5
- import styled from 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import { useTheme } from '@mui/material/styles';
7
7
  import Container from '@mui/material/Container';
8
8
  import Hidden from '@mui/material/Hidden';
@@ -39,7 +39,7 @@ function formatLinks(links, location) {
39
39
  {link.title}
40
40
  </Link>
41
41
  ),
42
- active: !!matchPath(location.pathname, { path: link.url, exact: false }),
42
+ active: !!matchPath({ path: link.url, end: false }, location.pathname),
43
43
  };
44
44
  });
45
45
  }
@@ -165,7 +165,7 @@ const StyledUxHeader = styled(ResponsiveHeader)`
165
165
  `;
166
166
 
167
167
  // 兼容旧版 dashboard
168
- function DashboardWrapper({ legacy, ...rest }) {
168
+ export default function DashboardWrapper({ legacy, ...rest }) {
169
169
  if (legacy) {
170
170
  return <DashboardLegacy {...rest} />;
171
171
  }
@@ -181,5 +181,3 @@ DashboardWrapper.defaultProps = {
181
181
  ...Dashboard.defaultProps,
182
182
  legacy: true,
183
183
  };
184
-
185
- export default withRouter(DashboardWrapper);
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-array-index-key */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
6
  import { teal } from '@mui/material/colors';
@@ -31,8 +31,9 @@ function renderLinksItem(item) {
31
31
  <NavLink
32
32
  to={url}
33
33
  external={external}
34
- className="layout-sidebar-link"
35
- activeClassName="layout-sidebar-link--active">
34
+ className={({ isActive }) =>
35
+ isActive ? 'layout-sidebar-link layout-sidebar-link--active' : 'layout-sidebar-link'
36
+ }>
36
37
  <span className={`layout-sidebar-icon ${showBadge ? 'layout-sidebar-badge' : ''}`}>{icon}</span>
37
38
  <Typography component="span" className="layout-sidebar-link-text">
38
39
  {title}
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Button from '@mui/material/IconButton';
4
4
  import AppBar from '@mui/material/AppBar';
5
5
  import Toolbar from '@mui/material/Toolbar';
@@ -1,7 +1,7 @@
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 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import Container from '@mui/material/Container';
6
6
  import Box from '@mui/material/Box';
7
7
  import Drawer from '@mui/material/Drawer';
@@ -1,8 +1,8 @@
1
1
  import { memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
- import { withRouter, Link } from 'react-router-dom';
5
+ import { Link, useLocation } from 'react-router-dom';
6
6
  import { useTheme } from '@mui/material/styles';
7
7
  import Button from '@mui/material/Button';
8
8
  import Typography from '@mui/material/Typography';
@@ -11,8 +11,9 @@ import { teal } from '@mui/material/colors';
11
11
  import ImageIcon from '../../Icon/image';
12
12
  import Logo from '../../Logo';
13
13
 
14
- function Sidebar({ location, images, links, prefix, addons, logo, ...rest }) {
14
+ export default function Sidebar({ images, links, prefix, addons, logo, ...rest }) {
15
15
  const theme = useTheme();
16
+ const location = useLocation();
16
17
  const isSelected = (url, name) => {
17
18
  const pattern = new RegExp(`/${name}`);
18
19
  return pattern.test(location.pathname);
@@ -47,7 +48,6 @@ function Sidebar({ location, images, links, prefix, addons, logo, ...rest }) {
47
48
  }
48
49
 
49
50
  Sidebar.propTypes = {
50
- location: PropTypes.object.isRequired,
51
51
  images: PropTypes.object.isRequired,
52
52
  links: PropTypes.array.isRequired,
53
53
  prefix: PropTypes.string,
@@ -116,5 +116,3 @@ const MenuItem = styled(Button)`
116
116
  }
117
117
  }
118
118
  `;
119
-
120
- export default withRouter(Sidebar);
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import Helmet from 'react-helmet';
5
5
  import Link from '@mui/material/Link';
6
6
 
@@ -1,7 +1,7 @@
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 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  import { useTheme } from '@mui/material/styles';
7
7
  import Button from '@mui/material/Button';
package/src/Logo/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import { ReactComponent as LightLogo } from './images/logo-light-top.svg';
5
5
  import { ReactComponent as LightText } from './images/logo-light-text.svg';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import ImageIcon from '../Icon/image';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  function AspectRatioContainer({ aspect, children, ...rest }) {
5
5
  return (
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
  import BrokenImage from '@mui/icons-material/BrokenImage';
3
3
 
4
4
  export default function Broken() {
@@ -1,7 +1,7 @@
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 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import clsx from 'clsx';
6
6
  import { Buffer } from 'buffer';
7
7
  import get from 'lodash/get';
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  export default function Loading() {
4
4
  return <Root className="nft-display__loading">loading...</Root>;
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
3
- import root from 'react-shadow/styled-components';
2
+ import styled from '@emotion/styled';
3
+ import root from 'react-shadow/emotion';
4
4
 
5
5
  /**
6
6
  * inline svg 的方式嵌入 svg, 使用 shadow DOM 避免样式污染
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  const NavMenuBase = styled.nav`
4
4
  background-color: ${(props) => props.$bgColor};
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Card from '@mui/material/Card';
5
5
  import Button from '@mui/material/Button';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Grid from '@mui/material/Grid';
4
4
 
5
5
  import PricingPlan from './PricingPlan';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
 
5
5
  function Result({ icon, title, description, extra, ...rest }) {
@@ -1,6 +1,6 @@
1
1
  import { createElement, Children, cloneElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import { mergeProps } from '../Util';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { useState, useRef, isValidElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import ExpandMore from '@mui/icons-material/ExpandMore';
5
5
  import Popper from '@mui/material/Popper';
6
6
  import Paper from '@mui/material/Paper';
package/src/Tag/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
6
  import { useTheme } from '@mui/material/styles';
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
 
3
3
  import Typography from '@mui/material/Typography';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  export default function TextCollapse({
7
7
  children,
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import { ThemeProvider as StyledThemeProvider } from 'styled-components';
2
+ import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
3
3
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
4
  import StyledEngineProvider from '@mui/material/StyledEngineProvider';
5
5
  import CssBaseline from '@mui/material/CssBaseline';
@@ -9,17 +9,16 @@ const defaultTheme = create();
9
9
 
10
10
  /**
11
11
  * 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
12
- * 注: 目前 UX 依赖 styled-components, 所以该组件也内置了一个 StyledThemeProvider
13
12
  */
14
- export default function ThemeProvider({ children, theme }) {
13
+ export default function ThemeProvider({ children, theme, injectFirst }) {
15
14
  return (
16
15
  // injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
17
- <StyledEngineProvider injectFirst>
16
+ <StyledEngineProvider injectFirst={injectFirst}>
18
17
  <MuiThemeProvider theme={theme}>
19
- <StyledThemeProvider theme={theme}>
18
+ <EmotionThemeProvider theme={theme}>
20
19
  <CssBaseline />
21
20
  {children}
22
- </StyledThemeProvider>
21
+ </EmotionThemeProvider>
23
22
  </MuiThemeProvider>
24
23
  </StyledEngineProvider>
25
24
  );
@@ -28,9 +27,11 @@ export default function ThemeProvider({ children, theme }) {
28
27
  ThemeProvider.propTypes = {
29
28
  children: PropTypes.any,
30
29
  theme: PropTypes.any,
30
+ injectFirst: PropTypes.bool,
31
31
  };
32
32
 
33
33
  ThemeProvider.defaultProps = {
34
34
  children: null,
35
35
  theme: defaultTheme,
36
+ injectFirst: true,
36
37
  };
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Player from 'react-player';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  import CircularProgress from '@mui/material/CircularProgress';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Typography from '@mui/material/Typography';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Typography from '@mui/material/Typography';
5
5
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
4
4
  import Fab from '@mui/material/Fab';
5
5
 
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  import Typography from '@mui/material/Typography';
4
4
  import Dialog from '@mui/material/Dialog';