@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.
- package/lib/ActionButton/index.js +1 -1
- package/lib/ActivityIndicator/index.js +2 -2
- package/lib/Alert/index.js +2 -2
- package/lib/Async/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/Blocklet/blocklet.js +5 -5
- package/lib/BlockletNFT/index.js +7 -7
- package/lib/Button/index.js +1 -1
- package/lib/Button/wrap.js +2 -21
- package/lib/ButtonGroup/index.js +2 -2
- package/lib/ClickToCopy/index.js +2 -2
- package/lib/CodeBlock/index.js +3 -3
- package/lib/ContactForm/index.js +3 -3
- package/lib/CookieConsent/index.js +7 -3
- package/lib/Dialog/dialog.js +10 -9
- package/lib/Footer/index.js +1 -1
- package/lib/Header/header.js +4 -4
- package/lib/Header/responsive-header.js +7 -7
- package/lib/Icon/index.js +1 -1
- package/lib/Img/index.js +12 -7
- package/lib/InfoRow/index.js +1 -1
- package/lib/Layout/dashboard/header.js +9 -9
- package/lib/Layout/dashboard/index.js +3 -3
- package/lib/Layout/dashboard/sidebar.js +6 -6
- package/lib/Layout/index.js +19 -16
- package/lib/Locale/selector.js +16 -11
- package/lib/NFTDisplay/broken.js +1 -1
- package/lib/NavMenu/nav-menu.js +1 -1
- package/lib/PageScroller/index.js +6 -2
- package/lib/PricingTable/PricingPlan.js +4 -4
- package/lib/PricingTable/index.js +2 -2
- package/lib/Result/common.js +3 -3
- package/lib/Result/index.js +3 -6
- package/lib/Result/result.js +3 -2
- package/lib/Spinner/index.js +2 -2
- package/lib/SplitButton/index.js +8 -8
- package/lib/Switch/index.js +3 -3
- package/lib/Tabs/index.js +26 -17
- package/lib/Tag/index.js +2 -2
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/index.js +51 -67
- package/lib/Toast/index.js +12 -11
- package/lib/Video/index.js +1 -1
- package/lib/Wallet/Action.js +1 -1
- package/lib/Wallet/Download.js +1 -1
- package/lib/Wallet/Open.js +1 -1
- package/lib/WechatPrompt/index.js +2 -2
- package/lib/withTheme/index.js +3 -3
- package/package.json +10 -8
- package/src/ActionButton/index.js +1 -1
- package/src/ActivityIndicator/index.js +2 -2
- package/src/Alert/index.js +2 -2
- package/src/Async/index.js +1 -1
- package/src/Badge/index.js +1 -1
- package/src/Blocklet/blocklet.js +4 -4
- package/src/BlockletNFT/index.js +7 -7
- package/src/Button/index.js +1 -1
- package/src/Button/wrap.js +2 -9
- package/src/ButtonGroup/index.js +2 -2
- package/src/ClickToCopy/index.js +2 -2
- package/src/CodeBlock/index.js +3 -3
- package/src/ContactForm/index.js +3 -3
- package/src/CookieConsent/index.js +4 -3
- package/src/Dialog/dialog.js +12 -9
- package/src/Footer/index.js +1 -1
- package/src/Header/header.js +5 -5
- package/src/Header/responsive-header.js +7 -7
- package/src/Icon/index.js +1 -0
- package/src/Img/index.js +12 -6
- package/src/InfoRow/index.js +1 -1
- package/src/Layout/dashboard/header.js +10 -10
- package/src/Layout/dashboard/index.js +3 -3
- package/src/Layout/dashboard/sidebar.js +10 -13
- package/src/Layout/index.js +18 -16
- package/src/Locale/selector.js +22 -17
- package/src/NFTDisplay/broken.js +1 -1
- package/src/NavMenu/nav-menu.js +1 -1
- package/src/PageScroller/index.js +4 -2
- package/src/PricingTable/PricingPlan.js +4 -4
- package/src/PricingTable/index.js +2 -2
- package/src/Result/common.js +3 -3
- package/src/Result/index.js +0 -2
- package/src/Result/result.js +3 -2
- package/src/Spinner/index.js +2 -2
- package/src/SplitButton/index.js +8 -8
- package/src/Switch/index.js +3 -3
- package/src/Tabs/index.js +16 -10
- package/src/Tag/index.js +2 -2
- package/src/TextCollapse/index.js +1 -1
- package/src/Theme/index.js +44 -57
- package/src/Toast/index.js +11 -11
- package/src/Video/index.js +1 -1
- package/src/Wallet/Action.js +1 -1
- package/src/Wallet/Download.js +1 -1
- package/src/Wallet/Open.js +1 -1
- package/src/WechatPrompt/index.js +2 -2
- package/src/withTheme/index.js +2 -2
- package/lib/Theme/responsiveFontSizes.js +0 -83
- 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
|
|
6
|
-
import Box from '@material
|
|
7
|
-
import Drawer from '@material
|
|
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 '@
|
|
4
|
+
import withTheme from '@mui/styles/withTheme';
|
|
5
5
|
|
|
6
6
|
import { withRouter, Link } from 'react-router-dom';
|
|
7
|
-
import Button from '@material
|
|
8
|
-
import Typography from '@material
|
|
9
|
-
import teal from '@material
|
|
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('
|
|
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:
|
|
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
|
`;
|
package/src/Layout/index.js
CHANGED
|
@@ -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
|
|
5
|
+
import Link from '@mui/material/Link';
|
|
6
6
|
|
|
7
|
-
import AppBar from '@material
|
|
8
|
-
import Container from '@material
|
|
9
|
-
import Drawer from '@material
|
|
10
|
-
import Divider from '@material
|
|
11
|
-
import Toolbar from '@material
|
|
12
|
-
import Typography from '@material
|
|
13
|
-
import List from '@material
|
|
14
|
-
import ListItem from '@material
|
|
15
|
-
import ListItemText from '@material
|
|
16
|
-
import IconButton from '@material
|
|
17
|
-
import MenuIcon from '@
|
|
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('
|
|
283
|
+
${props => props.theme.breakpoints.down('md')} {
|
|
282
284
|
.toolbar {
|
|
283
285
|
.nav-links,
|
|
284
286
|
.menu-logo,
|
package/src/Locale/selector.js
CHANGED
|
@@ -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 '@
|
|
6
|
-
import Button from '@material
|
|
7
|
-
import Typography from '@material
|
|
8
|
-
import IconButton from '@material
|
|
9
|
-
import ClickAwayListener from '@material
|
|
10
|
-
import Popper from '@material
|
|
11
|
-
import MenuItem from '@material
|
|
12
|
-
import MenuList from '@material
|
|
13
|
-
import
|
|
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
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
package/src/NFTDisplay/broken.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import BrokenImage from '@
|
|
3
|
+
import BrokenImage from '@mui/icons-material/BrokenImage';
|
|
4
4
|
|
|
5
5
|
export default function Broken() {
|
|
6
6
|
return <Root className="nft-display__broken" />;
|
package/src/NavMenu/nav-menu.js
CHANGED
|
@@ -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 '@
|
|
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
|
|
224
|
-
|
|
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
|
|
6
|
-
import Button from '@material
|
|
7
|
-
import CardContent from '@material
|
|
8
|
-
import Typography from '@material
|
|
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
|
|
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}
|
|
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} />
|
package/src/Result/common.js
CHANGED
|
@@ -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 '@
|
|
5
|
-
import InfoIcon from '@
|
|
6
|
-
import CancelRoundedIcon from '@
|
|
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';
|
package/src/Result/index.js
CHANGED
|
@@ -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;
|
package/src/Result/result.js
CHANGED
|
@@ -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
|
|
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])
|
|
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,
|
package/src/Spinner/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import CircularProgress from '@material
|
|
2
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Spinner
|
|
6
6
|
*
|
|
7
|
-
* 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @material
|
|
7
|
+
* 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现
|
|
8
8
|
*
|
|
9
9
|
* - 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容
|
|
10
10
|
* - color 默认使用 #4598fa, 如果调用方传入了 color prop 或 style#color, 则默认 color 被覆盖
|
package/src/SplitButton/index.js
CHANGED
|
@@ -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 '@
|
|
5
|
-
import Popper from '@material
|
|
6
|
-
import Paper from '@material
|
|
7
|
-
import ClickAwayListener from '@material
|
|
8
|
-
import MenuList from '@material
|
|
9
|
-
import MenuItem from '@material
|
|
10
|
-
import ButtonGroup from '@material
|
|
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(['
|
|
75
|
+
color: PropTypes.oneOf(['primary', 'secondary', 'inherit']),
|
|
76
76
|
menu: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
|
|
77
77
|
// 也可以是用于渲染主按钮的 function
|
|
78
78
|
children: PropTypes.any,
|
package/src/Switch/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { withStyles } from '@
|
|
4
|
-
import FormControlLabel from '@material
|
|
5
|
-
import MuiSwitch from '@material
|
|
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
|
|
4
|
-
import
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
|
6
|
-
import useTheme from '@
|
|
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';
|
package/src/Theme/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
|
|
2
|
-
import { createTheme } from '@material
|
|
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:
|
|
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
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
87
|
+
components: {
|
|
88
|
+
MuiButton: {
|
|
89
|
+
styleOverrides: {
|
|
71
90
|
root: {
|
|
72
91
|
boxShadow: 'none',
|
|
73
92
|
},
|
|
74
93
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
MuiAppBar: {
|
|
81
|
-
root: {
|
|
82
|
-
height: 80,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
MuiToolbar: {
|
|
94
|
+
},
|
|
95
|
+
MuiButtonGroup: {
|
|
96
|
+
styleOverrides: {
|
|
86
97
|
root: {
|
|
87
|
-
|
|
98
|
+
boxShadow: 'none',
|
|
88
99
|
},
|
|
89
100
|
},
|
|
90
|
-
|
|
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 中取值
|
package/src/Toast/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import CheckCircleIcon from '@
|
|
5
|
-
import ErrorIcon from '@
|
|
6
|
-
import InfoIcon from '@
|
|
7
|
-
import CloseIcon from '@
|
|
8
|
-
import WarningIcon from '@
|
|
9
|
-
import IconButton from '@material
|
|
10
|
-
import Snackbar from '@material
|
|
11
|
-
import SnackbarContent from '@material
|
|
12
|
-
import { amber, green } from '@material
|
|
13
|
-
import { makeStyles } from '@
|
|
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
|
]}
|
package/src/Video/index.js
CHANGED
|
@@ -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
|
|
6
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
7
7
|
|
|
8
8
|
import { mergeProps } from '../Util';
|
|
9
9
|
|
package/src/Wallet/Action.js
CHANGED
|
@@ -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
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
6
|
|
|
7
7
|
import logo from './images/abtwallet.png';
|
|
8
8
|
import { mergeProps } from '../Util';
|
package/src/Wallet/Download.js
CHANGED
|
@@ -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
|
|
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';
|