@arcblock/ux 2.4.1 → 2.4.4

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 +2 -2
  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
@@ -2,14 +2,13 @@
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 '@emotion/styled';
6
5
  import axios from 'axios';
7
-
8
6
  import Typography from '@mui/material/Typography';
9
7
  import CircularProgress from '@mui/material/CircularProgress';
10
8
 
11
9
  import { mergeProps } from '../Util';
12
10
  import Button from '../Button';
11
+ import { styled } from '../Theme';
13
12
 
14
13
  export async function submitContactForm({ formId, portalId }, fields, context) {
15
14
  const url = `https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formId}`;
@@ -188,7 +187,7 @@ export default class ContactForm extends React.Component {
188
187
  // prettier-ignore
189
188
  const getInputWidth = props => (props.layout === 'vertical' ? '100%' : `${Math.max(95 / (props.fieldCount + 1), 20)}%`);
190
189
 
191
- const Form = styled.form`
190
+ const Form = styled('form')`
192
191
  display: flex;
193
192
  flex-direction: column;
194
193
  justify-content: center;
@@ -1,8 +1,9 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Button from '@mui/material/Button';
4
3
  import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
5
4
 
5
+ import { styled } from '../Theme';
6
+
6
7
  export { resetCookieConsentValue };
7
8
 
8
9
  const translations = {
@@ -59,7 +60,7 @@ DefaultCookieConsent.defaultProps = {
59
60
  locale: 'en',
60
61
  };
61
62
 
62
- const Wrapper = styled.div`
63
+ const Wrapper = styled('div')`
63
64
  box-sizing: border-box;
64
65
  position: fixed;
65
66
  right: 20px;
@@ -1,8 +1,8 @@
1
1
  import { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
 
5
4
  import { getColor, mergeProps } from '../Util';
5
+ import { styled } from '../Theme';
6
6
 
7
7
  const SECONDS_OF_MINUTE = 60;
8
8
  const SECONDS_OF_HOUR = 60 * SECONDS_OF_MINUTE;
@@ -99,7 +99,7 @@ CountDown.defaultProps = {
99
99
  const textBackground = `linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
100
100
  linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5) 77%, rgba(0, 0, 0, 0.5))`;
101
101
 
102
- const Container = styled.div`
102
+ const Container = styled('div')`
103
103
  color: ${(props) => getColor(props)};
104
104
  font-size: 50px;
105
105
  display: flex;
@@ -1,7 +1,6 @@
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 '@emotion/styled';
5
4
  import ReactToPrint, { PrintContextConsumer } from 'react-to-print';
6
5
  import IconButton from '@mui/material/IconButton';
7
6
  import Tooltip from '@mui/material/Tooltip';
@@ -16,11 +15,11 @@ import MenuItem from '@mui/material/MenuItem';
16
15
  import ListItemIcon from '@mui/material/ListItemIcon';
17
16
  import ListItemText from '@mui/material/ListItemText';
18
17
  import useMediaQuery from '@mui/material/useMediaQuery';
19
- import { useTheme } from '@mui/material/styles';
20
18
  import LinearProgress from '@mui/material/LinearProgress';
21
19
  import { handleCSVDownload } from './utils';
22
20
  import TableSearch from './TableSearch';
23
21
  import { useDatatableContext } from './DatatableContext';
22
+ import { styled, useTheme } from '../Theme';
24
23
 
25
24
  function useMobile() {
26
25
  const theme = useTheme();
@@ -351,7 +350,7 @@ CustomToolbar.defaultProps = {
351
350
  searchText: null,
352
351
  };
353
352
 
354
- const Container = styled.div`
353
+ const Container = styled('div')`
355
354
  display: flex;
356
355
  align-items: center;
357
356
  height: 56px;
@@ -413,7 +412,7 @@ const Container = styled.div`
413
412
  }
414
413
  `;
415
414
 
416
- const ProgressContainer = styled.div`
415
+ const ProgressContainer = styled('div')`
417
416
  width: 100%;
418
417
  height: 2px;
419
418
  .toolbar-progress {
@@ -5,9 +5,9 @@ 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 '@emotion/styled';
9
8
  import clsx from 'clsx';
10
9
  import { useDatatableContext } from './DatatableContext';
10
+ import { styled } from '../Theme';
11
11
 
12
12
  export default function TableSearch({ search, options, searchText, searchTextUpdate, searchClose, onSearchOpen }) {
13
13
  const { searchOpen, searchPlaceholder, searchAlwaysOpen } = options;
@@ -113,7 +113,7 @@ TableSearch.defaultProps = {
113
113
  onSearchOpen: () => {},
114
114
  };
115
115
 
116
- const Container = styled.div`
116
+ const Container = styled('div')`
117
117
  display: flex;
118
118
  align-items: center;
119
119
  .toolbar-search-area {
@@ -2,7 +2,6 @@
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 from '@emotion/styled';
6
5
  import { css } from '@emotion/react';
7
6
  import isObject from 'lodash/isObject';
8
7
  import cloneDeep from 'lodash/cloneDeep';
@@ -12,6 +11,7 @@ import Empty from '../Empty';
12
11
  import Spinner from '../Spinner';
13
12
  import CustomToolbar from './CustomToolbar';
14
13
  import { DatatableProvider, useDatatableContext } from './DatatableContext';
14
+ import { styled } from '../Theme';
15
15
 
16
16
  export default function Datatable({ ...props }) {
17
17
  return (
@@ -382,7 +382,7 @@ const alignCss = css`
382
382
  }
383
383
  `;
384
384
 
385
- const TableContainer = styled.div`
385
+ const TableContainer = styled('div')`
386
386
  &.datatable-hide-header {
387
387
  thead.MuiTableHead-root {
388
388
  display: none;
@@ -474,7 +474,7 @@ const TableContainer = styled.div`
474
474
  }
475
475
  `;
476
476
 
477
- const FilterLine = styled.div`
477
+ const FilterLine = styled('div')`
478
478
  display: flex;
479
479
  align-items: center;
480
480
  .toolbar-filter-content {
@@ -522,7 +522,7 @@ function WrapTableFooter(props) {
522
522
  );
523
523
  }
524
524
 
525
- const FooterContainer = styled.div`
525
+ const FooterContainer = styled('div')`
526
526
  display: flex;
527
527
  align-items: center;
528
528
  .datatable-footer {
@@ -1,13 +1,13 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import MuiDialog from '@mui/material/Dialog';
4
3
  import MuiDialogContent from '@mui/material/DialogContent';
5
4
  import DialogActions from '@mui/material/DialogActions';
6
5
  import IconButton from '@mui/material/IconButton';
7
6
  import useMediaQuery from '@mui/material/useMediaQuery';
8
- import { useTheme } from '@mui/material/styles';
9
7
  import CloseIcon from '@mui/icons-material/Close';
10
8
 
9
+ import { styled, useTheme } from '../Theme';
10
+
11
11
  /**
12
12
  * Dialog
13
13
  *
@@ -108,7 +108,7 @@ const StyledMuiDialog = styled(MuiDialog)`
108
108
  }
109
109
  `;
110
110
 
111
- const Header = styled.div`
111
+ const Header = styled('div')`
112
112
  display: flex;
113
113
  justify-content: space-between;
114
114
  align-items: center;
@@ -2,13 +2,13 @@
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 '@emotion/styled';
6
5
  import * as d3 from 'd3-geo';
7
6
  import * as topojson from 'topojson-client';
8
7
  import versor from 'versor';
9
8
 
10
9
  import json from './countries.json';
11
10
  import util from './util';
11
+ import { styled } from '../Theme';
12
12
 
13
13
  const geoJson = topojson.feature(json, json.objects.ne_110m_admin_0_countries);
14
14
  const themes = {
@@ -371,7 +371,7 @@ Earth.defaultProps = {
371
371
  colors: {},
372
372
  };
373
373
 
374
- const Container = styled.div`
374
+ const Container = styled('div')`
375
375
  background-color: ${(props) => (props.theme === 'light' ? '#f7f7f7' : '#222')};
376
376
  width: ${(props) => props.width}px;
377
377
  height: ${(props) => props.height}px;
@@ -454,7 +454,7 @@ const Container = styled.div`
454
454
  }
455
455
  `;
456
456
 
457
- const Tooltip = styled.div`
457
+ const Tooltip = styled('div')`
458
458
  position: absolute;
459
459
  width: auto;
460
460
  min-width: 90px;
@@ -1,8 +1,9 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
2
+
3
3
  import Icon from '../Icon';
4
+ import { styled } from '../Theme';
4
5
 
5
- const Wrapper = styled.div`
6
+ const Wrapper = styled('div')`
6
7
  display: flex;
7
8
  justify-content: center;
8
9
  align-items: center;
@@ -1,8 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
- import { useTheme } from '@mui/material/styles';
4
2
  import { red } from '@mui/material/colors';
5
3
  import Button from '../Button';
4
+ import { styled, useTheme } from '../Theme';
6
5
 
7
6
  function InternalErrorFallback({ title, desc, retryFunc }) {
8
7
  const theme = useTheme();
@@ -46,7 +45,7 @@ ErrorFallbackRetry.propTypes = {
46
45
  resetErrorBoundary: PropTypes.func.isRequired,
47
46
  };
48
47
 
49
- const Root = styled.div`
48
+ const Root = styled('div')`
50
49
  padding: 16px;
51
50
  border: 2px solid ${(props) => props.$theme.palette.error.main};
52
51
  border-radius: 4px;
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react/no-unused-prop-types */
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
  import Typography from '@mui/material/Typography';
5
4
  import MuiContainer from '@mui/material/Container';
6
5
 
7
6
  import { mergeProps } from '../Util';
8
7
  import Logo from '../Logo';
8
+ import { styled } from '../Theme';
9
9
 
10
10
  export default function Footer(props) {
11
11
  const newProps = mergeProps(props, Footer, ['dark', 'style']);
@@ -49,7 +49,7 @@ Footer.defaultProps = {
49
49
  style: {},
50
50
  };
51
51
 
52
- const Container = styled.div`
52
+ const Container = styled('div')`
53
53
  margin-top: 64px;
54
54
  padding: 24px 0 32px;
55
55
  border-top: 1px solid ${(props) => (props.dark ? props.theme.palette.grey[900] : '#dee2e7')};
@@ -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
  /**
6
7
  * 一个容器组件, 当子元素 width 超出该容器时自动隐藏子元素, 必须设置明确的 height 值
7
8
  */
@@ -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
  }