@arcblock/ux 0.78.26 → 1.6.60
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/LICENSE +1 -1
- package/README.md +0 -56
- package/lib/ActionButton/index.js +6 -4
- package/lib/ActivityIndicator/index.js +75 -23
- package/lib/Alert/index.js +15 -11
- package/lib/Async/index.js +1 -1
- package/lib/Badge/index.js +17 -15
- package/lib/Blocklet/index.js +261 -0
- package/lib/Button/wrap.js +96 -43
- package/lib/ButtonGroup/index.js +3 -16
- package/lib/Center/index.js +30 -4
- package/lib/ClickToCopy/index.js +10 -8
- package/lib/CodeBlock/index.js +40 -13
- package/lib/Colors/index.js +15 -0
- package/lib/Colors/themes/default.js +85 -0
- package/lib/ContactForm/index.js +9 -10
- package/lib/CookieConsent/index.js +98 -0
- package/lib/CountDown/index.js +18 -14
- package/lib/Dialog/confirm.js +84 -0
- package/lib/Dialog/dialog.js +137 -0
- package/lib/Dialog/index.js +23 -0
- package/lib/Earth/index.js +33 -33
- package/lib/Empty/index.js +61 -0
- package/lib/Footer/index.js +16 -18
- package/lib/Icon/image.js +10 -13
- package/lib/Icon/index.js +10 -8
- package/lib/Img/index.js +212 -0
- package/lib/InfoRow/index.js +7 -6
- package/lib/Layout/dashboard/header.js +60 -42
- package/lib/Layout/dashboard/index.js +72 -60
- package/lib/Layout/dashboard/sidebar.js +41 -25
- package/lib/Layout/index.js +113 -51
- package/lib/Locale/browser-lang.js +0 -2
- package/lib/Locale/context.js +85 -61
- package/lib/Locale/selector.js +33 -20
- package/lib/Logo/index.js +15 -13
- package/lib/Metric/index.js +5 -6
- package/lib/NFTDisplay/README.md +59 -0
- package/lib/NFTDisplay/aspect-ratio-container.js +52 -0
- package/lib/NFTDisplay/broken.js +25 -0
- package/lib/NFTDisplay/index.js +317 -0
- package/lib/NFTDisplay/loading.js +23 -0
- package/lib/NFTDisplay/svg-embedder/img.js +68 -0
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +54 -0
- package/lib/PageScroller/index.js +10 -11
- package/lib/PageScroller/usePrevValue.js +2 -2
- package/lib/PricingTable/PricingPlan.js +12 -15
- package/lib/PricingTable/index.js +5 -5
- package/lib/QRCode/index.js +89 -0
- package/lib/Result/common.js +176 -0
- package/lib/Result/index.js +61 -0
- package/lib/Result/result.js +69 -0
- package/lib/Result/translations.js +61 -0
- package/lib/Screenshot/index.js +14 -13
- package/lib/Spinner/index.js +37 -0
- package/lib/SplitButton/index.js +126 -0
- package/lib/Switch/index.js +107 -0
- package/lib/Tabs/index.js +24 -47
- package/lib/Tag/index.js +15 -13
- package/lib/Terminal/Player.js +43 -45
- package/lib/Terminal/index.js +3 -1
- package/lib/Terminal/util.js +2 -3
- package/lib/TextCollapse/index.js +21 -14
- package/lib/Theme/index.js +79 -63
- package/lib/Theme/responsiveFontSizes.js +8 -8
- package/lib/Toast/index.js +12 -11
- package/lib/Util/index.js +197 -26
- package/lib/Video/index.js +8 -11
- package/lib/Wallet/Action.js +15 -13
- package/lib/Wallet/Download.js +60 -58
- package/lib/Wallet/Open.js +2 -2
- package/lib/WechatPrompt/index.js +10 -10
- package/lib/index.js +6 -6
- package/lib/withTheme/index.js +5 -17
- package/lib/withTracker/error_boundary.js +3 -3
- package/lib/withTracker/index.js +6 -7
- package/package.json +23 -17
- package/src/ActionButton/index.js +65 -0
- package/src/ActivityIndicator/index.js +141 -0
- package/src/Alert/index.js +104 -0
- package/src/Async/index.js +39 -0
- package/src/Badge/index.js +71 -0
- package/src/Blocklet/index.js +424 -0
- package/src/Button/index.js +4 -0
- package/src/Button/wrap.js +101 -0
- package/src/ButtonGroup/index.js +6 -0
- package/src/Center/index.js +40 -0
- package/src/ClickToCopy/index.js +90 -0
- package/src/CodeBlock/index.js +160 -0
- package/src/Colors/index.js +1 -0
- package/src/Colors/themes/default.js +54 -0
- package/src/ContactForm/index.js +240 -0
- package/src/CookieConsent/index.js +90 -0
- package/src/CountDown/index.js +151 -0
- package/src/Dialog/confirm.js +76 -0
- package/src/Dialog/dialog.js +162 -0
- package/src/Dialog/index.js +2 -0
- package/src/DriftBot/index.js +81 -0
- package/src/Earth/countries.json +8057 -0
- package/src/Earth/index.js +511 -0
- package/src/Earth/util.js +69 -0
- package/src/Empty/index.js +41 -0
- package/src/Footer/index.js +110 -0
- package/src/Icon/image.js +55 -0
- package/src/Icon/index.js +69 -0
- package/src/Img/index.js +172 -0
- package/src/InfoRow/index.js +83 -0
- package/src/Layout/dashboard/header.js +157 -0
- package/src/Layout/dashboard/index.js +150 -0
- package/src/Layout/dashboard/sidebar.js +122 -0
- package/src/Layout/index.js +318 -0
- package/src/Locale/browser-lang.js +63 -0
- package/src/Locale/context.js +94 -0
- package/src/Locale/images/globe-dark.png +0 -0
- package/src/Locale/images/globe-light.png +0 -0
- package/src/Locale/selector.js +135 -0
- package/src/Logo/images/logo-dark-text.svg +3 -0
- package/src/Logo/images/logo-dark-top.svg +6 -0
- package/src/Logo/images/logo-light-text.svg +3 -0
- package/src/Logo/images/logo-light-top.svg +6 -0
- package/src/Logo/index.js +47 -0
- package/src/Metric/index.js +115 -0
- package/src/NFTDisplay/README.md +59 -0
- package/src/NFTDisplay/aspect-ratio-container.js +34 -0
- package/src/NFTDisplay/broken.js +18 -0
- package/src/NFTDisplay/index.js +257 -0
- package/src/NFTDisplay/loading.js +17 -0
- package/src/NFTDisplay/svg-embedder/img.js +36 -0
- package/src/NFTDisplay/svg-embedder/inline-svg.js +37 -0
- package/src/PageScroller/index.js +342 -0
- package/src/PageScroller/usePrevValue.js +12 -0
- package/src/PricingTable/PricingPlan.js +112 -0
- package/src/PricingTable/index.js +43 -0
- package/src/QRCode/index.js +56 -0
- package/src/Result/common.js +116 -0
- package/src/Result/index.js +31 -0
- package/src/Result/result.js +57 -0
- package/src/Result/translations.js +56 -0
- package/src/Screenshot/devices.css +1366 -0
- package/src/Screenshot/index.js +181 -0
- package/src/Spinner/index.js +19 -0
- package/src/SplitButton/index.js +112 -0
- package/src/Switch/index.js +78 -0
- package/src/Tabs/index.js +46 -0
- package/src/Tag/index.js +73 -0
- package/src/Terminal/Player.js +364 -0
- package/src/Terminal/index.js +150 -0
- package/src/Terminal/player.css +378 -0
- package/src/Terminal/util.js +167 -0
- package/src/Terminal/xterm.css +171 -0
- package/src/TextCollapse/index.js +92 -0
- package/src/Theme/index.js +184 -0
- package/src/Theme/responsiveFontSizes.js +94 -0
- package/src/Toast/index.js +118 -0
- package/src/Util/index.js +281 -0
- package/src/Video/index.js +72 -0
- package/src/Wallet/Action.js +105 -0
- package/src/Wallet/Download.js +130 -0
- package/src/Wallet/Open.js +50 -0
- package/src/Wallet/images/abtwallet.png +0 -0
- package/src/Wallet/images/android_download.svg +23 -0
- package/src/Wallet/images/app-store.svg +20 -0
- package/src/Wallet/images/google-play.svg +70 -0
- package/src/WechatPrompt/images/android.png +0 -0
- package/src/WechatPrompt/images/ios.png +0 -0
- package/src/WechatPrompt/index.js +81 -0
- package/src/index.js +63 -0
- package/src/withTheme/index.js +72 -0
- package/src/withTracker/README.md +34 -0
- package/src/withTracker/error_boundary.js +34 -0
- package/src/withTracker/index.js +70 -0
- package/lib/GraphQLPlayground/graphiql.css +0 -1850
- package/lib/GraphQLPlayground/index.js +0 -302
- package/lib/GraphQLPlayground/util.js +0 -55
package/lib/Terminal/util.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.isFrameAt = exports.getPlayerClass = exports.getFrameClass = exports.formatTime = exports.formatFrames = exports.findFrameAt = exports.defaultState = exports.defaultOptions = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Adjust the delays of the frames, considering to the options
|
|
@@ -71,8 +71,7 @@ const findFrameAt = (frames, time, fromIndex) => {
|
|
|
71
71
|
if (typeof fromIndex === 'undefined') {
|
|
72
72
|
// eslint-disable-next-line no-param-reassign
|
|
73
73
|
fromIndex = 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
74
|
+
}
|
|
76
75
|
|
|
77
76
|
for (let i = fromIndex; i < frames.length; i++) {
|
|
78
77
|
frame = frames[i];
|
|
@@ -13,13 +13,14 @@ var _Typography = _interopRequireDefault(require("@material-ui/core/Typography")
|
|
|
13
13
|
|
|
14
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
15
|
|
|
16
|
+
const _excluded = ["children", "startChars", "endChars", "scaleFactor", "maxWidth", "style", "fontType"];
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
21
|
|
|
20
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
23
|
|
|
22
|
-
// eslint-disable-next-line object-curly-newline
|
|
23
24
|
function TextCollapse(_ref) {
|
|
24
25
|
let {
|
|
25
26
|
children,
|
|
@@ -27,32 +28,36 @@ function TextCollapse(_ref) {
|
|
|
27
28
|
endChars,
|
|
28
29
|
scaleFactor,
|
|
29
30
|
maxWidth,
|
|
30
|
-
style
|
|
31
|
+
style,
|
|
32
|
+
fontType
|
|
31
33
|
} = _ref,
|
|
32
|
-
rest = _objectWithoutProperties(_ref,
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
35
|
|
|
34
36
|
if (typeof children !== 'string') {
|
|
35
37
|
return null;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const isMonospace = fontType === 'monospace'; // 由于 css 样式产生的省略号长度是不确定的,所以目前 startChars 的长度只能让开发者自己去加上‘省略号’的宽度去设置这个值,要想完美的实现目标功能,最好是改用 js 动态修改文本内容来实现
|
|
41
|
+
|
|
42
|
+
const startWidth = isMonospace ? "".concat(startChars, "ch") : "".concat(scaleFactor * (startChars + 3), "em");
|
|
43
|
+
const endWidth = isMonospace ? "".concat(endChars, "ch") : "".concat(scaleFactor * endChars, "em");
|
|
44
|
+
const styles = Object.assign(isMonospace ? {
|
|
45
|
+
fontFamily: '"Courier New", Courier, monospace'
|
|
46
|
+
} : {}, {
|
|
42
47
|
fontSize: 'inherit',
|
|
43
48
|
color: 'inherit',
|
|
44
49
|
fontWeight: 'inherit',
|
|
45
50
|
maxWidth
|
|
46
51
|
}, style);
|
|
47
52
|
const [startPart, endPart] = [children.slice(0, children.length - endChars), children.slice(children.length - endChars)];
|
|
48
|
-
return _react.default.createElement(Container, Object.assign({
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(Container, Object.assign({
|
|
49
54
|
component: "span",
|
|
50
55
|
style: styles,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, rest), _react.default.createElement("span", {
|
|
56
|
+
startwidth: startWidth,
|
|
57
|
+
endwidth: endWidth
|
|
58
|
+
}, rest), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
59
|
className: "start-part"
|
|
55
|
-
}, startPart), _react.default.createElement("span", {
|
|
60
|
+
}, startPart), /*#__PURE__*/_react.default.createElement("span", {
|
|
56
61
|
className: "end-part"
|
|
57
62
|
}, endPart));
|
|
58
63
|
}
|
|
@@ -60,6 +65,7 @@ function TextCollapse(_ref) {
|
|
|
60
65
|
TextCollapse.propTypes = {
|
|
61
66
|
children: _propTypes.default.string.isRequired,
|
|
62
67
|
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
68
|
+
fontType: _propTypes.default.oneOf(['monospace', 'normal']),
|
|
63
69
|
style: _propTypes.default.object,
|
|
64
70
|
startChars: _propTypes.default.number,
|
|
65
71
|
endChars: _propTypes.default.number,
|
|
@@ -69,9 +75,10 @@ TextCollapse.defaultProps = {
|
|
|
69
75
|
style: {},
|
|
70
76
|
startChars: 5,
|
|
71
77
|
endChars: 5,
|
|
72
|
-
scaleFactor: 0.45
|
|
78
|
+
scaleFactor: 0.45,
|
|
79
|
+
fontType: 'normal'
|
|
73
80
|
};
|
|
74
81
|
const Container = (0, _styledComponents.default)(_Typography.default).withConfig({
|
|
75
82
|
displayName: "TextCollapse__Container",
|
|
76
83
|
componentId: "sc-1u3qfqq-0"
|
|
77
|
-
})(["display:inline-flex;align-items:center;justify-content:start;cursor:pointer;white-space:nowrap;overflow:hidden;.start-part,.end-part{display:inline-block;vertical-align:bottom;white-space:nowrap;overflow:hidden;}.start-part{max-width:calc(100% - ", "
|
|
84
|
+
})(["display:inline-flex;align-items:center;justify-content:start;cursor:pointer;white-space:nowrap;overflow:hidden;.start-part,.end-part{display:inline-block;vertical-align:bottom;white-space:nowrap;overflow:hidden;}.start-part{max-width:calc(100% - ", ");min-width:", ";text-overflow:ellipsis;}.end-part{max-width:calc(100% - ", ");direction:rtl;}"], props => props.endwidth, props => props.startwidth, props => props.startwidth);
|
package/lib/Theme/index.js
CHANGED
|
@@ -3,88 +3,83 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.create =
|
|
6
|
+
exports.create = void 0;
|
|
7
7
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
|
|
10
|
+
require("@fontsource/lato/400.css");
|
|
11
|
+
|
|
12
|
+
require("@fontsource/lato/700.css");
|
|
13
|
+
|
|
10
14
|
var _responsiveFontSizes = _interopRequireDefault(require("./responsiveFontSizes"));
|
|
11
15
|
|
|
16
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
|
17
|
+
|
|
18
|
+
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
|
19
|
+
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
|
|
18
|
-
const colors = {
|
|
19
|
-
white: '#FFFFFF',
|
|
20
|
-
dark: '#4A707C',
|
|
21
|
-
gray: '#222222',
|
|
22
|
-
minor: '#9B9B9B',
|
|
23
|
-
darkText: '#DCDCDC',
|
|
24
|
-
background: '#F7F8F8',
|
|
25
|
-
yellow: '#FFCF71',
|
|
26
|
-
green: '#44cdc6',
|
|
27
|
-
red: '#D0021B',
|
|
28
|
-
blue: '#4E6AF6',
|
|
29
|
-
primary: '#222222',
|
|
30
|
-
black: '#222222',
|
|
31
|
-
secondary: '#44cdc6',
|
|
32
|
-
mint: '#44cdc6',
|
|
33
|
-
textSecondary: '#4A4A4A',
|
|
34
|
-
active: '#5b9025',
|
|
35
|
-
danger: '#D0021B',
|
|
36
|
-
lightGrey: '#BCBCBC'
|
|
37
|
-
}; // https://material-ui.com/customization/default-theme/
|
|
38
|
-
|
|
39
|
-
exports.colors = colors;
|
|
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; }
|
|
23
|
+
|
|
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; }
|
|
40
25
|
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
// https://material-ui.com/customization/default-theme/
|
|
33
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
41
34
|
const create = function create() {
|
|
42
|
-
let {
|
|
35
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
36
|
+
{
|
|
43
37
|
mode = 'light',
|
|
44
38
|
pageWidth = 'md',
|
|
45
39
|
palette,
|
|
46
40
|
typography,
|
|
47
41
|
overrides
|
|
48
|
-
} =
|
|
49
|
-
|
|
42
|
+
} = _ref,
|
|
43
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
|
|
45
|
+
const theme = (0, _styles.createTheme)(_objectSpread({
|
|
50
46
|
themeName: 'ArcBlock',
|
|
51
|
-
palette: Object.assign({
|
|
52
|
-
primary: {
|
|
53
|
-
main: colors.blue,
|
|
54
|
-
contrastText: colors.white
|
|
55
|
-
},
|
|
56
|
-
secondary: {
|
|
57
|
-
main: colors.mint,
|
|
58
|
-
contrastText: colors.white
|
|
59
|
-
},
|
|
60
|
-
danger: {
|
|
61
|
-
main: colors.danger,
|
|
62
|
-
contrastText: colors.white
|
|
63
|
-
},
|
|
64
|
-
text: {
|
|
65
|
-
primary: '#404040',
|
|
66
|
-
contrast: colors.white
|
|
67
|
-
},
|
|
47
|
+
palette: Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
|
68
48
|
background: {
|
|
69
|
-
paper: mode === 'light' ?
|
|
70
|
-
default: mode === 'light' ?
|
|
49
|
+
paper: mode === 'light' ? _Colors.default.common.white : _Colors.default.grey[900],
|
|
50
|
+
default: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
71
51
|
},
|
|
72
52
|
type: mode
|
|
73
|
-
}, palette || {}),
|
|
53
|
+
}), palette || {}),
|
|
74
54
|
typography: Object.assign({
|
|
75
55
|
useNextVariants: true,
|
|
76
56
|
color: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
|
58
|
+
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
|
59
|
+
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
|
60
|
+
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
|
61
|
+
main: mode === 'light' ? '#222222' : _Colors.default.common.white,
|
|
62
|
+
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
|
80
63
|
},
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
|
65
|
+
// 按最新设计规范, 只使用 400/700
|
|
66
|
+
fontWeightLight: 400,
|
|
67
|
+
fontWeightRegular: 400,
|
|
68
|
+
fontWeightMedium: 700,
|
|
69
|
+
fontWeightBold: 700,
|
|
70
|
+
// button 默认使用粗体
|
|
71
|
+
button: {
|
|
72
|
+
fontWeight: 700
|
|
73
|
+
}
|
|
83
74
|
}, typography || {}),
|
|
84
75
|
overrides: Object.assign({
|
|
85
76
|
MuiButton: {
|
|
86
77
|
root: {
|
|
87
|
-
|
|
78
|
+
boxShadow: 'none'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
MuiButtonGroup: {
|
|
82
|
+
contained: {
|
|
88
83
|
boxShadow: 'none'
|
|
89
84
|
}
|
|
90
85
|
},
|
|
@@ -95,7 +90,7 @@ const create = function create() {
|
|
|
95
90
|
},
|
|
96
91
|
MuiToolbar: {
|
|
97
92
|
root: {
|
|
98
|
-
background: mode === 'light' ?
|
|
93
|
+
background: mode === 'light' ? _Colors.default.background.default : _Colors.default.grey[900]
|
|
99
94
|
}
|
|
100
95
|
},
|
|
101
96
|
MuiTableCell: {
|
|
@@ -108,10 +103,10 @@ const create = function create() {
|
|
|
108
103
|
},
|
|
109
104
|
head: {
|
|
110
105
|
textTransform: 'uppercase',
|
|
111
|
-
color: mode === 'light' ?
|
|
106
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
112
107
|
},
|
|
113
108
|
body: {
|
|
114
|
-
color: mode === 'light' ?
|
|
109
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
115
110
|
}
|
|
116
111
|
},
|
|
117
112
|
MuiChip: {
|
|
@@ -134,17 +129,38 @@ const create = function create() {
|
|
|
134
129
|
},
|
|
135
130
|
MuiTypography: {
|
|
136
131
|
body1: {
|
|
137
|
-
color: mode === 'light' ?
|
|
132
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
138
133
|
},
|
|
139
134
|
body2: {
|
|
140
|
-
color: mode === 'light' ?
|
|
135
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
138
|
}, overrides || {}),
|
|
144
139
|
pageWidth,
|
|
145
|
-
colors,
|
|
140
|
+
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
|
141
|
+
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
|
142
|
+
colors: {
|
|
143
|
+
white: '#FFFFFF',
|
|
144
|
+
dark: '#4A707C',
|
|
145
|
+
gray: '#222222',
|
|
146
|
+
minor: '#9B9B9B',
|
|
147
|
+
darkText: '#DCDCDC',
|
|
148
|
+
background: '#F7F8F8',
|
|
149
|
+
yellow: '#FFCF71',
|
|
150
|
+
green: '#44cdc6',
|
|
151
|
+
red: '#D0021B',
|
|
152
|
+
blue: '#4E6AF6',
|
|
153
|
+
primary: '#222222',
|
|
154
|
+
black: '#222222',
|
|
155
|
+
secondary: '#44cdc6',
|
|
156
|
+
mint: '#44cdc6',
|
|
157
|
+
textSecondary: '#4A4A4A',
|
|
158
|
+
active: '#5b9025',
|
|
159
|
+
danger: '#D0021B',
|
|
160
|
+
lightGrey: '#BCBCBC'
|
|
161
|
+
},
|
|
146
162
|
mode
|
|
147
|
-
});
|
|
163
|
+
}, rest));
|
|
148
164
|
const enhanced = (0, _responsiveFontSizes.default)(theme, {
|
|
149
165
|
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
|
150
166
|
disableAlign: false,
|
|
@@ -7,9 +7,9 @@ exports.default = responsiveFontSizes;
|
|
|
7
7
|
|
|
8
8
|
var _cssUtils = require("@material-ui/core/styles/cssUtils");
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
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
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
13
|
|
|
14
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
15
|
|
|
@@ -26,9 +26,10 @@ function responsiveFontSizes(themeInput) {
|
|
|
26
26
|
|
|
27
27
|
const theme = _objectSpread({}, themeInput);
|
|
28
28
|
|
|
29
|
-
theme.typography = _objectSpread({}, theme.typography);
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
theme.typography = _objectSpread({}, theme.typography);
|
|
30
|
+
const {
|
|
31
|
+
typography
|
|
32
|
+
} = theme; // Convert between css lengths e.g. em->px or px->rem
|
|
32
33
|
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
|
33
34
|
|
|
34
35
|
const convert = (0, _cssUtils.convertLength)(typography.htmlFontSize);
|
|
@@ -59,8 +60,7 @@ function responsiveFontSizes(themeInput) {
|
|
|
59
60
|
let transform = null;
|
|
60
61
|
|
|
61
62
|
if (!disableAlign) {
|
|
62
|
-
transform = value =>
|
|
63
|
-
(0, _cssUtils.alignProperty)({
|
|
63
|
+
transform = value => (0, _cssUtils.alignProperty)({
|
|
64
64
|
size: value,
|
|
65
65
|
grid: (0, _cssUtils.fontGrid)({
|
|
66
66
|
pixels: 4,
|
|
@@ -70,7 +70,7 @@ function responsiveFontSizes(themeInput) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
typography[variant] = _objectSpread({}, style,
|
|
73
|
+
typography[variant] = _objectSpread(_objectSpread({}, style), (0, _cssUtils.responsiveProperty)({
|
|
74
74
|
cssProperty: 'fontSize',
|
|
75
75
|
min: minFontSize,
|
|
76
76
|
max: maxFontSize,
|
package/lib/Toast/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var _colors = require("@material-ui/core/colors");
|
|
|
29
29
|
|
|
30
30
|
var _styles = require("@material-ui/core/styles");
|
|
31
31
|
|
|
32
|
+
const _excluded = ["className", "message", "onClose", "variant"];
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -68,7 +70,7 @@ const useStyles1 = (0, _styles.makeStyles)(theme => ({
|
|
|
68
70
|
}));
|
|
69
71
|
|
|
70
72
|
function SnackbarContentWrapper(props) {
|
|
71
|
-
const classes = useStyles1();
|
|
73
|
+
const classes = useStyles1();
|
|
72
74
|
|
|
73
75
|
const {
|
|
74
76
|
className,
|
|
@@ -76,24 +78,23 @@ function SnackbarContentWrapper(props) {
|
|
|
76
78
|
onClose,
|
|
77
79
|
variant
|
|
78
80
|
} = props,
|
|
79
|
-
rest = _objectWithoutProperties(props,
|
|
81
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
80
82
|
|
|
81
83
|
const Icon = variantIcon[variant];
|
|
82
|
-
return _react.default.createElement(_SnackbarContent.default, Object.assign({
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(_SnackbarContent.default, Object.assign({
|
|
83
85
|
className: [classes[variant], className].join(' ').trim(),
|
|
84
|
-
message:
|
|
85
|
-
_react.default.createElement("span", {
|
|
86
|
+
message: /*#__PURE__*/_react.default.createElement("span", {
|
|
86
87
|
id: "client-snackbar",
|
|
87
88
|
className: classes.message
|
|
88
|
-
}, _react.default.createElement(Icon, {
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
89
90
|
className: [classes.icon, classes.iconVariant].join(' ').trim()
|
|
90
91
|
}), message),
|
|
91
|
-
action: [_react.default.createElement(_IconButton.default, {
|
|
92
|
+
action: [/*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
92
93
|
key: "close",
|
|
93
94
|
"aria-label": "close",
|
|
94
95
|
color: "inherit",
|
|
95
96
|
onClick: onClose
|
|
96
|
-
}, _react.default.createElement(_Close.default, {
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
97
98
|
className: classes.icon
|
|
98
99
|
}))]
|
|
99
100
|
}, rest));
|
|
@@ -108,7 +109,7 @@ SnackbarContentWrapper.propTypes = {
|
|
|
108
109
|
SnackbarContentWrapper.defaultProps = {
|
|
109
110
|
className: '',
|
|
110
111
|
variant: 'success'
|
|
111
|
-
};
|
|
112
|
+
};
|
|
112
113
|
|
|
113
114
|
function Toast(_ref) {
|
|
114
115
|
let {
|
|
@@ -129,7 +130,7 @@ function Toast(_ref) {
|
|
|
129
130
|
onClose();
|
|
130
131
|
};
|
|
131
132
|
|
|
132
|
-
return _react.default.createElement(_Snackbar.default, {
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
|
|
133
134
|
open: open,
|
|
134
135
|
anchorOrigin: {
|
|
135
136
|
vertical: 'top',
|
|
@@ -137,7 +138,7 @@ function Toast(_ref) {
|
|
|
137
138
|
},
|
|
138
139
|
autoHideDuration: duration,
|
|
139
140
|
onClose: handleClose
|
|
140
|
-
}, _react.default.createElement(SnackbarContentWrapper, {
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(SnackbarContentWrapper, {
|
|
141
142
|
onClose: handleClose,
|
|
142
143
|
variant: variant,
|
|
143
144
|
message: message
|