@arcblock/ux 2.4.1 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/lib/ActivityIndicator/index.js +4 -6
  2. package/lib/Alert/index.js +3 -4
  3. package/lib/AnimationWaiter/index.js +3 -4
  4. package/lib/Badge/index.js +3 -3
  5. package/lib/Blocklet/blocklet.js +4 -6
  6. package/lib/Blocklet/utils.js +2 -5
  7. package/lib/BlockletNFT/index.js +4 -6
  8. package/lib/Center/index.js +3 -4
  9. package/lib/ClickToCopy/index.js +3 -3
  10. package/lib/CodeBlock/index.js +3 -4
  11. package/lib/ContactForm/index.js +3 -3
  12. package/lib/CookieConsent/index.js +3 -4
  13. package/lib/CountDown/index.js +3 -4
  14. package/lib/Datatable/CustomToolbar.js +5 -9
  15. package/lib/Datatable/TableSearch.js +3 -4
  16. package/lib/Datatable/index.js +5 -7
  17. package/lib/Dialog/dialog.js +5 -9
  18. package/lib/Earth/index.js +4 -6
  19. package/lib/Empty/index.js +3 -3
  20. package/lib/ErrorBoundary/fallback.js +4 -7
  21. package/lib/Footer/index.js +3 -4
  22. package/lib/Header/auto-hidden.js +3 -3
  23. package/lib/Header/header.js +4 -8
  24. package/lib/Header/responsive-header.js +5 -7
  25. package/lib/Icon/image.js +3 -4
  26. package/lib/Icon/index.js +3 -4
  27. package/lib/Img/index.js +3 -3
  28. package/lib/InfoRow/index.js +3 -5
  29. package/lib/Layout/dashboard/index.js +5 -9
  30. package/lib/Layout/dashboard/sidebar.js +3 -5
  31. package/lib/Layout/dashboard-legacy/header.js +3 -3
  32. package/lib/Layout/dashboard-legacy/index.js +3 -3
  33. package/lib/Layout/dashboard-legacy/sidebar.js +5 -7
  34. package/lib/Layout/index.js +4 -6
  35. package/lib/Locale/selector.js +4 -7
  36. package/lib/Logo/index.js +2 -3
  37. package/lib/Metric/index.js +3 -4
  38. package/lib/NFTDisplay/aspect-ratio-container.js +2 -4
  39. package/lib/NFTDisplay/broken.js +3 -3
  40. package/lib/NFTDisplay/index.js +3 -4
  41. package/lib/NFTDisplay/loading.js +2 -4
  42. package/lib/NFTDisplay/svg-embedder/inline-svg.js +4 -6
  43. package/lib/NavMenu/style.js +4 -7
  44. package/lib/PricingTable/PricingPlan.js +3 -3
  45. package/lib/PricingTable/index.js +3 -4
  46. package/lib/Result/common.js +4 -4
  47. package/lib/Result/result.js +3 -5
  48. package/lib/Screenshot/BaseScreenshot/index.js +84 -0
  49. package/lib/Screenshot/BaseScreenshot/shells/Phone.js +57 -0
  50. package/lib/Screenshot/index.js +123 -10
  51. package/lib/SplitButton/index.js +4 -4
  52. package/lib/Switch/index.js +3 -3
  53. package/lib/Tabs/index.js +3 -3
  54. package/lib/Tag/index.js +4 -6
  55. package/lib/TextCollapse/index.js +2 -2
  56. package/lib/Theme/index.js +16 -0
  57. package/lib/Theme/theme-provider.js +3 -8
  58. package/lib/Theme/theme.js +4 -2
  59. package/lib/Video/index.js +3 -4
  60. package/lib/Wallet/Action.js +3 -4
  61. package/lib/Wallet/Download.js +3 -4
  62. package/lib/Wallet/Open.js +3 -3
  63. package/lib/WechatPrompt/index.js +3 -3
  64. package/lib/withTheme/index.js +18 -40
  65. package/package.json +4 -4
  66. package/src/ActivityIndicator/index.js +3 -3
  67. package/src/Alert/index.js +2 -2
  68. package/src/AnimationWaiter/index.js +3 -2
  69. package/src/Badge/index.js +1 -2
  70. package/src/Blocklet/blocklet.js +2 -3
  71. package/src/Blocklet/utils.js +2 -2
  72. package/src/BlockletNFT/index.js +2 -3
  73. package/src/Center/index.js +3 -2
  74. package/src/ClickToCopy/index.js +2 -1
  75. package/src/CodeBlock/index.js +2 -2
  76. package/src/ContactForm/index.js +2 -3
  77. package/src/CookieConsent/index.js +3 -2
  78. package/src/CountDown/index.js +2 -2
  79. package/src/Datatable/CustomToolbar.js +3 -4
  80. package/src/Datatable/TableSearch.js +2 -2
  81. package/src/Datatable/index.js +4 -4
  82. package/src/Dialog/dialog.js +3 -3
  83. package/src/Earth/index.js +3 -3
  84. package/src/Empty/index.js +3 -2
  85. package/src/ErrorBoundary/fallback.js +2 -3
  86. package/src/Footer/index.js +2 -2
  87. package/src/Header/auto-hidden.js +2 -1
  88. package/src/Header/header.js +2 -3
  89. package/src/Header/responsive-header.js +1 -2
  90. package/src/Icon/image.js +2 -2
  91. package/src/Icon/index.js +2 -2
  92. package/src/Img/index.js +1 -1
  93. package/src/InfoRow/index.js +3 -2
  94. package/src/Layout/dashboard/index.js +2 -3
  95. package/src/Layout/dashboard/sidebar.js +3 -3
  96. package/src/Layout/dashboard-legacy/header.js +1 -1
  97. package/src/Layout/dashboard-legacy/index.js +2 -2
  98. package/src/Layout/dashboard-legacy/sidebar.js +2 -4
  99. package/src/Layout/index.js +3 -3
  100. package/src/Locale/selector.js +2 -4
  101. package/src/Logo/index.js +3 -2
  102. package/src/Metric/index.js +2 -2
  103. package/src/NFTDisplay/aspect-ratio-container.js +3 -2
  104. package/src/NFTDisplay/broken.js +2 -1
  105. package/src/NFTDisplay/index.js +3 -2
  106. package/src/NFTDisplay/loading.js +2 -2
  107. package/src/NFTDisplay/svg-embedder/inline-svg.js +3 -2
  108. package/src/NavMenu/style.js +2 -2
  109. package/src/PricingTable/PricingPlan.js +2 -2
  110. package/src/PricingTable/index.js +2 -2
  111. package/src/Result/common.js +1 -1
  112. package/src/Result/result.js +3 -2
  113. package/src/Screenshot/BaseScreenshot/index.jsx +77 -0
  114. package/src/Screenshot/BaseScreenshot/shells/Phone.jsx +33 -0
  115. package/src/Screenshot/index.js +99 -7
  116. package/src/SplitButton/index.js +2 -1
  117. package/src/Switch/index.js +1 -1
  118. package/src/Tabs/index.js +1 -1
  119. package/src/Tag/index.js +1 -3
  120. package/src/TextCollapse/index.js +2 -2
  121. package/src/Theme/index.js +1 -0
  122. package/src/Theme/theme-provider.js +4 -7
  123. package/src/Theme/theme.js +5 -3
  124. package/src/Video/index.js +2 -3
  125. package/src/Wallet/Action.js +2 -3
  126. package/src/Wallet/Download.js +2 -3
  127. package/src/Wallet/Open.js +2 -1
  128. package/src/WechatPrompt/index.js +2 -3
  129. package/src/withTheme/index.js +41 -54
