@arcblock/ux 2.3.0 → 2.4.2

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 (115) hide show
  1. package/lib/ActivityIndicator/index.js +7 -9
  2. package/lib/Alert/index.js +6 -5
  3. package/lib/AnimationWaiter/index.js +6 -5
  4. package/lib/Badge/index.js +6 -5
  5. package/lib/Blocklet/blocklet.js +6 -5
  6. package/lib/Blocklet/utils.js +6 -5
  7. package/lib/BlockletNFT/index.js +6 -5
  8. package/lib/Center/index.js +6 -5
  9. package/lib/ClickToCopy/index.js +6 -5
  10. package/lib/CodeBlock/index.js +6 -5
  11. package/lib/ContactForm/index.js +6 -5
  12. package/lib/CookieConsent/index.js +6 -5
  13. package/lib/CountDown/index.js +6 -5
  14. package/lib/Datatable/CustomToolbar.js +7 -9
  15. package/lib/Datatable/DatatableContext.js +2 -2
  16. package/lib/Datatable/TableSearch.js +6 -5
  17. package/lib/Datatable/index.js +12 -15
  18. package/lib/Dialog/dialog.js +8 -10
  19. package/lib/Earth/index.js +7 -9
  20. package/lib/Empty/index.js +6 -5
  21. package/lib/ErrorBoundary/fallback.js +6 -5
  22. package/lib/Footer/index.js +6 -6
  23. package/lib/Header/auto-hidden.js +6 -5
  24. package/lib/Header/header.js +6 -5
  25. package/lib/Header/responsive-header.js +7 -9
  26. package/lib/Icon/image.js +6 -5
  27. package/lib/Icon/index.js +6 -5
  28. package/lib/InfoRow/index.js +6 -5
  29. package/lib/Layout/dashboard/index.js +7 -9
  30. package/lib/Layout/dashboard/sidebar.js +6 -5
  31. package/lib/Layout/dashboard-legacy/header.js +6 -5
  32. package/lib/Layout/dashboard-legacy/index.js +6 -5
  33. package/lib/Layout/dashboard-legacy/sidebar.js +7 -9
  34. package/lib/Layout/index.js +7 -9
  35. package/lib/Locale/selector.js +6 -5
  36. package/lib/Logo/index.js +6 -5
  37. package/lib/Metric/index.js +6 -6
  38. package/lib/NFTDisplay/aspect-ratio-container.js +6 -5
  39. package/lib/NFTDisplay/broken.js +6 -5
  40. package/lib/NFTDisplay/index.js +6 -5
  41. package/lib/NFTDisplay/loading.js +6 -5
  42. package/lib/NFTDisplay/svg-embedder/inline-svg.js +9 -11
  43. package/lib/NavMenu/style.js +8 -13
  44. package/lib/PricingTable/PricingPlan.js +6 -5
  45. package/lib/PricingTable/index.js +6 -5
  46. package/lib/Result/result.js +6 -5
  47. package/lib/Screenshot/index.js +6 -5
  48. package/lib/SplitButton/index.js +7 -9
  49. package/lib/Tag/index.js +6 -5
  50. package/lib/TextCollapse/index.js +6 -5
  51. package/lib/Theme/theme-provider.js +9 -7
  52. package/lib/Video/index.js +6 -5
  53. package/lib/Wallet/Action.js +6 -5
  54. package/lib/Wallet/Download.js +6 -5
  55. package/lib/Wallet/Open.js +6 -5
  56. package/lib/WechatPrompt/index.js +6 -5
  57. package/lib/withTheme/index.js +9 -5
  58. package/package.json +5 -7
  59. package/src/ActivityIndicator/index.js +1 -1
  60. package/src/Alert/index.js +1 -1
  61. package/src/AnimationWaiter/index.js +1 -1
  62. package/src/Badge/index.js +1 -1
  63. package/src/Blocklet/blocklet.js +1 -1
  64. package/src/Blocklet/utils.js +1 -1
  65. package/src/BlockletNFT/index.js +1 -1
  66. package/src/Center/index.js +1 -1
  67. package/src/ClickToCopy/index.js +1 -1
  68. package/src/CodeBlock/index.js +1 -1
  69. package/src/ContactForm/index.js +1 -1
  70. package/src/CookieConsent/index.js +1 -1
  71. package/src/CountDown/index.js +1 -1
  72. package/src/Datatable/CustomToolbar.js +1 -1
  73. package/src/Datatable/DatatableContext.js +2 -2
  74. package/src/Datatable/TableSearch.js +1 -1
  75. package/src/Datatable/index.js +5 -4
  76. package/src/Dialog/dialog.js +1 -1
  77. package/src/Earth/index.js +1 -1
  78. package/src/Empty/index.js +1 -1
  79. package/src/ErrorBoundary/fallback.js +1 -1
  80. package/src/Footer/index.js +1 -1
  81. package/src/Header/auto-hidden.js +1 -1
  82. package/src/Header/header.js +1 -1
  83. package/src/Header/responsive-header.js +1 -1
  84. package/src/Icon/image.js +1 -1
  85. package/src/Icon/index.js +1 -1
  86. package/src/InfoRow/index.js +1 -1
  87. package/src/Layout/dashboard/index.js +1 -1
  88. package/src/Layout/dashboard/sidebar.js +1 -1
  89. package/src/Layout/dashboard-legacy/header.js +1 -1
  90. package/src/Layout/dashboard-legacy/index.js +1 -1
  91. package/src/Layout/dashboard-legacy/sidebar.js +1 -1
  92. package/src/Layout/index.js +1 -1
  93. package/src/Locale/selector.js +1 -1
  94. package/src/Logo/index.js +1 -1
  95. package/src/Metric/index.js +1 -1
  96. package/src/NFTDisplay/aspect-ratio-container.js +1 -1
  97. package/src/NFTDisplay/broken.js +1 -1
  98. package/src/NFTDisplay/index.js +1 -1
  99. package/src/NFTDisplay/loading.js +1 -1
  100. package/src/NFTDisplay/svg-embedder/inline-svg.js +2 -2
  101. package/src/NavMenu/style.js +1 -1
  102. package/src/PricingTable/PricingPlan.js +1 -1
  103. package/src/PricingTable/index.js +1 -1
  104. package/src/Result/result.js +1 -1
  105. package/src/Screenshot/index.js +1 -1
  106. package/src/SplitButton/index.js +1 -1
  107. package/src/Tag/index.js +1 -1
  108. package/src/TextCollapse/index.js +1 -1
  109. package/src/Theme/theme-provider.js +7 -6
  110. package/src/Video/index.js +1 -1
  111. package/src/Wallet/Action.js +1 -1
  112. package/src/Wallet/Download.js +1 -1
  113. package/src/Wallet/Open.js +1 -1
  114. package/src/WechatPrompt/index.js +1 -1
  115. package/src/withTheme/index.js +6 -4
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import MuiDialog from '@mui/material/Dialog';
4
4
  import MuiDialogContent from '@mui/material/DialogContent';
