@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
package/src/Wallet/Open.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
|
import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
|
|
5
|
-
import Fab from '@material
|
|
5
|
+
import Fab from '@mui/material/Fab';
|
|
6
6
|
|
|
7
7
|
export default function OpenInWallet({ locale, link }) {
|
|
8
8
|
const buttonText = locale === 'zh' ? '在 ABT 钱包打开' : 'Open in DID Wallet';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import Typography from '@material
|
|
5
|
-
import Dialog from '@material
|
|
4
|
+
import Typography from '@mui/material/Typography';
|
|
5
|
+
import Dialog from '@mui/material/Dialog';
|
|
6
6
|
import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
|
|
7
7
|
|
|
8
8
|
import IosImage from './images/ios.png';
|
package/src/withTheme/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProvider, createGlobalStyle } from 'styled-components';
|
|
3
|
-
import { MuiThemeProvider } from '@material
|
|
4
|
-
import CssBaseline from '@material
|
|
3
|
+
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
5
5
|
|
|
6
6
|
import { create } from '../Theme';
|
|
7
7
|
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = responsiveFontSizes;
|
|
7
|
-
|
|
8
|
-
var _cssUtils = require("@material-ui/core/styles/cssUtils");
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
function responsiveFontSizes(themeInput) {
|
|
17
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
18
|
-
const {
|
|
19
|
-
breakpoints = ['sm', 'md', 'lg'],
|
|
20
|
-
disableAlign = false,
|
|
21
|
-
factor = 3,
|
|
22
|
-
maxSize = 2.5,
|
|
23
|
-
// minSize = 0.8,
|
|
24
|
-
variants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
|
|
25
|
-
} = options;
|
|
26
|
-
|
|
27
|
-
const theme = _objectSpread({}, themeInput);
|
|
28
|
-
|
|
29
|
-
theme.typography = _objectSpread({}, theme.typography);
|
|
30
|
-
const {
|
|
31
|
-
typography
|
|
32
|
-
} = theme; // Convert between css lengths e.g. em->px or px->rem
|
|
33
|
-
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
34
|
-
|
|
35
|
-
const convert = (0, _cssUtils.convertLength)(typography.htmlFontSize);
|
|
36
|
-
const breakpointValues = breakpoints.map(x => theme.breakpoints.values[x]);
|
|
37
|
-
variants.forEach(variant => {
|
|
38
|
-
const style = typography[variant];
|
|
39
|
-
const remFontSize = parseFloat(convert(style.fontSize, 'rem'));
|
|
40
|
-
|
|
41
|
-
if (remFontSize <= 1) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const maxFontSize = Math.min(remFontSize, maxSize);
|
|
46
|
-
const minFontSize = 1 + (maxFontSize - 1) / factor;
|
|
47
|
-
let {
|
|
48
|
-
lineHeight
|
|
49
|
-
} = style;
|
|
50
|
-
|
|
51
|
-
if (!(0, _cssUtils.isUnitless)(lineHeight) && !disableAlign) {
|
|
52
|
-
throw new Error(['Material-UI: unsupported non-unitless line height with grid alignment.', 'Use unitless line heights instead.'].join('\n'));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!(0, _cssUtils.isUnitless)(lineHeight)) {
|
|
56
|
-
// make it unitless
|
|
57
|
-
lineHeight = parseFloat(convert(lineHeight, 'rem')) / parseFloat(remFontSize);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let transform = null;
|
|
61
|
-
|
|
62
|
-
if (!disableAlign) {
|
|
63
|
-
transform = value => (0, _cssUtils.alignProperty)({
|
|
64
|
-
size: value,
|
|
65
|
-
grid: (0, _cssUtils.fontGrid)({
|
|
66
|
-
pixels: 4,
|
|
67
|
-
lineHeight,
|
|
68
|
-
htmlFontSize: typography.htmlFontSize
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
typography[variant] = _objectSpread(_objectSpread({}, style), (0, _cssUtils.responsiveProperty)({
|
|
74
|
-
cssProperty: 'fontSize',
|
|
75
|
-
min: minFontSize,
|
|
76
|
-
max: maxFontSize,
|
|
77
|
-
unit: 'rem',
|
|
78
|
-
breakpoints: breakpointValues,
|
|
79
|
-
transform
|
|
80
|
-
}));
|
|
81
|
-
});
|
|
82
|
-
return theme;
|
|
83
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// https://github.com/mui-org/material-ui/blob/f2d74e9144ffec1ba6a098528573c7dfb3957b48/packages/material-ui/src/styles/responsiveFontSizes.js
|
|
2
|
-
import {
|
|
3
|
-
isUnitless,
|
|
4
|
-
convertLength,
|
|
5
|
-
responsiveProperty,
|
|
6
|
-
alignProperty,
|
|
7
|
-
fontGrid,
|
|
8
|
-
} from '@material-ui/core/styles/cssUtils';
|
|
9
|
-
|
|
10
|
-
export default function responsiveFontSizes(themeInput, options = {}) {
|
|
11
|
-
const {
|
|
12
|
-
breakpoints = ['sm', 'md', 'lg'],
|
|
13
|
-
disableAlign = false,
|
|
14
|
-
factor = 3,
|
|
15
|
-
maxSize = 2.5,
|
|
16
|
-
// minSize = 0.8,
|
|
17
|
-
variants = [
|
|
18
|
-
'h1',
|
|
19
|
-
'h2',
|
|
20
|
-
'h3',
|
|
21
|
-
'h4',
|
|
22
|
-
'h5',
|
|
23
|
-
'h6',
|
|
24
|
-
'subtitle1',
|
|
25
|
-
'subtitle2',
|
|
26
|
-
'body1',
|
|
27
|
-
'body2',
|
|
28
|
-
'caption',
|
|
29
|
-
'button',
|
|
30
|
-
'overline',
|
|
31
|
-
],
|
|
32
|
-
} = options;
|
|
33
|
-
|
|
34
|
-
const theme = { ...themeInput };
|
|
35
|
-
theme.typography = { ...theme.typography };
|
|
36
|
-
const { typography } = theme;
|
|
37
|
-
|
|
38
|
-
// Convert between css lengths e.g. em->px or px->rem
|
|
39
|
-
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
40
|
-
const convert = convertLength(typography.htmlFontSize);
|
|
41
|
-
const breakpointValues = breakpoints.map(x => theme.breakpoints.values[x]);
|
|
42
|
-
|
|
43
|
-
variants.forEach(variant => {
|
|
44
|
-
const style = typography[variant];
|
|
45
|
-
const remFontSize = parseFloat(convert(style.fontSize, 'rem'));
|
|
46
|
-
|
|
47
|
-
if (remFontSize <= 1) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const maxFontSize = Math.min(remFontSize, maxSize);
|
|
52
|
-
const minFontSize = 1 + (maxFontSize - 1) / factor;
|
|
53
|
-
|
|
54
|
-
let { lineHeight } = style;
|
|
55
|
-
|
|
56
|
-
if (!isUnitless(lineHeight) && !disableAlign) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
[
|
|
59
|
-
'Material-UI: unsupported non-unitless line height with grid alignment.',
|
|
60
|
-
'Use unitless line heights instead.',
|
|
61
|
-
].join('\n')
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (!isUnitless(lineHeight)) {
|
|
66
|
-
// make it unitless
|
|
67
|
-
lineHeight = parseFloat(convert(lineHeight, 'rem')) / parseFloat(remFontSize);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
let transform = null;
|
|
71
|
-
|
|
72
|
-
if (!disableAlign) {
|
|
73
|
-
transform = value =>
|
|
74
|
-
alignProperty({
|
|
75
|
-
size: value,
|
|
76
|
-
grid: fontGrid({ pixels: 4, lineHeight, htmlFontSize: typography.htmlFontSize }),
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
typography[variant] = {
|
|
81
|
-
...style,
|
|
82
|
-
...responsiveProperty({
|
|
83
|
-
cssProperty: 'fontSize',
|
|
84
|
-
min: minFontSize,
|
|
85
|
-
max: maxFontSize,
|
|
86
|
-
unit: 'rem',
|
|
87
|
-
breakpoints: breakpointValues,
|
|
88
|
-
transform,
|
|
89
|
-
}),
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
return theme;
|
|
94
|
-
}
|