@arcblock/ux 2.1.69 → 2.2.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/CodeBlock/index.js +28 -28
- package/lib/Theme/index.js +23 -148
- package/lib/Theme/theme-provider.js +58 -0
- package/lib/Theme/theme.js +157 -0
- package/package.json +36 -36
- package/src/CodeBlock/index.js +1 -1
- package/src/Theme/index.js +2 -164
- package/src/Theme/theme-provider.js +36 -0
- package/src/Theme/theme.js +164 -0
package/lib/CodeBlock/index.js
CHANGED
@@ -17,7 +17,7 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
17
17
|
|
18
18
|
var _useMountedState = _interopRequireDefault(require("react-use/lib/useMountedState"));
|
19
19
|
|
20
|
-
var
|
20
|
+
var _core = _interopRequireDefault(require("highlight.js/lib/core"));
|
21
21
|
|
22
22
|
var _javascript = _interopRequireDefault(require("highlight.js/lib/languages/javascript"));
|
23
23
|
|
@@ -71,57 +71,57 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
71
71
|
|
72
72
|
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; }
|
73
73
|
|
74
|
-
|
74
|
+
_core.default.registerLanguage('javascript', _javascript.default);
|
75
75
|
|
76
|
-
|
76
|
+
_core.default.registerLanguage('js', _javascript.default);
|
77
77
|
|
78
|
-
|
78
|
+
_core.default.registerLanguage('jsx', _javascript.default);
|
79
79
|
|
80
|
-
|
80
|
+
_core.default.registerLanguage('typescript', _typescript.default);
|
81
81
|
|
82
|
-
|
82
|
+
_core.default.registerLanguage('ts', _typescript.default);
|
83
83
|
|
84
|
-
|
84
|
+
_core.default.registerLanguage('tsx', _typescript.default);
|
85
85
|
|
86
|
-
|
86
|
+
_core.default.registerLanguage('json', _json.default);
|
87
87
|
|
88
|
-
|
88
|
+
_core.default.registerLanguage('elixir', _elixir.default);
|
89
89
|
|
90
|
-
|
90
|
+
_core.default.registerLanguage('java', _java.default);
|
91
91
|
|
92
|
-
|
92
|
+
_core.default.registerLanguage('kotlin', _kotlin.default);
|
93
93
|
|
94
|
-
|
94
|
+
_core.default.registerLanguage('kt', _kotlin.default);
|
95
95
|
|
96
|
-
|
96
|
+
_core.default.registerLanguage('protobuf', _protobuf.default);
|
97
97
|
|
98
|
-
|
98
|
+
_core.default.registerLanguage('protobuffer', _protobuf.default);
|
99
99
|
|
100
|
-
|
100
|
+
_core.default.registerLanguage('python', _python.default);
|
101
101
|
|
102
|
-
|
102
|
+
_core.default.registerLanguage('py', _python.default);
|
103
103
|
|
104
|
-
|
104
|
+
_core.default.registerLanguage('yaml', _yaml.default);
|
105
105
|
|
106
|
-
|
106
|
+
_core.default.registerLanguage('yml', _yaml.default);
|
107
107
|
|
108
|
-
|
108
|
+
_core.default.registerLanguage('shell', _shell.default);
|
109
109
|
|
110
|
-
|
110
|
+
_core.default.registerLanguage('sh', _shell.default);
|
111
111
|
|
112
|
-
|
112
|
+
_core.default.registerLanguage('plaintext', _plaintext.default);
|
113
113
|
|
114
|
-
|
114
|
+
_core.default.registerLanguage('text', _plaintext.default);
|
115
115
|
|
116
|
-
|
116
|
+
_core.default.registerLanguage('patch', _diff.default);
|
117
117
|
|
118
|
-
|
118
|
+
_core.default.registerLanguage('diff', _diff.default);
|
119
119
|
|
120
|
-
|
120
|
+
_core.default.registerLanguage('swift', _swift.default);
|
121
121
|
|
122
|
-
|
122
|
+
_core.default.registerLanguage('objectivec', _objectivec.default);
|
123
123
|
|
124
|
-
|
124
|
+
_core.default.registerLanguage('oc', _objectivec.default);
|
125
125
|
|
126
126
|
function CodeBlock(_ref) {
|
127
127
|
let {
|
@@ -152,7 +152,7 @@ function CodeBlock(_ref) {
|
|
152
152
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("code", {
|
153
153
|
className: "hljs ".concat(language),
|
154
154
|
dangerouslySetInnerHTML: {
|
155
|
-
__html:
|
155
|
+
__html: _core.default.highlightAuto(source, [language]).value
|
156
156
|
}
|
157
157
|
})
|
158
158
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_IconButton.default, {
|
package/lib/Theme/index.js
CHANGED
@@ -3,155 +3,30 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
var _Colors = _interopRequireDefault(require("../Colors"));
|
15
|
-
|
16
|
-
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
17
|
-
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
|
-
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; }
|
21
|
-
|
22
|
-
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; }
|
23
|
-
|
24
|
-
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; }
|
25
|
-
|
26
|
-
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; }
|
27
|
-
|
28
|
-
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; }
|
29
|
-
|
30
|
-
const muiDarkTheme = (0, _styles.createTheme)({
|
31
|
-
palette: {
|
32
|
-
mode: 'dark'
|
6
|
+
var _exportNames = {
|
7
|
+
ThemeProvider: true
|
8
|
+
};
|
9
|
+
Object.defineProperty(exports, "ThemeProvider", {
|
10
|
+
enumerable: true,
|
11
|
+
get: function get() {
|
12
|
+
return _themeProvider.default;
|
33
13
|
}
|
34
|
-
});
|
35
|
-
// eslint-disable-next-line import/prefer-default-export
|
36
|
-
|
37
|
-
const create = function create() {
|
38
|
-
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
39
|
-
{
|
40
|
-
mode = 'light',
|
41
|
-
pageWidth = 'md',
|
42
|
-
palette,
|
43
|
-
typography,
|
44
|
-
overrides
|
45
|
-
} = _ref,
|
46
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
47
|
-
|
48
|
-
// palette 考虑 light & dark mode, dark mode 需要持续完善
|
49
|
-
// - 能配合 ColorModeContext 使用
|
50
|
-
// - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
|
51
|
-
const _palette = mode === 'light' ? Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
52
|
-
background: {
|
53
|
-
paper: _Colors.default.common.white,
|
54
|
-
default: _Colors.default.background.default
|
55
|
-
},
|
56
|
-
mode
|
57
|
-
}), palette || {}) : Object.assign(_objectSpread(_objectSpread({}, muiDarkTheme.palette), {}, {
|
58
|
-
background: {
|
59
|
-
paper: _Colors.default.grey[900],
|
60
|
-
default: _Colors.default.grey[900]
|
61
|
-
},
|
62
|
-
mode
|
63
|
-
}), palette || {});
|
14
|
+
});
|
64
15
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
77
|
-
},
|
78
|
-
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
79
|
-
// 按最新设计规范, 只使用 400/700
|
80
|
-
fontWeightLight: 400,
|
81
|
-
fontWeightRegular: 400,
|
82
|
-
fontWeightMedium: 700,
|
83
|
-
fontWeightBold: 700,
|
84
|
-
// button 默认使用粗体
|
85
|
-
button: {
|
86
|
-
fontWeight: 700
|
87
|
-
}
|
88
|
-
}, typography || {}),
|
89
|
-
components: _objectSpread({
|
90
|
-
MuiButton: {
|
91
|
-
styleOverrides: {
|
92
|
-
root: {
|
93
|
-
boxShadow: 'none'
|
94
|
-
}
|
95
|
-
}
|
96
|
-
},
|
97
|
-
MuiButtonGroup: {
|
98
|
-
styleOverrides: {
|
99
|
-
root: {
|
100
|
-
boxShadow: 'none'
|
101
|
-
}
|
102
|
-
}
|
103
|
-
},
|
104
|
-
MuiTableCell: {
|
105
|
-
styleOverrides: {
|
106
|
-
root: {
|
107
|
-
borderBottomWidth: '0',
|
108
|
-
paddingTop: '14px',
|
109
|
-
paddingBottom: '14px',
|
110
|
-
paddingLeft: 0,
|
111
|
-
paddingRight: '30px'
|
112
|
-
},
|
113
|
-
head: {
|
114
|
-
textTransform: 'uppercase',
|
115
|
-
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
116
|
-
},
|
117
|
-
body: {
|
118
|
-
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
119
|
-
}
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}, overrides),
|
123
|
-
pageWidth,
|
124
|
-
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
125
|
-
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
126
|
-
colors: {
|
127
|
-
white: '#FFFFFF',
|
128
|
-
dark: '#4A707C',
|
129
|
-
gray: '#222222',
|
130
|
-
minor: '#9B9B9B',
|
131
|
-
darkText: '#DCDCDC',
|
132
|
-
background: '#F7F8F8',
|
133
|
-
yellow: '#FFCF71',
|
134
|
-
green: '#44cdc6',
|
135
|
-
red: '#D0021B',
|
136
|
-
blue: '#4E6AF6',
|
137
|
-
primary: '#222222',
|
138
|
-
black: '#222222',
|
139
|
-
secondary: '#44cdc6',
|
140
|
-
mint: '#44cdc6',
|
141
|
-
textSecondary: '#4A4A4A',
|
142
|
-
active: '#5b9025',
|
143
|
-
danger: '#D0021B',
|
144
|
-
lightGrey: '#BCBCBC'
|
145
|
-
},
|
146
|
-
mode
|
147
|
-
}, rest));
|
148
|
-
const enhanced = (0, _styles.responsiveFontSizes)(theme, {
|
149
|
-
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
150
|
-
disableAlign: false,
|
151
|
-
factor: 3,
|
152
|
-
variants: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
|
16
|
+
var _theme = require("./theme");
|
17
|
+
|
18
|
+
Object.keys(_theme).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
21
|
+
if (key in exports && exports[key] === _theme[key]) return;
|
22
|
+
Object.defineProperty(exports, key, {
|
23
|
+
enumerable: true,
|
24
|
+
get: function get() {
|
25
|
+
return _theme[key];
|
26
|
+
}
|
153
27
|
});
|
154
|
-
|
155
|
-
|
28
|
+
});
|
29
|
+
|
30
|
+
var _themeProvider = _interopRequireDefault(require("./theme-provider"));
|
156
31
|
|
157
|
-
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = ThemeProvider;
|
7
|
+
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
|
+
|
10
|
+
var _styledComponents = require("styled-components");
|
11
|
+
|
12
|
+
var _styles = require("@mui/material/styles");
|
13
|
+
|
14
|
+
var _StyledEngineProvider = _interopRequireDefault(require("@mui/material/StyledEngineProvider"));
|
15
|
+
|
16
|
+
var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
|
17
|
+
|
18
|
+
var _theme = require("./theme");
|
19
|
+
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
21
|
+
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
|
+
|
24
|
+
const defaultTheme = (0, _theme.create)();
|
25
|
+
/**
|
26
|
+
* 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
|
27
|
+
* 注: 目前 UX 依赖 styled-components, 所以该组件也内置了一个 StyledThemeProvider
|
28
|
+
*/
|
29
|
+
|
30
|
+
function ThemeProvider(_ref) {
|
31
|
+
let {
|
32
|
+
children,
|
33
|
+
theme
|
34
|
+
} = _ref;
|
35
|
+
return (
|
36
|
+
/*#__PURE__*/
|
37
|
+
// injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
|
38
|
+
(0, _jsxRuntime.jsx)(_StyledEngineProvider.default, {
|
39
|
+
injectFirst: true,
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ThemeProvider, {
|
41
|
+
theme: theme,
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledComponents.ThemeProvider, {
|
43
|
+
theme: theme,
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), children]
|
45
|
+
})
|
46
|
+
})
|
47
|
+
})
|
48
|
+
);
|
49
|
+
}
|
50
|
+
|
51
|
+
ThemeProvider.propTypes = {
|
52
|
+
children: _propTypes.default.any,
|
53
|
+
theme: _propTypes.default.any
|
54
|
+
};
|
55
|
+
ThemeProvider.defaultProps = {
|
56
|
+
children: null,
|
57
|
+
theme: defaultTheme
|
58
|
+
};
|
@@ -0,0 +1,157 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.create = void 0;
|
7
|
+
|
8
|
+
var _styles = require("@mui/material/styles");
|
9
|
+
|
10
|
+
require("@fontsource/lato/400.css");
|
11
|
+
|
12
|
+
require("@fontsource/lato/700.css");
|
13
|
+
|
14
|
+
var _Colors = _interopRequireDefault(require("../Colors"));
|
15
|
+
|
16
|
+
const _excluded = ["mode", "pageWidth", "palette", "typography", "overrides"];
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
30
|
+
const muiDarkTheme = (0, _styles.createTheme)({
|
31
|
+
palette: {
|
32
|
+
mode: 'dark'
|
33
|
+
}
|
34
|
+
}); // https://material-ui.com/customization/default-theme/
|
35
|
+
// eslint-disable-next-line import/prefer-default-export
|
36
|
+
|
37
|
+
const create = function create() {
|
38
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
39
|
+
{
|
40
|
+
mode = 'light',
|
41
|
+
pageWidth = 'md',
|
42
|
+
palette,
|
43
|
+
typography,
|
44
|
+
overrides
|
45
|
+
} = _ref,
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
47
|
+
|
48
|
+
// palette 考虑 light & dark mode, dark mode 需要持续完善
|
49
|
+
// - 能配合 ColorModeContext 使用
|
50
|
+
// - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
|
51
|
+
const _palette = mode === 'light' ? Object.assign(_objectSpread(_objectSpread({}, _Colors.default), {}, {
|
52
|
+
background: {
|
53
|
+
paper: _Colors.default.common.white,
|
54
|
+
default: _Colors.default.background.default
|
55
|
+
},
|
56
|
+
mode
|
57
|
+
}), palette || {}) : Object.assign(_objectSpread(_objectSpread({}, muiDarkTheme.palette), {}, {
|
58
|
+
background: {
|
59
|
+
paper: _Colors.default.grey[900],
|
60
|
+
default: _Colors.default.grey[900]
|
61
|
+
},
|
62
|
+
mode
|
63
|
+
}), palette || {});
|
64
|
+
|
65
|
+
const theme = (0, _styles.createTheme)(_objectSpread({
|
66
|
+
themeName: 'ArcBlock',
|
67
|
+
palette: _palette,
|
68
|
+
typography: Object.assign({
|
69
|
+
useNextVariants: true,
|
70
|
+
color: {
|
71
|
+
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
72
|
+
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
73
|
+
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
74
|
+
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
75
|
+
main: mode === 'light' ? '#222222' : _Colors.default.common.white,
|
76
|
+
gray: mode === 'light' ? _Colors.default.grey[500] : _Colors.default.grey[300]
|
77
|
+
},
|
78
|
+
fontFamily: ['Lato', 'Avenir', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
79
|
+
// 按最新设计规范, 只使用 400/700
|
80
|
+
fontWeightLight: 400,
|
81
|
+
fontWeightRegular: 400,
|
82
|
+
fontWeightMedium: 700,
|
83
|
+
fontWeightBold: 700,
|
84
|
+
// button 默认使用粗体
|
85
|
+
button: {
|
86
|
+
fontWeight: 700
|
87
|
+
}
|
88
|
+
}, typography || {}),
|
89
|
+
components: _objectSpread({
|
90
|
+
MuiButton: {
|
91
|
+
styleOverrides: {
|
92
|
+
root: {
|
93
|
+
boxShadow: 'none'
|
94
|
+
}
|
95
|
+
}
|
96
|
+
},
|
97
|
+
MuiButtonGroup: {
|
98
|
+
styleOverrides: {
|
99
|
+
root: {
|
100
|
+
boxShadow: 'none'
|
101
|
+
}
|
102
|
+
}
|
103
|
+
},
|
104
|
+
MuiTableCell: {
|
105
|
+
styleOverrides: {
|
106
|
+
root: {
|
107
|
+
borderBottomWidth: '0',
|
108
|
+
paddingTop: '14px',
|
109
|
+
paddingBottom: '14px',
|
110
|
+
paddingLeft: 0,
|
111
|
+
paddingRight: '30px'
|
112
|
+
},
|
113
|
+
head: {
|
114
|
+
textTransform: 'uppercase',
|
115
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
116
|
+
},
|
117
|
+
body: {
|
118
|
+
color: mode === 'light' ? _Colors.default.grey[900] : _Colors.default.grey[300]
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}, overrides),
|
123
|
+
pageWidth,
|
124
|
+
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
125
|
+
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
126
|
+
colors: {
|
127
|
+
white: '#FFFFFF',
|
128
|
+
dark: '#4A707C',
|
129
|
+
gray: '#222222',
|
130
|
+
minor: '#9B9B9B',
|
131
|
+
darkText: '#DCDCDC',
|
132
|
+
background: '#F7F8F8',
|
133
|
+
yellow: '#FFCF71',
|
134
|
+
green: '#44cdc6',
|
135
|
+
red: '#D0021B',
|
136
|
+
blue: '#4E6AF6',
|
137
|
+
primary: '#222222',
|
138
|
+
black: '#222222',
|
139
|
+
secondary: '#44cdc6',
|
140
|
+
mint: '#44cdc6',
|
141
|
+
textSecondary: '#4A4A4A',
|
142
|
+
active: '#5b9025',
|
143
|
+
danger: '#D0021B',
|
144
|
+
lightGrey: '#BCBCBC'
|
145
|
+
},
|
146
|
+
mode
|
147
|
+
}, rest));
|
148
|
+
const enhanced = (0, _styles.responsiveFontSizes)(theme, {
|
149
|
+
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
150
|
+
disableAlign: false,
|
151
|
+
factor: 3,
|
152
|
+
variants: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
|
153
|
+
});
|
154
|
+
return enhanced;
|
155
|
+
};
|
156
|
+
|
157
|
+
exports.create = create;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.2.0",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -32,59 +32,59 @@
|
|
32
32
|
"access": "public"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@babel/cli": "^7.
|
36
|
-
"@babel/core": "^7.
|
37
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
38
|
-
"@babel/preset-env": "^7.
|
39
|
-
"@babel/preset-react": "^7.
|
40
|
-
"babel-plugin-inline-react-svg": "^1.1.
|
41
|
-
"babel-plugin-styled-components": "^1.
|
42
|
-
"eslint-plugin-react-hooks": "^4.
|
43
|
-
"jest": "^24.
|
44
|
-
"moment-timezone": "^0.5.
|
35
|
+
"@babel/cli": "^7.18.10",
|
36
|
+
"@babel/core": "^7.18.10",
|
37
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
38
|
+
"@babel/preset-env": "^7.18.10",
|
39
|
+
"@babel/preset-react": "^7.18.6",
|
40
|
+
"babel-plugin-inline-react-svg": "^1.1.2",
|
41
|
+
"babel-plugin-styled-components": "^1.13.3",
|
42
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
43
|
+
"jest": "^24.9.0",
|
44
|
+
"moment-timezone": "^0.5.34"
|
45
45
|
},
|
46
46
|
"peerDependencies": {
|
47
47
|
"@sentry/browser": "^5.0.8",
|
48
48
|
"react": ">=18.1.0",
|
49
49
|
"react-ga": "^2.7.0"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "f3ff79752e56bcfc8623d0ca96631ed4daf280cb",
|
52
52
|
"dependencies": {
|
53
|
-
"@arcblock/icons": "^2.
|
54
|
-
"@arcblock/react-hooks": "^2.
|
53
|
+
"@arcblock/icons": "^2.2.0",
|
54
|
+
"@arcblock/react-hooks": "^2.2.0",
|
55
55
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
56
|
-
"@emotion/react": "^11.
|
57
|
-
"@emotion/styled": "^11.
|
58
|
-
"@fontsource/lato": "^4.5.
|
59
|
-
"@mui/icons-material": "^5.
|
60
|
-
"@mui/material": "^5.
|
56
|
+
"@emotion/react": "^11.10.0",
|
57
|
+
"@emotion/styled": "^11.10.0",
|
58
|
+
"@fontsource/lato": "^4.5.8",
|
59
|
+
"@mui/icons-material": "^5.8.4",
|
60
|
+
"@mui/material": "^5.9.3",
|
61
61
|
"@solana/qr-code-styling": "^1.6.0-beta.0",
|
62
|
-
"axios": "^0.21.
|
62
|
+
"axios": "^0.21.4",
|
63
63
|
"base64-url": "^2.3.3",
|
64
|
-
"copy-to-clipboard": "^3.
|
65
|
-
"core-js": "^3.
|
66
|
-
"d3-geo": "^1.
|
67
|
-
"dayjs": "^1.11.
|
64
|
+
"copy-to-clipboard": "^3.3.1",
|
65
|
+
"core-js": "^3.24.1",
|
66
|
+
"d3-geo": "^1.12.1",
|
67
|
+
"dayjs": "^1.11.4",
|
68
68
|
"devices.css": "^0.1.15",
|
69
|
-
"highlight.js": "^
|
70
|
-
"is-svg": "^4.3.
|
71
|
-
"js-cookie": "^2.2.
|
69
|
+
"highlight.js": "^11.6.0",
|
70
|
+
"is-svg": "^4.3.2",
|
71
|
+
"js-cookie": "^2.2.1",
|
72
72
|
"lodash": "^4.17.21",
|
73
|
-
"mdi-material-ui": "^7.
|
73
|
+
"mdi-material-ui": "^7.4.0",
|
74
74
|
"mui-datatables": "^4.2.2",
|
75
75
|
"notistack": "^2.0.5",
|
76
76
|
"react-cookie-consent": "^6.4.1",
|
77
77
|
"react-error-boundary": "^3.1.4",
|
78
78
|
"react-helmet": "^6.1.0",
|
79
|
-
"react-intersection-observer": "^8.
|
80
|
-
"react-lottie-player": "^1.4.
|
81
|
-
"react-player": "^1.15.
|
82
|
-
"react-router-dom": "^5.
|
83
|
-
"react-shadow": "^19.0.
|
84
|
-
"react-use": "^17.
|
79
|
+
"react-intersection-observer": "^8.34.0",
|
80
|
+
"react-lottie-player": "^1.4.3",
|
81
|
+
"react-player": "^1.15.3",
|
82
|
+
"react-router-dom": "^5.3.3",
|
83
|
+
"react-shadow": "^19.0.3",
|
84
|
+
"react-use": "^17.4.0",
|
85
85
|
"rebound": "^0.1.0",
|
86
|
-
"styled-components": "^5.
|
87
|
-
"topojson-client": "^3.
|
86
|
+
"styled-components": "^5.3.5",
|
87
|
+
"topojson-client": "^3.1.0",
|
88
88
|
"versor": "^0.0.4"
|
89
89
|
}
|
90
90
|
}
|
package/src/CodeBlock/index.js
CHANGED
@@ -6,7 +6,7 @@ import Copy from 'copy-to-clipboard';
|
|
6
6
|
import Button from '@mui/material/IconButton';
|
7
7
|
import useMountedState from 'react-use/lib/useMountedState';
|
8
8
|
|
9
|
-
import hljs from 'highlight.js/lib/
|
9
|
+
import hljs from 'highlight.js/lib/core';
|
10
10
|
import javascript from 'highlight.js/lib/languages/javascript';
|
11
11
|
import typescript from 'highlight.js/lib/languages/typescript';
|
12
12
|
import json from 'highlight.js/lib/languages/json';
|
package/src/Theme/index.js
CHANGED
@@ -1,164 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import '@fontsource/lato/400.css';
|
4
|
-
import '@fontsource/lato/700.css';
|
5
|
-
import colors from '../Colors';
|
6
|
-
|
7
|
-
const muiDarkTheme = createTheme({ palette: { mode: 'dark' } });
|
8
|
-
|
9
|
-
// https://material-ui.com/customization/default-theme/
|
10
|
-
// eslint-disable-next-line import/prefer-default-export
|
11
|
-
export const create = ({ mode = 'light', pageWidth = 'md', palette, typography, overrides, ...rest } = {}) => {
|
12
|
-
// palette 考虑 light & dark mode, dark mode 需要持续完善
|
13
|
-
// - 能配合 ColorModeContext 使用
|
14
|
-
// - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
|
15
|
-
const _palette =
|
16
|
-
mode === 'light'
|
17
|
-
? Object.assign(
|
18
|
-
{
|
19
|
-
...colors,
|
20
|
-
background: {
|
21
|
-
paper: colors.common.white,
|
22
|
-
default: colors.background.default,
|
23
|
-
},
|
24
|
-
mode,
|
25
|
-
},
|
26
|
-
palette || {}
|
27
|
-
)
|
28
|
-
: Object.assign(
|
29
|
-
{
|
30
|
-
...muiDarkTheme.palette,
|
31
|
-
background: {
|
32
|
-
paper: colors.grey[900],
|
33
|
-
default: colors.grey[900],
|
34
|
-
},
|
35
|
-
mode,
|
36
|
-
},
|
37
|
-
palette || {}
|
38
|
-
);
|
39
|
-
|
40
|
-
const theme = createTheme({
|
41
|
-
themeName: 'ArcBlock',
|
42
|
-
palette: _palette,
|
43
|
-
typography: Object.assign(
|
44
|
-
{
|
45
|
-
useNextVariants: true,
|
46
|
-
color: {
|
47
|
-
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
48
|
-
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
49
|
-
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
50
|
-
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
51
|
-
main: mode === 'light' ? '#222222' : colors.common.white,
|
52
|
-
gray: mode === 'light' ? colors.grey[500] : colors.grey[300],
|
53
|
-
},
|
54
|
-
fontFamily: [
|
55
|
-
'Lato',
|
56
|
-
'Avenir',
|
57
|
-
'-apple-system',
|
58
|
-
'BlinkMacSystemFont',
|
59
|
-
'"Segoe UI"',
|
60
|
-
'Roboto',
|
61
|
-
'"Helvetica Neue"',
|
62
|
-
'Arial',
|
63
|
-
'sans-serif',
|
64
|
-
'"Apple Color Emoji"',
|
65
|
-
'"Segoe UI Emoji"',
|
66
|
-
'"Segoe UI Symbol"',
|
67
|
-
].join(','),
|
68
|
-
// 按最新设计规范, 只使用 400/700
|
69
|
-
fontWeightLight: 400,
|
70
|
-
fontWeightRegular: 400,
|
71
|
-
fontWeightMedium: 700,
|
72
|
-
fontWeightBold: 700,
|
73
|
-
// button 默认使用粗体
|
74
|
-
button: {
|
75
|
-
fontWeight: 700,
|
76
|
-
},
|
77
|
-
},
|
78
|
-
typography || {}
|
79
|
-
),
|
80
|
-
components: {
|
81
|
-
MuiButton: {
|
82
|
-
styleOverrides: {
|
83
|
-
root: {
|
84
|
-
boxShadow: 'none',
|
85
|
-
},
|
86
|
-
},
|
87
|
-
},
|
88
|
-
MuiButtonGroup: {
|
89
|
-
styleOverrides: {
|
90
|
-
root: {
|
91
|
-
boxShadow: 'none',
|
92
|
-
},
|
93
|
-
},
|
94
|
-
},
|
95
|
-
MuiTableCell: {
|
96
|
-
styleOverrides: {
|
97
|
-
root: {
|
98
|
-
borderBottomWidth: '0',
|
99
|
-
paddingTop: '14px',
|
100
|
-
paddingBottom: '14px',
|
101
|
-
paddingLeft: 0,
|
102
|
-
paddingRight: '30px',
|
103
|
-
},
|
104
|
-
head: {
|
105
|
-
textTransform: 'uppercase',
|
106
|
-
color: mode === 'light' ? colors.grey[900] : colors.grey[300],
|
107
|
-
},
|
108
|
-
body: {
|
109
|
-
color: mode === 'light' ? colors.grey[900] : colors.grey[300],
|
110
|
-
},
|
111
|
-
},
|
112
|
-
},
|
113
|
-
...overrides,
|
114
|
-
},
|
115
|
-
pageWidth,
|
116
|
-
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
117
|
-
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
118
|
-
colors: {
|
119
|
-
white: '#FFFFFF',
|
120
|
-
dark: '#4A707C',
|
121
|
-
gray: '#222222',
|
122
|
-
minor: '#9B9B9B',
|
123
|
-
darkText: '#DCDCDC',
|
124
|
-
background: '#F7F8F8',
|
125
|
-
yellow: '#FFCF71',
|
126
|
-
green: '#44cdc6',
|
127
|
-
red: '#D0021B',
|
128
|
-
blue: '#4E6AF6',
|
129
|
-
primary: '#222222',
|
130
|
-
black: '#222222',
|
131
|
-
secondary: '#44cdc6',
|
132
|
-
mint: '#44cdc6',
|
133
|
-
textSecondary: '#4A4A4A',
|
134
|
-
active: '#5b9025',
|
135
|
-
danger: '#D0021B',
|
136
|
-
lightGrey: '#BCBCBC',
|
137
|
-
},
|
138
|
-
mode,
|
139
|
-
...rest,
|
140
|
-
});
|
141
|
-
|
142
|
-
const enhanced = responsiveFontSizes(theme, {
|
143
|
-
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
144
|
-
disableAlign: false,
|
145
|
-
factor: 3,
|
146
|
-
variants: [
|
147
|
-
'h1',
|
148
|
-
'h2',
|
149
|
-
'h3',
|
150
|
-
'h4',
|
151
|
-
'h5',
|
152
|
-
'h6',
|
153
|
-
'subtitle1',
|
154
|
-
'subtitle2',
|
155
|
-
'body1',
|
156
|
-
'body2',
|
157
|
-
'caption',
|
158
|
-
'button',
|
159
|
-
'overline',
|
160
|
-
],
|
161
|
-
});
|
162
|
-
|
163
|
-
return enhanced;
|
164
|
-
};
|
1
|
+
export * from './theme';
|
2
|
+
export { default as ThemeProvider } from './theme-provider';
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
import { ThemeProvider as StyledThemeProvider } from 'styled-components';
|
3
|
+
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
4
|
+
import StyledEngineProvider from '@mui/material/StyledEngineProvider';
|
5
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
6
|
+
import { create } from './theme';
|
7
|
+
|
8
|
+
const defaultTheme = create();
|
9
|
+
|
10
|
+
/**
|
11
|
+
* 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
|
12
|
+
* 注: 目前 UX 依赖 styled-components, 所以该组件也内置了一个 StyledThemeProvider
|
13
|
+
*/
|
14
|
+
export default function ThemeProvider({ children, theme }) {
|
15
|
+
return (
|
16
|
+
// injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
|
17
|
+
<StyledEngineProvider injectFirst>
|
18
|
+
<MuiThemeProvider theme={theme}>
|
19
|
+
<StyledThemeProvider theme={theme}>
|
20
|
+
<CssBaseline />
|
21
|
+
{children}
|
22
|
+
</StyledThemeProvider>
|
23
|
+
</MuiThemeProvider>
|
24
|
+
</StyledEngineProvider>
|
25
|
+
);
|
26
|
+
}
|
27
|
+
|
28
|
+
ThemeProvider.propTypes = {
|
29
|
+
children: PropTypes.any,
|
30
|
+
theme: PropTypes.any,
|
31
|
+
};
|
32
|
+
|
33
|
+
ThemeProvider.defaultProps = {
|
34
|
+
children: null,
|
35
|
+
theme: defaultTheme,
|
36
|
+
};
|
@@ -0,0 +1,164 @@
|
|
1
|
+
// https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
|
2
|
+
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
|
3
|
+
import '@fontsource/lato/400.css';
|
4
|
+
import '@fontsource/lato/700.css';
|
5
|
+
import colors from '../Colors';
|
6
|
+
|
7
|
+
const muiDarkTheme = createTheme({ palette: { mode: 'dark' } });
|
8
|
+
|
9
|
+
// https://material-ui.com/customization/default-theme/
|
10
|
+
// eslint-disable-next-line import/prefer-default-export
|
11
|
+
export const create = ({ mode = 'light', pageWidth = 'md', palette, typography, overrides, ...rest } = {}) => {
|
12
|
+
// palette 考虑 light & dark mode, dark mode 需要持续完善
|
13
|
+
// - 能配合 ColorModeContext 使用
|
14
|
+
// - 为 dark mode 系统的设计整个 palette, 不要单个 color 设置
|
15
|
+
const _palette =
|
16
|
+
mode === 'light'
|
17
|
+
? Object.assign(
|
18
|
+
{
|
19
|
+
...colors,
|
20
|
+
background: {
|
21
|
+
paper: colors.common.white,
|
22
|
+
default: colors.background.default,
|
23
|
+
},
|
24
|
+
mode,
|
25
|
+
},
|
26
|
+
palette || {}
|
27
|
+
)
|
28
|
+
: Object.assign(
|
29
|
+
{
|
30
|
+
...muiDarkTheme.palette,
|
31
|
+
background: {
|
32
|
+
paper: colors.grey[900],
|
33
|
+
default: colors.grey[900],
|
34
|
+
},
|
35
|
+
mode,
|
36
|
+
},
|
37
|
+
palette || {}
|
38
|
+
);
|
39
|
+
|
40
|
+
const theme = createTheme({
|
41
|
+
themeName: 'ArcBlock',
|
42
|
+
palette: _palette,
|
43
|
+
typography: Object.assign(
|
44
|
+
{
|
45
|
+
useNextVariants: true,
|
46
|
+
color: {
|
47
|
+
// 此处 #222222 必须硬编码, layout/sidebar.js -> Icon/image 加载图片时 color 会影响加载路径
|
48
|
+
// TODO: 此处硬编码的色值后面需要改为 colors.grey[900],
|
49
|
+
// 或者如果可以的话直接删掉 typography#color, 文本颜色建议使用 theme.palette.text 中的色值?
|
50
|
+
// layout 组件建议重构, sidebar 中建议使用 icon 替换 img (#366)
|
51
|
+
main: mode === 'light' ? '#222222' : colors.common.white,
|
52
|
+
gray: mode === 'light' ? colors.grey[500] : colors.grey[300],
|
53
|
+
},
|
54
|
+
fontFamily: [
|
55
|
+
'Lato',
|
56
|
+
'Avenir',
|
57
|
+
'-apple-system',
|
58
|
+
'BlinkMacSystemFont',
|
59
|
+
'"Segoe UI"',
|
60
|
+
'Roboto',
|
61
|
+
'"Helvetica Neue"',
|
62
|
+
'Arial',
|
63
|
+
'sans-serif',
|
64
|
+
'"Apple Color Emoji"',
|
65
|
+
'"Segoe UI Emoji"',
|
66
|
+
'"Segoe UI Symbol"',
|
67
|
+
].join(','),
|
68
|
+
// 按最新设计规范, 只使用 400/700
|
69
|
+
fontWeightLight: 400,
|
70
|
+
fontWeightRegular: 400,
|
71
|
+
fontWeightMedium: 700,
|
72
|
+
fontWeightBold: 700,
|
73
|
+
// button 默认使用粗体
|
74
|
+
button: {
|
75
|
+
fontWeight: 700,
|
76
|
+
},
|
77
|
+
},
|
78
|
+
typography || {}
|
79
|
+
),
|
80
|
+
components: {
|
81
|
+
MuiButton: {
|
82
|
+
styleOverrides: {
|
83
|
+
root: {
|
84
|
+
boxShadow: 'none',
|
85
|
+
},
|
86
|
+
},
|
87
|
+
},
|
88
|
+
MuiButtonGroup: {
|
89
|
+
styleOverrides: {
|
90
|
+
root: {
|
91
|
+
boxShadow: 'none',
|
92
|
+
},
|
93
|
+
},
|
94
|
+
},
|
95
|
+
MuiTableCell: {
|
96
|
+
styleOverrides: {
|
97
|
+
root: {
|
98
|
+
borderBottomWidth: '0',
|
99
|
+
paddingTop: '14px',
|
100
|
+
paddingBottom: '14px',
|
101
|
+
paddingLeft: 0,
|
102
|
+
paddingRight: '30px',
|
103
|
+
},
|
104
|
+
head: {
|
105
|
+
textTransform: 'uppercase',
|
106
|
+
color: mode === 'light' ? colors.grey[900] : colors.grey[300],
|
107
|
+
},
|
108
|
+
body: {
|
109
|
+
color: mode === 'light' ? colors.grey[900] : colors.grey[300],
|
110
|
+
},
|
111
|
+
},
|
112
|
+
},
|
113
|
+
...overrides,
|
114
|
+
},
|
115
|
+
pageWidth,
|
116
|
+
// TODO: 过时的 colors, 需要各项目负责人检查项目中是否使用 "theme.colors", 如果有需要清除,
|
117
|
+
// 可以从 Colors 模块/theme.palette/mui colors 中取值
|
118
|
+
colors: {
|
119
|
+
white: '#FFFFFF',
|
120
|
+
dark: '#4A707C',
|
121
|
+
gray: '#222222',
|
122
|
+
minor: '#9B9B9B',
|
123
|
+
darkText: '#DCDCDC',
|
124
|
+
background: '#F7F8F8',
|
125
|
+
yellow: '#FFCF71',
|
126
|
+
green: '#44cdc6',
|
127
|
+
red: '#D0021B',
|
128
|
+
blue: '#4E6AF6',
|
129
|
+
primary: '#222222',
|
130
|
+
black: '#222222',
|
131
|
+
secondary: '#44cdc6',
|
132
|
+
mint: '#44cdc6',
|
133
|
+
textSecondary: '#4A4A4A',
|
134
|
+
active: '#5b9025',
|
135
|
+
danger: '#D0021B',
|
136
|
+
lightGrey: '#BCBCBC',
|
137
|
+
},
|
138
|
+
mode,
|
139
|
+
...rest,
|
140
|
+
});
|
141
|
+
|
142
|
+
const enhanced = responsiveFontSizes(theme, {
|
143
|
+
breakpoints: ['xs', 'sm', 'md', 'lg'],
|
144
|
+
disableAlign: false,
|
145
|
+
factor: 3,
|
146
|
+
variants: [
|
147
|
+
'h1',
|
148
|
+
'h2',
|
149
|
+
'h3',
|
150
|
+
'h4',
|
151
|
+
'h5',
|
152
|
+
'h6',
|
153
|
+
'subtitle1',
|
154
|
+
'subtitle2',
|
155
|
+
'body1',
|
156
|
+
'body2',
|
157
|
+
'caption',
|
158
|
+
'button',
|
159
|
+
'overline',
|
160
|
+
],
|
161
|
+
});
|
162
|
+
|
163
|
+
return enhanced;
|
164
|
+
};
|