5
5
  import DialogActions from '@mui/material/DialogActions';
@@ -2,7 +2,7 @@
2
2
  import { useReducer, useRef, useEffect } from 'react';
3
3
  import useSpring from 'react-use/lib/useSpring';
4
4
  import PropTypes from 'prop-types';
5
- import styled from 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import * as d3 from 'd3-geo';
7
7
  import * as topojson from 'topojson-client';
8
8
  import versor from 'versor';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Icon from '../Icon';
4
4
 
5
5
  const Wrapper = styled.div`
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import { useTheme } from '@mui/material/styles';
4
4
  import { red } from '@mui/material/colors';
5
5
  import Button from '../Button';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-unused-prop-types */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import Typography from '@mui/material/Typography';
5
5
  import MuiContainer from '@mui/material/Container';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
  import Container from '@mui/material/Container';
5
5
  import { useTheme } from '@mui/material/styles';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import MenuIcon from '@mui/icons-material/Menu';
5
5
  import CloseIcon from '@mui/icons-material/Close';
6
6
  import Button from '@mui/material/IconButton';
package/src/Icon/image.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Img from '../Img';
5
5
 
package/src/Icon/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import colors from '../Colors';
6
6
 
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import camelCase from 'lodash/camelCase';
3
3
  import upperFirst from 'lodash/upperFirst';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import Typography from '@mui/material/Typography';
6
6
 
7
7
  function InfoRow({ name, nameFormatter, layout, children, valueComponent, nameWidth, ...rest }) {
@@ -2,7 +2,7 @@ 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 'styled-components';
5
+ import styled from '@emotion/styled';
6
6
  import { useTheme } from '@mui/material/styles';
7
7
  import Container from '@mui/material/Container';
8
8
  import Hidden from '@mui/material/Hidden';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-array-index-key */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
6
  import { teal } from '@mui/material/colors';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Button from '@mui/material/IconButton';
4
4
  import AppBar from '@mui/material/AppBar';
5
5
  import Toolbar from '@mui/material/Toolbar';
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Helmet from 'react-helmet';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import Container from '@mui/material/Container';
6
6
  import Box from '@mui/material/Box';
7
7
  import Drawer from '@mui/material/Drawer';
@@ -1,6 +1,6 @@
1
1
  import { memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import { Link, useLocation } from 'react-router-dom';
6
6
  import { useTheme } from '@mui/material/styles';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import Helmet from 'react-helmet';
5
5
  import Link from '@mui/material/Link';
6
6
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/jsx-no-bind */
2
2
  import { useState, useContext, useRef, useMemo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  import { useTheme } from '@mui/material/styles';
7
7
  import Button from '@mui/material/Button';
package/src/Logo/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import { ReactComponent as LightLogo } from './images/logo-light-top.svg';
5
5
  import { ReactComponent as LightText } from './images/logo-light-text.svg';
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import ImageIcon from '../Icon/image';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  function AspectRatioContainer({ aspect, children, ...rest }) {
5
5
  return (
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
  import BrokenImage from '@mui/icons-material/BrokenImage';
3
3
 
4
4
  export default function Broken() {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react-hooks/rules-of-hooks */
2
2
  import { useRef, useEffect, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
  import clsx from 'clsx';
6
6
  import { Buffer } from 'buffer';
7
7
  import get from 'lodash/get';
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  export default function Loading() {
4
4
  return <Root className="nft-display__loading">loading...</Root>;
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
3
- import root from 'react-shadow/styled-components';
2
+ import styled from '@emotion/styled';
3
+ import root from 'react-shadow/emotion';
4
4
 
5
5
  /**
6
6
  * inline svg 的方式嵌入 svg, 使用 shadow DOM 避免样式污染
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  const NavMenuBase = styled.nav`
4
4
  background-color: ${(props) => props.$bgColor};
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Card from '@mui/material/Card';
5
5
  import Button from '@mui/material/Button';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Grid from '@mui/material/Grid';