@@ -7,12 +7,12 @@ exports.default = void 0;
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _styles = require("@mui/material/styles");
11
-
12
10
  var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
13
11
 
14
12
  var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
15
13
 
14
+ var _Theme = require("../Theme");
15
+
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
18
  const _excluded = ["labelProps"];
@@ -30,7 +30,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
30
30
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
31
 
32
32
  // 参考: https://mui.com/material-ui/react-switch/#customization
33
- const IOSSwitch = (0, _styles.styled)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, _objectSpread({
33
+ const IOSSwitch = (0, _Theme.styled)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, _objectSpread({
34
34
  focusVisibleClassName: ".Mui-focusVisible",
35
35
  disableRipple: true
36
36
  }, props)))(_ref => {
package/lib/Tabs/index.js CHANGED
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = Tabs;
7
7
 
8
- var _styles = require("@mui/material/styles");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
9
 
12
10
  var _Tabs = _interopRequireDefault(require("@mui/material/Tabs"));
13
11
 
14
12
  var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
15
13
 
14
+ var _Theme = require("../Theme");
15
+
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
18
  const _excluded = ["tabs", "current", "onChange"];
@@ -34,7 +34,7 @@ const classes = {
34
34
  tabs: "".concat(PREFIX, "-tabs"),
35
35
  tab: "".concat(PREFIX, "-tab")
36
36
  };
37
- const StyledMuiTabs = (0, _styles.styled)(_Tabs.default)(_ref => {
37
+ const StyledMuiTabs = (0, _Theme.styled)(_Tabs.default)(_ref => {
38
38
  let {
39
39
  theme
40
40
  } = _ref;
package/lib/Tag/index.js CHANGED
@@ -9,16 +9,14 @@ var _react = require("react");
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _styled = _interopRequireDefault(require("@emotion/styled"));
13
-
14
12
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
13
 
16
- var _styles = require("@mui/material/styles");
17
-
18
14
  var _Util = require("../Util");
19
15
 
20
16
  var _Colors = _interopRequireDefault(require("../Colors"));
21
17
 
18
+ var _Theme = require("../Theme");
19
+
22
20
  var _jsxRuntime = require("react/jsx-runtime");
23
21
 
24
22
  var _templateObject;
@@ -77,7 +75,7 @@ function Tag(props) {
77
75
 
78
76
  const {
79
77
  palette
80
- } = (0, _styles.useTheme)();
78
+ } = (0, _Theme.useTheme)();
81
79
  const styles = Object.assign({}, types[type] || types.primary, style);
82
80
 
83
81
  if (palette[type]) {
@@ -116,4 +114,4 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/
116
114
  })));
117
115
 
118
116
  exports.default = _default;
119
- const Span = (0, _styled.default)(_Typography.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 10px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n font-weight: 500;\n border-radius: 4px;\n }\n"])));
117
+ const Span = (0, _Theme.styled)(_Typography.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 10px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n font-weight: 500;\n border-radius: 4px;\n }\n"])));
@@ -9,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
10
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
11
11
 
12
- var _styled = _interopRequireDefault(require("@emotion/styled"));
12
+ var _Theme = require("../Theme");
13
13
 
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
 
@@ -92,4 +92,4 @@ TextCollapse.defaultProps = {
92
92
  scaleFactor: 0.45,
93
93
  fontType: 'normal'
94
94
  };
95
- const Container = (0, _styled.default)(_Typography.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n\n .start-part,\n .end-part {\n display: inline-block;\n vertical-align: bottom;\n white-space: nowrap;\n overflow: hidden;\n }\n .start-part {\n max-width: calc(100% - ", ");\n min-width: ", ";\n text-overflow: ellipsis;\n }\n .end-part {\n max-width: calc(100% - ", ");\n direction: rtl;\n }\n"])), props => props.endwidth, props => props.startwidth, props => props.startwidth);
95
+ const Container = (0, _Theme.styled)(_Typography.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n\n .start-part,\n .end-part {\n display: inline-block;\n vertical-align: bottom;\n white-space: nowrap;\n overflow: hidden;\n }\n .start-part {\n max-width: calc(100% - ", ");\n min-width: ", ";\n text-overflow: ellipsis;\n }\n .end-part {\n max-width: calc(100% - ", ");\n direction: rtl;\n }\n"])), props => props.endwidth, props => props.startwidth, props => props.startwidth);
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
+ styled: true,
8
+ useTheme: true,
7
9
  ThemeProvider: true
8
10
  };
9
11
  Object.defineProperty(exports, "ThemeProvider", {
@@ -12,6 +14,18 @@ Object.defineProperty(exports, "ThemeProvider", {
12
14
  return _themeProvider.default;
13
15
  }
14
16
  });
17
+ Object.defineProperty(exports, "styled", {
18
+ enumerable: true,
19
+ get: function get() {
20
+ return _styles.styled;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "useTheme", {
24
+ enumerable: true,
25
+ get: function get() {
26
+ return _styles.useTheme;
27
+ }
28
+ });
15
29
 
16
30
  var _theme = require("./theme");
17
31
 
@@ -27,6 +41,8 @@ Object.keys(_theme).forEach(function (key) {
27
41
  });
28
42
  });
29
43
 
44
+ var _styles = require("@mui/material/styles");
45
+
30
46
  var _themeProvider = _interopRequireDefault(require("./theme-provider"));
31
47
 
32
48
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -7,8 +7,6 @@ exports.default = ThemeProvider;
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _react = require("@emotion/react");
11
-
12
10
  var _styles = require("@mui/material/styles");
13
11
 
14
12
  var _StyledEngineProvider = _interopRequireDefault(require("@mui/material/StyledEngineProvider"));
@@ -21,7 +19,7 @@ var _jsxRuntime = require("react/jsx-runtime");
21
19
 
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
21
 
24
- const defaultTheme = (0, _theme.create)();
22
+ const defaultTheme = (0, _theme.createTheme)();
25
23
  /**
26
24
  * 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
27
25
  */
@@ -37,12 +35,9 @@ function ThemeProvider(_ref) {
37
35
  // injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
38
36
  (0, _jsxRuntime.jsx)(_StyledEngineProvider.default, {
39
37
  injectFirst: injectFirst,
40
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ThemeProvider, {
38
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
41
39
  theme: theme,
42
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.ThemeProvider, {
43
- theme: theme,
44
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), children]
45
- })
40
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), children]
46
41
  })
47
42
  })
