@arcblock/ux 1.17.21 → 2.0.0

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 (99) hide show
  1. package/lib/ActionButton/index.js +1 -1
  2. package/lib/ActivityIndicator/index.js +2 -2
  3. package/lib/Alert/index.js +2 -2
  4. package/lib/Async/index.js +1 -1
  5. package/lib/Badge/index.js +1 -1
  6. package/lib/Blocklet/blocklet.js +5 -5
  7. package/lib/BlockletNFT/index.js +7 -7
  8. package/lib/Button/index.js +1 -1
  9. package/lib/Button/wrap.js +2 -21
  10. package/lib/ButtonGroup/index.js +2 -2
  11. package/lib/ClickToCopy/index.js +2 -2
  12. package/lib/CodeBlock/index.js +3 -3
  13. package/lib/ContactForm/index.js +3 -3
  14. package/lib/CookieConsent/index.js +7 -3
  15. package/lib/Dialog/dialog.js +10 -9
  16. package/lib/Footer/index.js +1 -1
  17. package/lib/Header/header.js +4 -4
  18. package/lib/Header/responsive-header.js +7 -7
  19. package/lib/Icon/index.js +1 -1
  20. package/lib/Img/index.js +12 -7
  21. package/lib/InfoRow/index.js +1 -1
  22. package/lib/Layout/dashboard/header.js +9 -9
  23. package/lib/Layout/dashboard/index.js +3 -3
  24. package/lib/Layout/dashboard/sidebar.js +6 -6
  25. package/lib/Layout/index.js +19 -16
  26. package/lib/Locale/selector.js +16 -11
  27. package/lib/NFTDisplay/broken.js +1 -1
  28. package/lib/NavMenu/nav-menu.js +1 -1
  29. package/lib/PageScroller/index.js +6 -2
  30. package/lib/PricingTable/PricingPlan.js +4 -4
  31. package/lib/PricingTable/index.js +2 -2
  32. package/lib/Result/common.js +3 -3
  33. package/lib/Result/index.js +3 -6
  34. package/lib/Result/result.js +3 -2
  35. package/lib/Spinner/index.js +2 -2
  36. package/lib/SplitButton/index.js +8 -8
  37. package/lib/Switch/index.js +3 -3
  38. package/lib/Tabs/index.js +26 -17
  39. package/lib/Tag/index.js +2 -2
  40. package/lib/TextCollapse/index.js +1 -1
  41. package/lib/Theme/index.js +51 -67
  42. package/lib/Toast/index.js +12 -11
  43. package/lib/Video/index.js +1 -1
  44. package/lib/Wallet/Action.js +1 -1
  45. package/lib/Wallet/Download.js +1 -1
  46. package/lib/Wallet/Open.js +1 -1
  47. package/lib/WechatPrompt/index.js +2 -2
  48. package/lib/withTheme/index.js +3 -3
  49. package/package.json +10 -8
  50. package/src/ActionButton/index.js +1 -1
  51. package/src/ActivityIndicator/index.js +2 -2
  52. package/src/Alert/index.js +2 -2
  53. package/src/Async/index.js +1 -1
  54. package/src/Badge/index.js +1 -1
  55. package/src/Blocklet/blocklet.js +4 -4
  56. package/src/BlockletNFT/index.js +7 -7
  57. package/src/Button/index.js +1 -1
  58. package/src/Button/wrap.js +2 -9
  59. package/src/ButtonGroup/index.js +2 -2
  60. package/src/ClickToCopy/index.js +2 -2
  61. package/src/CodeBlock/index.js +3 -3
  62. package/src/ContactForm/index.js +3 -3
  63. package/src/CookieConsent/index.js +4 -3
  64. package/src/Dialog/dialog.js +12 -9
  65. package/src/Footer/index.js +1 -1
  66. package/src/Header/header.js +5 -5
  67. package/src/Header/responsive-header.js +7 -7
  68. package/src/Icon/index.js +1 -0
  69. package/src/Img/index.js +12 -6
  70. package/src/InfoRow/index.js +1 -1
  71. package/src/Layout/dashboard/header.js +10 -10
  72. package/src/Layout/dashboard/index.js +3 -3
  73. package/src/Layout/dashboard/sidebar.js +10 -13
  74. package/src/Layout/index.js +18 -16
  75. package/src/Locale/selector.js +22 -17
  76. package/src/NFTDisplay/broken.js +1 -1
  77. package/src/NavMenu/nav-menu.js +1 -1
  78. package/src/PageScroller/index.js +4 -2
  79. package/src/PricingTable/PricingPlan.js +4 -4
  80. package/src/PricingTable/index.js +2 -2
  81. package/src/Result/common.js +3 -3
  82. package/src/Result/index.js +0 -2
  83. package/src/Result/result.js +3 -2
  84. package/src/Spinner/index.js +2 -2
  85. package/src/SplitButton/index.js +8 -8
  86. package/src/Switch/index.js +3 -3
  87. package/src/Tabs/index.js +16 -10
  88. package/src/Tag/index.js +2 -2
  89. package/src/TextCollapse/index.js +1 -1
  90. package/src/Theme/index.js +44 -57
  91. package/src/Toast/index.js +11 -11
  92. package/src/Video/index.js +1 -1
  93. package/src/Wallet/Action.js +1 -1
  94. package/src/Wallet/Download.js +1 -1
  95. package/src/Wallet/Open.js +1 -1
  96. package/src/WechatPrompt/index.js +2 -2
  97. package/src/withTheme/index.js +2 -2
  98. package/lib/Theme/responsiveFontSizes.js +0 -83
  99. package/src/Theme/responsiveFontSizes.js +0 -94