4
4
 
5
5
  import PricingPlan from './PricingPlan';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import Box from '@mui/material/Box';
4
4
 
5
5
  function Result({ icon, title, description, extra, ...rest }) {
@@ -1,6 +1,6 @@
1
1
  import { createElement, Children, cloneElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import { mergeProps } from '../Util';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { useState, useRef, isValidElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
  import ExpandMore from '@mui/icons-material/ExpandMore';
5
5
  import Popper from '@mui/material/Popper';
6
6
  import Paper from '@mui/material/Paper';
package/src/Tag/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
3
+ import styled from '@emotion/styled';
4
4
 
5
5
  import Typography from '@mui/material/Typography';
6
6
  import { useTheme } from '@mui/material/styles';
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
 
3
3
  import Typography from '@mui/material/Typography';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  export default function TextCollapse({
7
7
  children,
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import { ThemeProvider as StyledThemeProvider } from 'styled-components';
2
+ import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
3
3
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
4
  import StyledEngineProvider from '@mui/material/StyledEngineProvider';
5
5
  import CssBaseline from '@mui/material/CssBaseline';
@@ -9,17 +9,16 @@ const defaultTheme = create();
9
9
 
10
10
  /**
11
11
  * 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
12
- * 注: 目前 UX 依赖 styled-components, 所以该组件也内置了一个 StyledThemeProvider
13
12
  */
14
- export default function ThemeProvider({ children, theme }) {
13
+ export default function ThemeProvider({ children, theme, injectFirst }) {
15
14
  return (
16
15
  // injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
17
- <StyledEngineProvider injectFirst>
16
+ <StyledEngineProvider injectFirst={injectFirst}>
18
17
  <MuiThemeProvider theme={theme}>
19
- <StyledThemeProvider theme={theme}>
18
+ <EmotionThemeProvider theme={theme}>
20
19
  <CssBaseline />
21
20
  {children}
22
- </StyledThemeProvider>
21
+ </EmotionThemeProvider>
23
22
  </MuiThemeProvider>
24
23
  </StyledEngineProvider>
25
24
  );
@@ -28,9 +27,11 @@ export default function ThemeProvider({ children, theme }) {
28
27
  ThemeProvider.propTypes = {
29
28
  children: PropTypes.any,
30
29
  theme: PropTypes.any,
30
+ injectFirst: PropTypes.bool,
31
31
  };
32
32
 
33
33
  ThemeProvider.defaultProps = {
34
34
  children: null,
35
35
  theme: defaultTheme,
36
+ injectFirst: true,
36
37
  };
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Player from 'react-player';
4
- import styled from 'styled-components';
4
+ import styled from '@emotion/styled';
5
5
 
6
6
  import CircularProgress from '@mui/material/CircularProgress';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Typography from '@mui/material/Typography';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
 
4
4
  import Typography from '@mui/material/Typography';
5
5
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from 'styled-components';
2
+ import styled from '@emotion/styled';
3
3
  import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
4
4
  import Fab from '@mui/material/Fab';
5
5
 
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled from '@emotion/styled';
2
2
 
3
3
  import Typography from '@mui/material/Typography';
4
4
  import Dialog from '@mui/material/Dialog';
@@ -1,15 +1,17 @@
1
1
  import * as React from 'react';
2
- import { ThemeProvider, createGlobalStyle } from 'styled-components';
2
+ import { Global, ThemeProvider, css } from '@emotion/react';
3
3
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
4
  import CssBaseline from '@mui/material/CssBaseline';
5
5
 
6
6
  import { create } from '../Theme';
7
7
 
8
- const GlobalStyle = createGlobalStyle`
8
+ const globalStyles = css`
9
9
  font-family: ${(props) => props.theme.typography.fontFamily};
10
10
  color: ${(props) => props.theme.typography.color.main};
11
11
 
12
- a, a:hover, a:active {
12
+ a,
13
+ a:hover,
14
+ a:active {
13
15
  text-decoration: none;
14
16
  color: ${(props) => props.theme.palette.primary.dark};
15
17
  }
@@ -57,7 +59,7 @@ function withTheme(Component, { mode = 'light', pageWidth = 'md', palette, typog
57
59
  return (
58
60
  <MuiThemeProvider theme={this.theme}>
59
61
  <CssBaseline />
60
- <GlobalStyle theme={this.theme} />
62
+ <Global styles={globalStyles} />
61
63
  <ThemeProvider theme={this.theme}>
62
64
  <Component {...this.props} />
63
65
  </ThemeProvider>