48
43
  );
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.create = void 0;
6
+ exports.createTheme = exports.create = void 0;
7
7
 
8
8
  var _styles = require("@mui/material/styles");
9
9
 
@@ -154,4 +154,6 @@ const create = function create() {
154
154
  return enhanced;
155
155
  };
156
156
 
157
- exports.create = create;
157
+ exports.create = create;
158
+ const createTheme = create;
159
+ exports.createTheme = createTheme;
@@ -11,12 +11,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _reactPlayer = _interopRequireDefault(require("react-player"));
13
13
 
14
- var _styled = _interopRequireDefault(require("@emotion/styled"));
15
-
16
14
  var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
17
15
 
18
16
  var _Util = require("../Util");
19
17
 
18
+ var _Theme = require("../Theme");
19
+
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  var _templateObject;
@@ -102,5 +102,4 @@ Video.defaultProps = {
102
102
  height: 400,
103
103
  style: {}
104
104
  };
105
-
106
- const Placeholder = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: #222222;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n\n .loading-indicator {\n position: absolute;\n top: 45%;\n left: 47%;\n z-index: 2;\n }\n"])));
105
+ const Placeholder = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: #222222;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n\n .loading-indicator {\n position: absolute;\n top: 45%;\n left: 47%;\n z-index: 2;\n }\n"])));
@@ -7,8 +7,6 @@ exports.default = WalletAction;
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _styled = _interopRequireDefault(require("@emotion/styled"));
11
-
12
10
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
11
 