@@ -2,9 +2,9 @@ import React, { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Helmet from 'react-helmet';
4
4
  import styled from 'styled-components';
5
- import Container from '@material-ui/core/Container';
6
- import Box from '@material-ui/core/Box';
7
- import Drawer from '@material-ui/core/Drawer';
5
+ import Container from '@mui/material/Container';
6
+ import Box from '@mui/material/Box';
7
+ import Drawer from '@mui/material/Drawer';
8
8
  import useWindowSize from 'react-use/lib/useWindowSize';
9
9
 
10
10
  import Sidebar from './sidebar';
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import withTheme from '@material-ui/core/styles/withTheme';
4
+ import withTheme from '@mui/styles/withTheme';
5
5
 
6
6
  import { withRouter, Link } from 'react-router-dom';
7
- import Button from '@material-ui/core/Button';
8
- import Typography from '@material-ui/core/Typography';
9
- import teal from '@material-ui/core/colors/teal';
7
+ import Button from '@mui/material/Button';
8
+ import Typography from '@mui/material/Typography';
9
+ import teal from '@mui/material/colors/teal';
10
10
 
11
11
  import ImageIcon from '../../Icon/image';
12
12
  import Logo from '../../Logo';
@@ -77,7 +77,7 @@ const MenuItems = React.memo(styled.div`
77
77
  text-align: center;
78
78
  font-size: 0;
79
79
  }
80
- ${props => props.theme.breakpoints.down('sm')} {
80
+ ${props => props.theme.breakpoints.down('md')} {
81
81
  && .sidebar-logo {
82
82
  display: block;
83
83
  }
@@ -88,7 +88,10 @@ const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255
88
88
 
89
89
  const MenuItem = styled(Button)`
90
90
  && {
91
- display: block;
91
+ display: flex;
92
+ flex-direction: column;
93
+ justify-content: center;
94
+ align-items: center;
92
95
  width: 100%;
93
96
  transition: all 200ms ease-in-out;
94
97
  background: ${props => (props.selected ? gradient : '')};
@@ -109,13 +112,7 @@ const MenuItem = styled(Button)`
109
112
  text-transform: capitalize;
110
113
  letter-spacing: normal;
111
114
  width: 80%;
112
- }
113
-
114
- .MuiButton-label {
115
- display: flex;
116
- flex-direction: column;
117
- justify-content: center;
118
- align-items: center;
115
+ color: ${props => props.theme.palette.text.primary};
119
116
  }
120
117
  }
121
118
  `;
@@ -2,19 +2,19 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import Helmet from 'react-helmet';
5
- import Link from '@material-ui/core/Link';
5
+ import Link from '@mui/material/Link';
6
6
 
7
- import AppBar from '@material-ui/core/AppBar';
8
- import Container from '@material-ui/core/Container';
9
- import Drawer from '@material-ui/core/Drawer';
10
- import Divider from '@material-ui/core/Divider';
11
- import Toolbar from '@material-ui/core/Toolbar';
12
- import Typography from '@material-ui/core/Typography';
13
- import List from '@material-ui/core/List';
14
- import ListItem from '@material-ui/core/ListItem';
15
- import ListItemText from '@material-ui/core/ListItemText';
16
- import IconButton from '@material-ui/core/IconButton';
17
- import MenuIcon from '@material-ui/icons/Menu';
7
+ import AppBar from '@mui/material/AppBar';
8
+ import Container from '@mui/material/Container';
9
+ import Drawer from '@mui/material/Drawer';
10
+ import Divider from '@mui/material/Divider';
11
+ import Toolbar from '@mui/material/Toolbar';
12
+ import Typography from '@mui/material/Typography';
13
+ import List from '@mui/material/List';
14
+ import ListItem from '@mui/material/ListItem';
15
+ import ListItemText from '@mui/material/ListItemText';
16
+ import IconButton from '@mui/material/IconButton';
17
+ import MenuIcon from '@mui/icons-material/Menu';
18
18
 
19
19
  import Footer from '../Footer';
20
20
  import OpenInWallet from '../Wallet/Open';
@@ -63,7 +63,7 @@ export default function Layout({
63
63
  <Divider />
64
64
  <List>
65
65
  {links.map(x => (
66
- <Link className="nav-link" key={x.url} href={x.url}>
66
+ <Link className="nav-link" key={x.url} href={x.url} underline="hover">
67
67
  <ListItem button className={activeLink === x.url ? 'drawer-highlight-nav' : ''}>
68
68
  <ListItemText>
69
69
  {x.icon && (
@@ -99,7 +99,8 @@ export default function Layout({
99
99
  aria-label="open drawer"
100
100
  edge="start"
101
101
  onClick={onToggleDrawer}
102
- className="menu-button">
102
+ className="menu-button"
103
+ size="large">
103
104
  <MenuIcon />
104
105
  </IconButton>
105
106
  {showLogo ? <div className="menu-logo">{logo}</div> : <></>}
@@ -130,7 +131,8 @@ export default function Layout({
130
131
  key={x.url}
131
132
  href={x.url}
132
133
  className={`nav-link ${activeLink === x.url ? 'highlight-nav' : ''}`}
133
- color={x.color}>
134
+ color={x.color}
135
+ underline="hover">
134
136
  {x.icon && (
135
137
  <Icon
136
138
  name={x.icon}
@@ -278,7 +280,7 @@ const Div = styled.div`
278
280
  }
279
281
  }
280
282
 
281
- ${props => props.theme.breakpoints.down('sm')} {
283
+ ${props => props.theme.breakpoints.down('md')} {
282
284
  .toolbar {
283
285
  .nav-links,
284
286
  .menu-logo,
@@ -1,16 +1,18 @@
1
+ /* eslint-disable react/jsx-no-bind */
1
2
  import React, { useState, useContext, useRef } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import styled from 'styled-components';
4
5
 
5
- import { useTheme } from '@material-ui/core/styles';
6
- import Button from '@material-ui/core/Button';
7
- import Typography from '@material-ui/core/Typography';
8
- import IconButton from '@material-ui/core/IconButton';
9
- import ClickAwayListener from '@material-ui/core/ClickAwayListener';
10
- import Popper from '@material-ui/core/Popper';
11
- import MenuItem from '@material-ui/core/MenuItem';
12
- import MenuList from '@material-ui/core/MenuList';
13
- import CheckIcon from '@material-ui/icons/Check';
6
+ import { useTheme } from '@mui/styles';
7
+ import Button from '@mui/material/Button';
8
+ import Typography from '@mui/material/Typography';
9
+ import IconButton from '@mui/material/IconButton';
10
+ import ClickAwayListener from '@mui/material/ClickAwayListener';
11
+ import Popper from '@mui/material/Popper';
12
+ import MenuItem from '@mui/material/MenuItem';
13
+ import MenuList from '@mui/material/MenuList';
14
+ import Box from '@mui/material/Box';
15
+ import CheckIcon from '@mui/icons-material/Check';
14
16
 
15
17
  import { getColor, getBackground } from '../Util';
16
18
 
@@ -44,14 +46,16 @@ function LocaleSelector(props) {
44
46
  return (
45
47
  <Div component="div" dark={dark} theme={theme} {...rest}>
46
48
  <ButtonComponent ref={anchorEl} className="trigger" onClick={() => setOpen(!open)}>
47
- <img src={dark ? globeDark : globeLight} className="trigger-image" alt="globe" />
48
- {showText ? (
49
- <Typography component="strong" className="trigger-text">
50
- {languages.find(x => x.value === locale).text}
51
- </Typography>
52
- ) : (
53
- ''
54
- )}
49
+ <Box display="flex" alignItems="center">
50
+ <img src={dark ? globeDark : globeLight} className="trigger-image" alt="globe" />
51
+ {showText ? (
52
+ <Typography component="strong" className="trigger-text">
53
+ {languages.find(x => x.value === locale).text}
54
+ </Typography>
55
+ ) : (
56
+ ''
57
+ )}
58
+ </Box>
55
59
  </ButtonComponent>
56
60
  <Popper open={open} anchorEl={anchorEl.current} {...popperProps} disablePortal>
57
61
  <div className="locales">
@@ -105,6 +109,7 @@ const Div = styled.div`
105
109
  .trigger-text {
106
110
  margin-left: 5px;
107
111
  font-size: 14px;
112
+ color: ${props => getColor(props)};
108
113
  }
109
114
  }
110
115
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import BrokenImage from '@material-ui/icons/BrokenImage';
3
+ import BrokenImage from '@mui/icons-material/BrokenImage';
4
4
 
5
5
  export default function Broken() {
6
6
  return <Root className="nft-display__broken" />;
@@ -1,7 +1,7 @@
1
1
  import React, { createContext, useContext, useMemo, useState, useRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import clsx from 'clsx';
4
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
4
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
5
5
  import { HorizontalStyle, InlineStyle } from './style';
6
6
 
7
7
  const NavMenuContext = createContext();
@@ -220,8 +220,10 @@ const PageScroller = ({
220
220
  pageContainer.current.addEventListener(Events.TOUCHMOVE, touchMove);
221
221
  pageContainer.current.addEventListener(Events.KEYDOWN, keyPress);
222
222
  return () => {
223
- pageContainer.current.removeEventListener(Events.TOUCHMOVE, touchMove);
224
- pageContainer.current.removeEventListener(Events.KEYDOWN, keyPress);
223
+ if (pageContainer.current?.removeEventListener) {
224
+ pageContainer.current.removeEventListener(Events.TOUCHMOVE, touchMove);
225
+ pageContainer.current.removeEventListener(Events.KEYDOWN, keyPress);
226
+ }
225
227
  };
226
228
  }, [touchMove, keyPress]);
227
229
 
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Card from '@material-ui/core/Card';
6
- import Button from '@material-ui/core/Button';
7
- import CardContent from '@material-ui/core/CardContent';
8
- import Typography from '@material-ui/core/Typography';
5
+ import Card from '@mui/material/Card';
6
+ import Button from '@mui/material/Button';
7
+ import CardContent from '@mui/material/CardContent';
8
+ import Typography from '@mui/material/Typography';
9
9
 
10
10
  const PricingPlan = ({ plan }) => (
11
11
  <PlanCard shadow>
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Grid from '@material-ui/core/Grid';
4
+ import Grid from '@mui/material/Grid';
5
5
 
6
6
  import PricingPlan from './PricingPlan';
7
7
 
@@ -9,7 +9,7 @@ const PricingTable = ({ plans }) => {
9
9
  if (plans && plans.length > 0) {
10
10
  return (
11
11
  <Div variant="even">
12
- <Grid container spacing={2} justify="center">
12
+ <Grid container spacing={2} justifyContent="center">
13
13
  {plans.map(x => (
14
14
  <Grid item className="plan-item" key={x.id} xs={12} sm={6} md={3}>
15
15
  <PricingPlan plan={x} />
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable no-param-reassign */
3
3
  import React from 'react';
4
- import useTheme from '@material-ui/core/styles/useTheme';
5
- import InfoIcon from '@material-ui/icons/Info';
6
- import CancelRoundedIcon from '@material-ui/icons/CancelRounded';
4
+ import useTheme from '@mui/styles/useTheme';
5
+ import InfoIcon from '@mui/icons-material/Info';
6
+ import CancelRoundedIcon from '@mui/icons-material/CancelRounded';
7
7
  import Result from './result';
8
8
  import translations from './translations';
9
9
  import { useLocaleContext } from '../Locale/context';
@@ -26,11 +26,9 @@ const ResultWrapper = ({ status, ...rest }) => {
26
26
  ResultWrapper.propTypes = {
27
27
  status: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
28
28
  ...Result.propTypes,
29
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
30
29
  };
31
30
  ResultWrapper.defaultProps = {
32
31
  status: '',
33
- title: '',
34
32
  };
35
33
 
36
34
  export default ResultWrapper;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Box from '@material-ui/core/Box';
4
+ import Box from '@mui/material/Box';
5
5
 
6
6
  const Result = ({ icon, title, description, extra, ...rest }) => {
7
7
  return (
@@ -30,13 +30,14 @@ const Result = ({ icon, title, description, extra, ...rest }) => {
30
30
 
31
31
  Result.propTypes = {
32
32
  icon: PropTypes.element,
33
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
33
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
34
34
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
35
35
  actions: PropTypes.any,
36
36
  extra: PropTypes.element,
37
37
  };
38
38
  Result.defaultProps = {
39
39
  icon: undefined,
40
+ title: '',
40
41
  description: '',
41
42
  actions: null,
42
43
  extra: undefined,
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import CircularProgress from '@material-ui/core/CircularProgress';
2
+ import CircularProgress from '@mui/material/CircularProgress';
3
3
 
4
4
  /**
5
5
  * Spinner
6
6
  *
7
- * 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @material-ui/core/CircularProgress 的实现
7
+ * 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现
8
8
  *
9
9
  * - 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容
10
10
  * - color 默认使用 #4598fa, 如果调用方传入了 color prop 或 style#color, 则默认 color 被覆盖
@@ -1,13 +1,13 @@
1
1
  import React, { useState, useRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import ExpandMore from '@material-ui/icons/ExpandMore';
5
- import Popper from '@material-ui/core/Popper';
6
- import Paper from '@material-ui/core/Paper';
7
- import ClickAwayListener from '@material-ui/core/ClickAwayListener';
8
- import MenuList from '@material-ui/core/MenuList';
9
- import MenuItem from '@material-ui/core/MenuItem';
10
- import ButtonGroup from '@material-ui/core/ButtonGroup';
4
+ import ExpandMore from '@mui/icons-material/ExpandMore';
5
+ import Popper from '@mui/material/Popper';
6
+ import Paper from '@mui/material/Paper';
7
+ import ClickAwayListener from '@mui/material/ClickAwayListener';
8
+ import MenuList from '@mui/material/MenuList';
9
+ import MenuItem from '@mui/material/MenuItem';
10
+ import ButtonGroup from '@mui/material/ButtonGroup';
11
11
  import Button from '../Button';
12
12
 
13
13
  export default function SplitButton({
@@ -72,7 +72,7 @@ export default function SplitButton({
72
72
 
73
73
  SplitButton.propTypes = {
74
74
  size: PropTypes.oneOf(['small', 'medium', 'large']),
75
- color: PropTypes.oneOf(['default', 'primary', 'secondary', 'inherit']),
75
+ color: PropTypes.oneOf(['primary', 'secondary', 'inherit']),
76
76
  menu: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
77
77
  // 也可以是用于渲染主按钮的 function
78
78
  children: PropTypes.any,
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { withStyles } from '@material-ui/core/styles';
4
- import FormControlLabel from '@material-ui/core/FormControlLabel';
5
- import MuiSwitch from '@material-ui/core/Switch';
3
+ import { withStyles } from '@mui/styles';
4
+ import FormControlLabel from '@mui/material/FormControlLabel';
5
+ import MuiSwitch from '@mui/material/Switch';
6
6
 
7
7
  // 参考: https://v4.mui.com/components/switches/
8
8
  const IOSSwitch = withStyles(theme => ({
package/src/Tabs/index.js CHANGED
@@ -1,12 +1,20 @@
1
1
  import React from 'react';
2
+ import { styled } from '@mui/material/styles';
2
3
  import PropTypes from 'prop-types';
3
- import { makeStyles } from '@material-ui/core';
4
- import MuiTabs from '@material-ui/core/Tabs';
5
- import MuiTab from '@material-ui/core/Tab';
4
+ import MuiTabs from '@mui/material/Tabs';
5
+ import MuiTab from '@mui/material/Tab';
6
6
 
7
- const useStyles = makeStyles(theme => ({
8
- tabs: {},
9
- tab: {
7
+ const PREFIX = 'index';
8
+
9
+ const classes = {
10
+ tabs: `${PREFIX}-tabs`,
11
+ tab: `${PREFIX}-tab`,
12
+ };
13
+
14
+ const StyledMuiTabs = styled(MuiTabs)(({ theme }) => ({
15
+ [`& .${classes.tabs}`]: {},
16
+
17
+ [`& .${classes.tab}`]: {
10
18
  fontSize: '0.875rem',
11
19
  [theme.breakpoints.up('md')]: {
12
20
  fontSize: '1rem',
@@ -15,10 +23,8 @@ const useStyles = makeStyles(theme => ({
15
23
  }));
16
24
 
17
25
  export default function Tabs({ tabs, current, onChange, ...rest }) {
18
- const classes = useStyles();
19
-
20
26
  return (
21
- <MuiTabs
27
+ <StyledMuiTabs
22
28
  scrollButtons="on"
23
29
  variant="scrollable"
24
30
  value={current}
@@ -35,7 +41,7 @@ export default function Tabs({ tabs, current, onChange, ...rest }) {
35
41
  icon={x.icon || null}
36
42
  />
37
43
  ))}
38
- </MuiTabs>
44
+ </StyledMuiTabs>
39
45
  );
40
46
  }
41
47
 
package/src/Tag/index.js CHANGED
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Typography from '@material-ui/core/Typography';
6
- import useTheme from '@material-ui/core/styles/useTheme';
5
+ import Typography from '@mui/material/Typography';
6
+ import useTheme from '@mui/styles/useTheme';
7
7
 
8
8
  import { mergeProps } from '../Util';
9
9
  import colors from '../Colors';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import Typography from '@material-ui/core/Typography';
4
+ import Typography from '@mui/material/Typography';
5
5
  import styled from 'styled-components';
6
6
 
7
7
  export default function TextCollapse({
@@ -1,10 +1,11 @@
1
1
  // https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
2
- import { createTheme } from '@material-ui/core/styles';
2
+ import { createTheme, responsiveFontSizes } from '@mui/material/styles';
3
3
  import '@fontsource/lato/400.css';
4
4
  import '@fontsource/lato/700.css';
5
- import responsiveFontSizes from './responsiveFontSizes';
6
5
  import colors from '../Colors';
7
6
 
7
+ const muiDarkTheme = createTheme({ palette: { mode: 'dark' } });
8
+
8
9
  // https://material-ui.com/customization/default-theme/
9
10
  // eslint-disable-next-line import/prefer-default-export
10
11
  export const create = ({
@@ -15,19 +16,37 @@ export const create = ({
15
16
  overrides,
16
17
  ...rest
17
18
  } = {}) => {
19
+ // palette 考虑 light & dark mode, dark mode 需要持续完善
20
+ // - 能配合 ColorModeContext 使用
21
+ // - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
22
+ const _palette =
23
+ mode === 'light'
24
+ ? Object.assign(
25
+ {
26
+ ...colors,
27
+ background: {
28
+ paper: colors.common.white,
29
+ default: colors.background.default,
30
+ },
31
+ mode,
32
+ },
33
+ palette || {}
34
+ )
35
+ : Object.assign(
36
+ {
37
+ ...muiDarkTheme.palette,
38
+ background: {
39
+ paper: colors.grey[900],
40
+ default: colors.grey[900],
41
+ },
42
+ mode,
43
+ },
44
+ palette || {}
45
+ );
46
+
18
47
  const theme = createTheme({
19
48
  themeName: 'ArcBlock',
20
- palette: Object.assign(
21
- {
22
- ...colors,
23
- background: {
24
- paper: mode === 'light' ? colors.common.white : colors.grey[900],
25
- default: mode === 'light' ? colors.background.default : colors.grey[900],
26
- },
27
- type: mode,
28
- },
29
- palette || {}
30
- ),
49
+ palette: _palette,
31
50
  typography: Object.assign(
32
51
  {
33
52
  useNextVariants: true,
@@ -65,29 +84,23 @@ export const create = ({
65
84
  },
66
85
  typography || {}
67
86
  ),
68
- overrides: Object.assign(
69
- {
70
- MuiButton: {
87
+ components: {
88
+ MuiButton: {
89
+ styleOverrides: {
71
90
  root: {
72
91
  boxShadow: 'none',
73
92
  },
74
93
  },
75
- MuiButtonGroup: {
76
- contained: {
77
- boxShadow: 'none',
78
- },
79
- },
80
- MuiAppBar: {
81
- root: {
82
- height: 80,
83
- },
84
- },
85
- MuiToolbar: {
94
+ },
95
+ MuiButtonGroup: {
96
+ styleOverrides: {
86
97
  root: {
87
- background: mode === 'light' ? colors.background.default : colors.grey[900],
98
+ boxShadow: 'none',
88
99
  },
89
100
  },
90
- MuiTableCell: {
101
+ },
102
+ MuiTableCell: {
103
+ styleOverrides: {
91
104
  root: {
92
105
  borderBottomWidth: '0',
93
106
  paddingTop: '14px',
@@ -103,35 +116,9 @@ export const create = ({
103
116
  color: mode === 'light' ? colors.grey[900] : colors.grey[300],
104
117
  },
105
118
  },
106
- MuiChip: {
107
- root: {
108
- padding: '3px',
109
- height: '24px',
110
- fontSize: '12px',
111
- marginRight: '10px',
112
- },
113
- label: {
114
- paddingLeft: '5px',
115
- paddingRight: '5px',
116
- marginRight: '5px',
117
- },
118
- },
119
- MuiTooltip: {
120
- tooltip: {
121
- fontSize: '14px',
122
- },
123
- },
124
- MuiTypography: {
125
- body1: {
126
- color: mode === 'light' ? colors.grey[900] : colors.grey[300],
127
- },
128
- body2: {
129
- color: mode === 'light' ? colors.grey[900] : colors.grey[300],
130
- },
131
- },
132
119
  },
133
- overrides || {}
134
- ),
120
+ ...overrides,
121
+ },
135
122
  pageWidth,
136
123
  // TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
137
124
  // 可以从 Colors 模块/theme.palette/mui colors 中取值
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import CheckCircleIcon from '@material-ui/icons/CheckCircle';
5
- import ErrorIcon from '@material-ui/icons/Error';
6
- import InfoIcon from '@material-ui/icons/Info';
7
- import CloseIcon from '@material-ui/icons/Close';
8
- import WarningIcon from '@material-ui/icons/Warning';
9
- import IconButton from '@material-ui/core/IconButton';
10
- import Snackbar from '@material-ui/core/Snackbar';
11
- import SnackbarContent from '@material-ui/core/SnackbarContent';
12
- import { amber, green } from '@material-ui/core/colors';
13
- import { makeStyles } from '@material-ui/core/styles';
4
+ import CheckCircleIcon from '@mui/icons-material/CheckCircle';
5
+ import ErrorIcon from '@mui/icons-material/Error';
6
+ import InfoIcon from '@mui/icons-material/Info';
7
+ import CloseIcon from '@mui/icons-material/Close';
8
+ import WarningIcon from '@mui/icons-material/Warning';
9
+ import IconButton from '@mui/material/IconButton';
10
+ import Snackbar from '@mui/material/Snackbar';
11
+ import SnackbarContent from '@mui/material/SnackbarContent';
12
+ import { amber, green } from '@mui/material/colors';
13
+ import { makeStyles } from '@mui/styles';
14
14
 
15
15
  const variantIcon = {
16
16
  success: CheckCircleIcon,
@@ -60,7 +60,7 @@ function SnackbarContentWrapper(props) {
60
60
  </span>
61
61
  }
62
62
  action={[
63
- <IconButton key="close" aria-label="close" color="inherit" onClick={onClose}>
63
+ <IconButton key="close" aria-label="close" color="inherit" onClick={onClose} size="large">
64
64
  <CloseIcon className={classes.icon} />
65
65
  </IconButton>,
66
66
  ]}
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import Player from 'react-player';
4
4
  import styled from 'styled-components';
5
5
 
6
- import CircularProgress from '@material-ui/core/CircularProgress';
6
+ import CircularProgress from '@mui/material/CircularProgress';
7
7
 
8
8
  import { mergeProps } from '../Util';
9
9
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Typography from '@material-ui/core/Typography';
5
+ import Typography from '@mui/material/Typography';
6
6
 
7
7
  import logo from './images/abtwallet.png';
8
8
  import { mergeProps } from '../Util';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
- import Typography from '@material-ui/core/Typography';
5
+ import Typography from '@mui/material/Typography';
6
6
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
7
7
 
8
8
  import { ReactComponent as AppStoreIcon } from './images/app-store.svg';