@arcblock/ux 2.1.27 → 2.1.30

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.
@@ -15,7 +15,7 @@ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularPr
15
15
 
16
16
  var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
17
17
 
18
- var _styles = require("@mui/styles");
18
+ var _styles = require("@mui/material/styles");
19
19
 
20
20
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
21
21
 
@@ -19,7 +19,7 @@ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularPr
19
19
 
20
20
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
21
21
 
22
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
22
+ var _styles = require("@mui/material/styles");
23
23
 
24
24
  var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
25
25
 
@@ -139,7 +139,7 @@ function BlockletNFT(_ref2) {
139
139
 
140
140
  const _onMainClick = wrapHandler(onMainClick);
141
141
 
142
- const theme = (0, _useTheme.default)();
142
+ const theme = (0, _styles.useTheme)();
143
143
  const isDownSm = (0, _useMediaQuery.default)(theme.breakpoints.down('md'));
144
144
  const isDownMd = (0, _useMediaQuery.default)(theme.breakpoints.down('lg'));
145
145
  const isUpLg = (0, _useMediaQuery.default)(theme.breakpoints.up('lg')); // If size is auto, need calculate actual size according to screen size
@@ -19,7 +19,7 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
19
19
 
20
20
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
21
21
 
22
- var _styles = require("@mui/styles");
22
+ var _styles = require("@mui/material/styles");
23
23
 
24
24
  var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
25
25
 
@@ -10,7 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
 
11
11
  var _styledComponents = _interopRequireDefault(require("styled-components"));
12
12
 
13
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
13
+ var _styles = require("@mui/material/styles");
14
14
 
15
15
  var _colors = require("@mui/material/colors");
16
16
 
@@ -26,7 +26,7 @@ function InternalErrorFallback(_ref) {
26
26
  desc,
27
27
  retryFunc
28
28
  } = _ref;
29
- const theme = (0, _useTheme.default)();
29
+ const theme = (0, _styles.useTheme)();
30
30
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
31
31
  role: "alert",
32
32
  $theme: theme,
@@ -13,7 +13,7 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
13
13
 
14
14
  var _Container = _interopRequireDefault(require("@mui/material/Container"));
15
15
 
16
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
16
+ var _styles = require("@mui/material/styles");
17
17
 
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
 
@@ -47,7 +47,7 @@ function Header(_ref) {
47
47
  } = _ref,
48
48
  rest = _objectWithoutProperties(_ref, _excluded);
49
49
 
50
- const theme = (0, _useTheme.default)();
50
+ const theme = (0, _styles.useTheme)();
51
51
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, _objectSpread(_objectSpread({}, rest), {}, {
52
52
  $theme: theme,
53
53
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Container.default, {
@@ -15,7 +15,7 @@ var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
15
15
 
16
16
  var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
17
17
 
18
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
18
+ var _styles = require("@mui/material/styles");
19
19
 
20
20
  var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
21
21
 
@@ -54,7 +54,7 @@ function ResponsiveHeader(_ref) {
54
54
  } = _ref,
55
55
  rest = _objectWithoutProperties(_ref, _excluded);
56
56
 
57
- const theme = (0, _useTheme.default)();
57
+ const theme = (0, _styles.useTheme)();
58
58
  const isMobile = (0, _useMediaQuery.default)(theme.breakpoints.down('md'));
59
59
  const [drawerOpen, setDrawerOpen] = (0, _react.useState)(false);
60
60
 
@@ -15,7 +15,7 @@ var _reactHelmet = _interopRequireDefault(require("react-helmet"));
15
15
 
16
16
  var _styledComponents = _interopRequireDefault(require("styled-components"));
17
17
 
18
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
18
+ var _styles = require("@mui/material/styles");
19
19
 
20
20
  var _Container = _interopRequireDefault(require("@mui/material/Container"));
21
21
 
@@ -77,7 +77,7 @@ function Dashboard(_ref2) {
77
77
  } = _ref2,
78
78
  rest = _objectWithoutProperties(_ref2, _excluded2);
79
79
 
80
- const theme = (0, _useTheme.default)();
80
+ const theme = (0, _styles.useTheme)();
81
81
  const location = (0, _reactRouterDom.useLocation)();
82
82
  const navItems = (0, _react.useMemo)(() => links.map(link => _objectSpread(_objectSpread({}, link), {}, {
83
83
  label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Link, {
@@ -11,10 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
- var _withTheme = _interopRequireDefault(require("@mui/styles/withTheme"));
15
-
16
14
  var _reactRouterDom = require("react-router-dom");
17
15
 
16
+ var _styles = require("@mui/material/styles");
17
+
18
18
  var _Button = _interopRequireDefault(require("@mui/material/Button"));
19
19
 
20
20
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
@@ -27,7 +27,7 @@ var _Logo = _interopRequireDefault(require("../../Logo"));
27
27
 
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
 
30
- const _excluded = ["location", "theme", "images", "links", "prefix", "addons", "logo"];
30
+ const _excluded = ["location", "images", "links", "prefix", "addons", "logo"];
31
31
 
32
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
33
 
@@ -44,7 +44,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
44
44
  function Sidebar(_ref) {
45
45
  let {
46
46
  location,
47
- theme,
48
47
  images,
49
48
  links,
50
49
  prefix,
@@ -53,6 +52,8 @@ function Sidebar(_ref) {
53
52
  } = _ref,
54
53
  rest = _objectWithoutProperties(_ref, _excluded);
55
54
 
55
+ const theme = (0, _styles.useTheme)();
56
+
56
57
  const isSelected = (url, name) => {
57
58
  const pattern = new RegExp("/".concat(name));
58
59
  return pattern.test(location.pathname);
@@ -100,7 +101,6 @@ function Sidebar(_ref) {
100
101
 
101
102
  Sidebar.propTypes = {
102
103
  location: _propTypes.default.object.isRequired,
103
- theme: _propTypes.default.object.isRequired,
104
104
  images: _propTypes.default.object.isRequired,
105
105
  links: _propTypes.default.array.isRequired,
106
106
  prefix: _propTypes.default.string,
@@ -122,6 +122,6 @@ const MenuItem = (0, _styledComponents.default)(_Button.default).withConfig({
122
122
  componentId: "sc-gtwxx4-1"
123
123
  })(["&&{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";border-radius:0;&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;color:", ";}}"], props => props.selected ? gradient : '', props => props.selected ? _colors.teal.A700 : 'transparent', gradient, _colors.teal.A700, props => props.theme.palette.text.primary);
124
124
 
125
- var _default = (0, _reactRouterDom.withRouter)((0, _withTheme.default)(Sidebar));
125
+ var _default = (0, _reactRouterDom.withRouter)(Sidebar);
126
126
 
127
127
  exports.default = _default;
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
- var _styles = require("@mui/styles");
14
+ var _styles = require("@mui/material/styles");
15
15
 
16
16
  var _Button = _interopRequireDefault(require("@mui/material/Button"));
17
17
 
@@ -11,7 +11,7 @@ exports.InternalServerError = InternalServerError;
11
11
  exports.Maintenance = Maintenance;
12
12
  exports.PageNotFound = PageNotFound;
13
13
 
14
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
14
+ var _styles = require("@mui/material/styles");
15
15
 
16
16
  var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
17
17
 
@@ -161,7 +161,7 @@ function Info(props) {
161
161
  Info.status = 'info';
162
162
 
163
163
  function StyledErrorIcon(props) {
164
- const theme = (0, _useTheme.default)();
164
+ const theme = (0, _styles.useTheme)();
165
165
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CancelRounded.default, _objectSpread({
166
166
  style: {
167
167
  color: theme.palette.error.main,
@@ -171,7 +171,7 @@ function StyledErrorIcon(props) {
171
171
  }
172
172
 
173
173
  function StyledInfoIcon(props) {
174
- const theme = (0, _useTheme.default)();
174
+ const theme = (0, _styles.useTheme)();
175
175
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Info.default, _objectSpread({
176
176
  style: {
177
177
  color: theme.palette.info.main,
@@ -72,7 +72,7 @@ function SplitButton(_ref) {
72
72
 
73
73
 
74
74
  const handleItemClick = e => {
75
- if (e.target.classList.contains('MuiListItem-root')) {
75
+ if (e.target.classList.contains('MuiMenuItem-root')) {
76
76
  setOpen(false);
77
77
  }
78
78
  };
package/lib/Tag/index.js CHANGED
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
15
 
16
- var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
16
+ var _styles = require("@mui/material/styles");
17
17
 
18
18
  var _Util = require("../Util");
19
19
 
@@ -73,7 +73,7 @@ function Tag(props) {
73
73
 
74
74
  const {
75
75
  palette
76
- } = (0, _useTheme.default)();
76
+ } = (0, _styles.useTheme)();
77
77
  const styles = Object.assign({}, types[type] || types.primary, style);
78
78
 
79
79
  if (palette[type]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.1.27",
3
+ "version": "2.1.30",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -52,10 +52,10 @@
52
52
  "react": ">=18.1.0",
53
53
  "react-ga": "^2.7.0"
54
54
  },
55
- "gitHead": "a5f51b0432dbdfe806276bdb10b68df19575687e",
55
+ "gitHead": "16c9e4b3d8664ef14440b248bdf34b46fc8396d1",
56
56
  "dependencies": {
57
- "@arcblock/icons": "^2.1.27",
58
- "@arcblock/react-hooks": "^2.1.27",
57
+ "@arcblock/icons": "^2.1.30",
58
+ "@arcblock/react-hooks": "^2.1.30",
59
59
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
60
60
  "@emotion/react": "^11.9.0",
61
61
  "@emotion/styled": "^11.8.1",
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import Typography from '@mui/material/Typography';
4
4
  import CircularProgress from '@mui/material/CircularProgress';
5
5
  import Avatar from '@arcblock/did-connect/lib/Avatar';
6
- import { useTheme } from '@mui/styles';
6
+ import { useTheme } from '@mui/material/styles';
7
7
  import useMediaQuery from '@mui/material/useMediaQuery';
8
8
 
9
9
  import Button from '../Button';
@@ -5,7 +5,7 @@ import Portal from '@mui/material/Portal';
5
5
  import Typography from '@mui/material/Typography';
6
6
  import CircularProgress from '@mui/material/CircularProgress';
7
7
  import useMediaQuery from '@mui/material/useMediaQuery';
8
- import useTheme from '@mui/styles/useTheme';
8
+ import { useTheme } from '@mui/material/styles';
9
9
  import Avatar from '@arcblock/did-connect/lib/Avatar';
10
10
 
11
11
  import Icon from '../Icon';
@@ -5,7 +5,7 @@ import MuiDialogContent from '@mui/material/DialogContent';
5
5
  import DialogActions from '@mui/material/DialogActions';
6
6
  import IconButton from '@mui/material/IconButton';
7
7
  import useMediaQuery from '@mui/material/useMediaQuery';
8
- import { useTheme } from '@mui/styles';
8
+ import { useTheme } from '@mui/material/styles';
9
9
  import CloseIcon from '@mui/icons-material/Close';
10
10
 
11
11
  /**
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import styled from 'styled-components';
3
- import useTheme from '@mui/styles/useTheme';
3
+ import { useTheme } from '@mui/material/styles';
4
4
  import { red } from '@mui/material/colors';
5
5
  import Button from '../Button';
6
6
 
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import styled from 'styled-components';
3
3
  import Box from '@mui/material/Box';
4
4
  import Container from '@mui/material/Container';
5
- import useTheme from '@mui/styles/useTheme';
5
+ import { useTheme } from '@mui/material/styles';
6
6
 
7
7
  /**
8
8
  * Header 组件
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import MenuIcon from '@mui/icons-material/Menu';
5
5
  import Button from '@mui/material/IconButton';
6
- import useTheme from '@mui/styles/useTheme';
6
+ import { useTheme } from '@mui/material/styles';
7
7
  import useMediaQuery from '@mui/material/useMediaQuery';
8
8
  import Drawer from '@mui/material/Drawer';
9
9
  import Header from './header';
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { withRouter, Link, useLocation, matchPath } from 'react-router-dom';
4
4
  import Helmet from 'react-helmet';
5
5
  import styled from 'styled-components';
6
- import useTheme from '@mui/styles/useTheme';
6
+ import { useTheme } from '@mui/material/styles';
7
7
  import Container from '@mui/material/Container';
8
8
  import Hidden from '@mui/material/Hidden';
9
9
  import Box from '@mui/material/Box';
@@ -1,9 +1,9 @@
1
1
  import { memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import withTheme from '@mui/styles/withTheme';
5
4
 
6
5
  import { withRouter, Link } from 'react-router-dom';
6
+ import { useTheme } from '@mui/material/styles';
7
7
  import Button from '@mui/material/Button';
8
8
  import Typography from '@mui/material/Typography';
9
9
  import { teal } from '@mui/material/colors';
@@ -11,7 +11,8 @@ 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, theme, images, links, prefix, addons, logo, ...rest }) {
14
+ function Sidebar({ location, images, links, prefix, addons, logo, ...rest }) {
15
+ const theme = useTheme();
15
16
  const isSelected = (url, name) => {
16
17
  const pattern = new RegExp(`/${name}`);
17
18
  return pattern.test(location.pathname);
@@ -47,7 +48,6 @@ function Sidebar({ location, theme, images, links, prefix, addons, logo, ...rest
47
48
 
48
49
  Sidebar.propTypes = {
49
50
  location: PropTypes.object.isRequired,
50
- theme: PropTypes.object.isRequired,
51
51
  images: PropTypes.object.isRequired,
52
52
  links: PropTypes.array.isRequired,
53
53
  prefix: PropTypes.string,
@@ -117,4 +117,4 @@ const MenuItem = styled(Button)`
117
117
  }
118
118
  `;
119
119
 
120
- export default withRouter(withTheme(Sidebar));
120
+ export default withRouter(Sidebar);
@@ -3,7 +3,7 @@ import { useState, useContext, useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import styled from 'styled-components';
5
5
 
6
- import { useTheme } from '@mui/styles';
6
+ import { useTheme } from '@mui/material/styles';
7
7
  import Button from '@mui/material/Button';
8
8
  import Typography from '@mui/material/Typography';
9
9
  import IconButton from '@mui/material/IconButton';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable no-param-reassign */
3
- import useTheme from '@mui/styles/useTheme';
3
+ import { useTheme } from '@mui/material/styles';
4
4
  import InfoIcon from '@mui/icons-material/Info';
5
5
  import CancelRoundedIcon from '@mui/icons-material/CancelRounded';
6
6
  import Result from './result';
@@ -27,7 +27,7 @@ export default function SplitButton({ size, color, menu, children, variant, onCl
27
27
 
28
28
  // 点击 item 后收起下拉菜单, 如果想要点击 action 后不收起下拉菜单, 可以在 item#onClick 时调用 e.stopPropagation()
29
29
  const handleItemClick = (e) => {
30
- if (e.target.classList.contains('MuiListItem-root')) {
30
+ if (e.target.classList.contains('MuiMenuItem-root')) {
31
31
  setOpen(false);
32
32
  }
33
33
  };
package/src/Tag/index.js CHANGED
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
- import useTheme from '@mui/styles/useTheme';
6
+ import { useTheme } from '@mui/material/styles';
7
7
 
8
8
  import { mergeProps } from '../Util';
9
9
  import colors from '../Colors';