14
12
  var _abtwallet = _interopRequireDefault(require("./images/abtwallet.png"));
@@ -19,6 +17,8 @@ var _Colors = _interopRequireDefault(require("../Colors"));
19
17
 
20
18
  var _Button = _interopRequireDefault(require("../Button"));
21
19
 
20
+ var _Theme = require("../Theme");
21
+
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  var _templateObject;
@@ -112,5 +112,4 @@ const sizes = {
112
112
  xlarge: 18
113
113
  }
114
114
  };
115
-
116
- const Content = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n &:hover {\n opacity: 0.9;\n }\n\n .wallet-action__logo {\n width: auto;\n height: auto;\n max-width: ", "px;\n margin-left: 5px;\n }\n\n .wallet-action__text {\n padding: 8px;\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n\n .wallet-action__action {\n font-size: ", "px;\n text-transform: capitalize;\n margin-bottom: 1px;\n color: ", ";\n letter-spacing: 1px;\n }\n\n .wallet-action__title {\n font-size: ", "px;\n text-transform: capitalize;\n color: ", ";\n letter-spacing: 1px;\n }\n"])), props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color || _Colors.default.primary.main, props => sizes.font[props.size] * 1.5, props => props.color || _Colors.default.primary.main);
115
+ const Content = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n &:hover {\n opacity: 0.9;\n }\n\n .wallet-action__logo {\n width: auto;\n height: auto;\n max-width: ", "px;\n margin-left: 5px;\n }\n\n .wallet-action__text {\n padding: 8px;\n display: flex;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n\n .wallet-action__action {\n font-size: ", "px;\n text-transform: capitalize;\n margin-bottom: 1px;\n color: ", ";\n letter-spacing: 1px;\n }\n\n .wallet-action__title {\n font-size: ", "px;\n text-transform: capitalize;\n color: ", ";\n letter-spacing: 1px;\n }\n"])), props => sizes.logo[props.size], props => sizes.font[props.size], props => props.color || _Colors.default.primary.main, props => sizes.font[props.size] * 1.5, props => props.color || _Colors.default.primary.main);
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _styled = _interopRequireDefault(require("@emotion/styled"));
13
-
14
12
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
15
13
 
16
14
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
@@ -19,6 +17,8 @@ var _Button = _interopRequireDefault(require("../Button"));
19
17
 
20
18
  var _Util = require("../Util");
21
19
 
20
+ var _Theme = require("../Theme");
21
+
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  var _templateObject;
@@ -336,5 +336,4 @@ WalletDownload.defaultProps = {
336
336
  style: {},
337
337
  locale: 'zh'
338
338
  };
339
-
340
- const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n\n .download-title {\n margin-right: ", ";\n margin-bottom: ", ";\n }\n\n .download-store-list {\n display: flex;\n flex-direction: ", ";\n justify-content: space-between;\n align-items: center;\n\n .download-link {\n padding: 0;\n margin: 0;\n\n margin-right: ", ";\n margin-bottom: ", ";\n\n &:last-of-type {\n margin-right: 0;\n margin-bottom: 0;\n }\n }\n }\n"])), props => props.layout === 'vertical' ? 'column' : 'row', props => props.layout === 'vertical' ? '0' : '16px', props => props.layout === 'vertical' ? '16px' : '0', props => props.storeLayout === 'vertical' ? 'column' : 'row', props => props.storeLayout === 'vertical' ? '0' : '16px', props => props.storeLayout === 'vertical' ? '16px' : '0');
339
+ const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n\n .download-title {\n margin-right: ", ";\n margin-bottom: ", ";\n }\n\n .download-store-list {\n display: flex;\n flex-direction: ", ";\n justify-content: space-between;\n align-items: center;\n\n .download-link {\n padding: 0;\n margin: 0;\n\n margin-right: ", ";\n margin-bottom: ", ";\n\n &:last-of-type {\n margin-right: 0;\n margin-bottom: 0;\n }\n }\n }\n"])), props => props.layout === 'vertical' ? 'column' : 'row', props => props.layout === 'vertical' ? '0' : '16px', props => props.layout === 'vertical' ? '16px' : '0', props => props.storeLayout === 'vertical' ? 'column' : 'row', props => props.storeLayout === 'vertical' ? '0' : '16px', props => props.storeLayout === 'vertical' ? '16px' : '0');
@@ -7,12 +7,12 @@ exports.default = OpenInWallet;
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _styled = _interopRequireDefault(require("@emotion/styled"));
11
-
12
10
  var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
13
11
 
14
12
  var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
15
13
 
14
+ var _Theme = require("../Theme");
15
+
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
18
  var _templateObject;
@@ -53,4 +53,4 @@ OpenInWallet.propTypes = {
53
53
  OpenInWallet.defaultProps = {
54
54
  locale: 'zh'
55
55
  };
56
- const Button = (0, _styled.default)(_Fab.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n font-size: 12px;\n position: fixed;\n bottom: 24px;\n left: 50%;\n transform-origin: 50% 50%;\n transform: translateX(-50%);\n min-width: 120px;\n z-index: ", ";\n }\n"])), props => props.theme.zIndex.tooltip);
56
+ const Button = (0, _Theme.styled)(_Fab.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n font-size: 12px;\n position: fixed;\n bottom: 24px;\n left: 50%;\n transform-origin: 50% 50%;\n transform: translateX(-50%);\n min-width: 120px;\n z-index: ", ";\n }\n"])), props => props.theme.zIndex.tooltip);
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = WechatPrompt;
7
7
 
8
- var _styled = _interopRequireDefault(require("@emotion/styled"));
9
-
10
8
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
11
9
 
12
10
  var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
@@ -17,6 +15,8 @@ var _ios = _interopRequireDefault(require("./images/ios.png"));
17
15
 
18
16
  var _android = _interopRequireDefault(require("./images/android.png"));
19
17
 
18
+ var _Theme = require("../Theme");
19
+
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  var _templateObject;
@@ -81,4 +81,4 @@ function WechatPrompt() {
81
81
  });
82
82
  }
83
83
 
84
- const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .wechat-title {\n height: 80px;\n line-height: 80px;\n text-align: center;\n font-size: 20px;\n color: #fff;\n background-color: #9cdbd8;\n }\n\n .wechat-tip {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .wechat-tip-text {\n font-size: 20px;\n padding: 10px 10px;\n overflow: auto;\n word-break: break-word;\n text-align: center;\n }\n\n .wechat-tip-img {\n width: 90%;\n object-fit: cover;\n }\n }\n"])));
84
+ const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .wechat-title {\n height: 80px;\n line-height: 80px;\n text-align: center;\n font-size: 20px;\n color: #fff;\n background-color: #9cdbd8;\n }\n\n .wechat-tip {\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .wechat-tip-text {\n font-size: 20px;\n padding: 10px 10px;\n overflow: auto;\n word-break: break-word;\n text-align: center;\n }\n\n .wechat-tip-img {\n width: 90%;\n object-fit: cover;\n }\n }\n"])));
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var React = _interopRequireWildcard(require("react"));
8
+ var _react = require("react");
9
9
 
10
10
  var _react2 = require("@emotion/react");
11
11
 
12
- var _styles = require("@mui/material/styles");
13
-
14
12
  var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
15
13
 
16
14
  var _Theme = require("../Theme");
@@ -21,10 +19,6 @@ var _templateObject;
21
19
 
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
21
 
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
-
26
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
28
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
23
 
30
24
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -33,8 +27,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
33
27
 
34
28
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
35
29
 
36
- const globalStyles = (0, _react2.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n color: ", ";\n\n a,\n a:hover,\n a:active {\n text-decoration: none;\n color: ", ";\n }\n\n a:hover {\n color: ", ";\n }\n\n .section--latest-post {\n p:last-of-type {\n margin: 0;\n }\n }\n\n .has-scrolled {\n .section--footnotes {\n position: static !important;\n transition-property: background-color;\n transition-duration: 600ms;\n transition-timing-function: ease;\n .footnote__title {\n color: #fff;\n }\n }\n }\n"])), props => props.theme.typography.fontFamily, props => props.theme.typography.color.main, props => props.theme.palette.primary.dark, props => props.theme.palette.primary.main);
37
-
38
30
  function withTheme(Component) {
39
31
  let {
40
32
  mode = 'light',
@@ -42,42 +34,28 @@ function withTheme(Component) {
42
34
  palette,
43
35
  typography
44
36
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45
-
46
- class WithTheme extends React.Component {
47
- constructor(props) {
48
- super(props);
49
- this.theme = (0, _Theme.create)({
50
- mode,
51
- pageWidth,
52
- palette,
53
- typography
54
- });
55
- }
56
-
57
- componentDidMount() {
58
- // Remove the server-side injected CSS.
37
+ const theme = (0, _Theme.createTheme)({
38
+ mode,
39
+ pageWidth,
40
+ palette,
41
+ typography
42
+ });
43
+ const globalStyles = (0, _react2.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n color: ", ";\n\n a,\n a:hover,\n a:active {\n text-decoration: none;\n color: ", ";\n }\n\n a:hover {\n color: ", ";\n }\n\n .section--latest-post {\n p:last-of-type {\n margin: 0;\n }\n }\n\n .has-scrolled {\n .section--footnotes {\n position: static !important;\n transition-property: background-color;\n transition-duration: 600ms;\n transition-timing-function: ease;\n .footnote__title {\n color: #fff;\n }\n }\n }\n "])), theme.typography.fontFamily, theme.typography.color.main, theme.palette.primary.dark, theme.palette.primary.main);
44
+ return function WithTheme(props) {
45
+ (0, _react.useEffect)(() => {
59
46
  const jssStyles = document.querySelector('#jss-server-side');
60
47
 
61
48
  if (jssStyles && jssStyles.parentNode) {
62
49
  jssStyles.parentNode.removeChild(jssStyles);
63
50
  }
64
- }
65
-
66
- render() {
67
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
68
- theme: this.theme,
69
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Global, {
70
- styles: globalStyles
71
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.ThemeProvider, {
72
- theme: this.theme,
73
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, this.props))
74
- })]
75
- });
76
- }
77
-
78
- }
79
-
80
- return WithTheme;
51
+ }, []);
52
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Theme.ThemeProvider, {
53
+ theme: theme,
54
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Global, {
55
+ styles: globalStyles
56
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props))]
57
+ });
58
+ };
81
59
  }
82
60
 
83
61
  var _default = withTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.4.1",
3
+ "version": "2.4.4",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -47,10 +47,10 @@
47
47
  "react": ">=18.1.0",
48
48
  "react-ga": "^2.7.0"
49
49
  },
50
- "gitHead": "f9811866bb818ee7eac47a5173346e24931c2b32",
50
+ "gitHead": "655d38787fa04e77a719601a46b93d49cde243e4",
51
51
  "dependencies": {
52
- "@arcblock/icons": "^2.4.1",
53
- "@arcblock/react-hooks": "^2.4.1",
52
+ "@arcblock/icons": "^2.4.4",
53
+ "@arcblock/react-hooks": "^2.4.4",
54
54
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
55
  "@emotion/react": "^11.10.0",
56
56
  "@emotion/styled": "^11.10.0",
@@ -1,10 +1,10 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
3
  import { green, blue } from '@mui/material/colors';
5
4
 
6
5
  import Logo from '../Logo';
7
6
  import colors from '../Colors';
7
+ import { styled } from '../Theme';
8
8
 
9
9
  /**
10
10
  * ActivityIndicator is used when we want to tell the user the request they made on the UI will take time.
@@ -49,7 +49,7 @@ ActivityIndicator.defaultProps = {
49
49
  messages: ['Loading data...'],
50
50
  };
51
51
 
52
- const Div = styled.div`
52
+ const Div = styled('div')`
53
53
  && {
54
54
  box-sizing: border-box;
55
55
  padding: 20px;
@@ -112,7 +112,7 @@ Orbit.defaultProps = {
112
112
  duration: 2,
113
113
  };
114
114
 
115
- const OrbitRoot = styled.div`
115
+ const OrbitRoot = styled('div')`
116
116
  @keyframes orbit {
117
117
  0% {
118
118
  transform: rotate(0deg);
@@ -1,11 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
2
  import Typography from '@mui/material/Typography';
4
3
  import { blueGrey } from '@mui/material/colors';
5
4
 
6
5
  import Icon from '../Icon';
7
6
  import { mergeProps } from '../Util';
8
7
  import colors from '../Colors';
8
+ import { styled } from '../Theme';
9
9
 
10
10
  const types = {
11
11
  error: {
@@ -74,7 +74,7 @@ Alert.defaultProps = {
74
74
 
75
75
  export default Alert;
76
76
 
77
- const Container = styled.div`
77
+ const Container = styled('div')`
78
78
  display: flex;
79
79
  align-items: center;
80
80
  font-size: 16px;
@@ -1,8 +1,9 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
- import styled from '@emotion/styled';
3
2
  import PropTypes from 'prop-types';
4
3
  import Lottie from 'react-lottie-player';
4
+
5
5
  import lottieJson from './default-animation.json';
6
+ import { styled } from '../Theme';
6
7
 
7
8
  /**
8
9
  * 用于长时间等待的用的动画组件
@@ -191,7 +192,7 @@ AnimationWaiter.defaultProps = {
191
192
  increaseSpeed: 0,
192
193
  };
193
194
 
194
- const Container = styled.div`
195
+ const Container = styled('div')`
195
196
  display: flex;
196
197
  justify-content: center;
197
198
  align-items: center;
@@ -1,11 +1,10 @@
1
1
  import { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styled from '@emotion/styled';
4
-
5
3
  import Typography from '@mui/material/Typography';
6
4
 
7
5
  import colors from '../Colors';
8
6
  import { mergeProps } from '../Util';
7
+ import { styled } from '../Theme';
9
8
 
10
9
  const types = {
11
10
  error: {
@@ -1,15 +1,14 @@
1
- import styled from '@emotion/styled';
2
1
  import PropTypes from 'prop-types';
3
2
  import Typography from '@mui/material/Typography';
4
3
  import CircularProgress from '@mui/material/CircularProgress';
5
4
  import Avatar from '@arcblock/did-connect/lib/Avatar';
6
- import { useTheme } from '@mui/material/styles';
7
5
  import useMediaQuery from '@mui/material/useMediaQuery';
8
6
 
9
7
  import Button from '../Button';
10
8
  import Img from '../Img';
9
+ import { useTheme, styled } from '../Theme';
11
10
 
12
- const Div = styled.div`
11
+ const Div = styled('div')`
13
12
  &.arcblock-blocklet {
14
13
  padding: ${(props) => props.theme.spacing(2)} ${(props) => props.theme.spacing(2)} 0
15
14
  ${(props) => props.theme.spacing(2)};
@@ -1,6 +1,6 @@
1
- import styled from '@emotion/styled';
1
+ import { styled } from '../Theme';
2
2
 
3
- const ActionButton = styled.div`
3
+ const ActionButton = styled('div')`
4
4
  background-color: transparent !important;
5
5
  & > :not(.Mui-disabled) {
6
6
  position: relative;
@@ -1,16 +1,15 @@
1
1
  import { useRef } from 'react';
2
- import styled from '@emotion/styled';
3
2
  import PropTypes from 'prop-types';
4
3
  import Portal from '@mui/material/Portal';
5
4
  import Typography from '@mui/material/Typography';
6
5
  import CircularProgress from '@mui/material/CircularProgress';
7
6
  import useMediaQuery from '@mui/material/useMediaQuery';
8
- import { useTheme } from '@mui/material/styles';
9
7
  import Avatar from '@arcblock/did-connect/lib/Avatar';
10
8
 
11
9
  import Icon from '../Icon';
12
10
  import Button from '../Button';
13
11
  import Img from '../Img';
12
+ import { useTheme, styled } from '../Theme';
14
13
 
15
14
  /**
16
15
  * 美化数字 1000-->1k
@@ -29,7 +28,7 @@ function prettySize(_size, digits = 1) {
29
28
  return _size && `${size}${list[index]}`;
30
29
  }
31
30
 
32
- const Div = styled.div`
31
+ const Div = styled('div')`
33
32
  &.arcblock-blocklet {
34
33
  padding: 0 16px;
35
34
  background: ${(props) => props.theme.palette.common.white};
@@ -1,6 +1,7 @@
1
- import styled from '@emotion/styled';
2
1
  import PropTypes from 'prop-types';
3
2
 
3
+ import { styled } from '../Theme';
4
+
4
5
  /**
5
6
  *
6
7
  * @param {string} relative 容器相对尺寸,默认相对屏幕(screen),可设置为父容器(parent)
@@ -19,7 +20,7 @@ export default function Center({ children, relative }) {
19
20
  return <Div style={style}>{children}</Div>;
20
21
  }
21
22
 
22
- const Div = styled.div`
23
+ const Div = styled('div')`
23
24
  flex: 1;
24
25
  width: 100vw;
25
26
  height: 100vh;
@@ -2,10 +2,11 @@ import PropTypes from 'prop-types';
2
2
  import useWindowSize from 'react-use/lib/useWindowSize';
3
3
  import Tooltip from '@mui/material/Tooltip';
4
4
  import Typography from '@mui/material/Typography';
5
- import styled from '@emotion/styled';
5
+
6
6
  import useCopy from './hook';
7
7
  import Toast, { ToastProvider } from '../Toast';
8
8
  import { mergeProps } from '../Util';
9
+ import { styled } from '../Theme';
9
10
 
10
11
  export { default as CopyButton } from './copy-button';
11
12
 
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  import { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import styled from '@emotion/styled';
5
4
  import Copy from 'copy-to-clipboard';
6
5
  import Button from '@mui/material/IconButton';
7
6
  import useMountedState from 'react-use/lib/useMountedState';
@@ -27,6 +26,7 @@ import 'highlight.js/styles/atom-one-dark.css';
27
26
  import CopyIcon from '@mui/icons-material/FileCopy';
28
27
  import CheckIcon from '@mui/icons-material/Check';
29
28
  import colors from '../Colors';
29
+ import { styled } from '../Theme';
30
30
 
31
31
  hljs.registerLanguage('javascript', javascript);
32
32
  hljs.registerLanguage('js', javascript);
@@ -100,7 +100,7 @@ CodeBlock.defaultProps = {
100
100
  };
101
101
 
102
102
  const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important';
103
- const Pre = styled.pre`
103
+ const Pre = styled('pre')`
104
104
  font-family: ${fontFamily};
105
105
  display: block;
106
106
  font-size: 14px;