@arcblock/ux 2.4.2 → 2.4.3
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/ActivityIndicator/index.js +4 -6
- package/lib/Alert/index.js +3 -4
- package/lib/AnimationWaiter/index.js +3 -4
- package/lib/Badge/index.js +3 -3
- package/lib/Blocklet/blocklet.js +4 -6
- package/lib/Blocklet/utils.js +2 -5
- package/lib/BlockletNFT/index.js +4 -6
- package/lib/Center/index.js +3 -4
- package/lib/ClickToCopy/index.js +3 -3
- package/lib/CodeBlock/index.js +3 -4
- package/lib/ContactForm/index.js +3 -3
- package/lib/CookieConsent/index.js +3 -4
- package/lib/CountDown/index.js +3 -4
- package/lib/Datatable/CustomToolbar.js +5 -9
- package/lib/Datatable/TableSearch.js +3 -4
- package/lib/Datatable/index.js +5 -7
- package/lib/Dialog/dialog.js +5 -9
- package/lib/Earth/index.js +4 -6
- package/lib/Empty/index.js +3 -3
- package/lib/ErrorBoundary/fallback.js +4 -7
- package/lib/Footer/index.js +3 -4
- package/lib/Header/auto-hidden.js +3 -3
- package/lib/Header/header.js +4 -8
- package/lib/Header/responsive-header.js +5 -7
- package/lib/Icon/image.js +3 -4
- package/lib/Icon/index.js +3 -4
- package/lib/Img/index.js +3 -3
- package/lib/InfoRow/index.js +3 -5
- package/lib/Layout/dashboard/index.js +5 -9
- package/lib/Layout/dashboard/sidebar.js +3 -5
- package/lib/Layout/dashboard-legacy/header.js +3 -3
- package/lib/Layout/dashboard-legacy/index.js +3 -3
- package/lib/Layout/dashboard-legacy/sidebar.js +5 -7
- package/lib/Layout/index.js +4 -6
- package/lib/Locale/selector.js +4 -7
- package/lib/Logo/index.js +2 -3
- package/lib/Metric/index.js +3 -4
- package/lib/NFTDisplay/aspect-ratio-container.js +2 -4
- package/lib/NFTDisplay/broken.js +3 -3
- package/lib/NFTDisplay/index.js +3 -4
- package/lib/NFTDisplay/loading.js +2 -4
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +4 -6
- package/lib/NavMenu/style.js +4 -7
- package/lib/PricingTable/PricingPlan.js +3 -3
- package/lib/PricingTable/index.js +3 -4
- package/lib/Result/common.js +4 -4
- package/lib/Result/result.js +3 -5
- package/lib/Screenshot/index.js +3 -4
- package/lib/SplitButton/index.js +4 -4
- package/lib/Switch/index.js +3 -3
- package/lib/Tabs/index.js +3 -3
- package/lib/Tag/index.js +4 -6
- package/lib/TextCollapse/index.js +2 -2
- package/lib/Theme/index.js +16 -0
- package/lib/Theme/theme-provider.js +3 -8
- package/lib/Theme/theme.js +4 -2
- package/lib/Video/index.js +3 -4
- package/lib/Wallet/Action.js +3 -4
- package/lib/Wallet/Download.js +3 -4
- package/lib/Wallet/Open.js +3 -3
- package/lib/WechatPrompt/index.js +3 -3
- package/lib/withTheme/index.js +18 -40
- package/package.json +4 -4
- package/src/ActivityIndicator/index.js +3 -3
- package/src/Alert/index.js +2 -2
- package/src/AnimationWaiter/index.js +3 -2
- package/src/Badge/index.js +1 -2
- package/src/Blocklet/blocklet.js +2 -3
- package/src/Blocklet/utils.js +2 -2
- package/src/BlockletNFT/index.js +2 -3
- package/src/Center/index.js +3 -2
- package/src/ClickToCopy/index.js +2 -1
- package/src/CodeBlock/index.js +2 -2
- package/src/ContactForm/index.js +2 -3
- package/src/CookieConsent/index.js +3 -2
- package/src/CountDown/index.js +2 -2
- package/src/Datatable/CustomToolbar.js +3 -4
- package/src/Datatable/TableSearch.js +2 -2
- package/src/Datatable/index.js +4 -4
- package/src/Dialog/dialog.js +3 -3
- package/src/Earth/index.js +3 -3
- package/src/Empty/index.js +3 -2
- package/src/ErrorBoundary/fallback.js +2 -3
- package/src/Footer/index.js +2 -2
- package/src/Header/auto-hidden.js +2 -1
- package/src/Header/header.js +2 -3
- package/src/Header/responsive-header.js +1 -2
- package/src/Icon/image.js +2 -2
- package/src/Icon/index.js +2 -2
- package/src/Img/index.js +1 -1
- package/src/InfoRow/index.js +3 -2
- package/src/Layout/dashboard/index.js +2 -3
- package/src/Layout/dashboard/sidebar.js +3 -3
- package/src/Layout/dashboard-legacy/header.js +1 -1
- package/src/Layout/dashboard-legacy/index.js +2 -2
- package/src/Layout/dashboard-legacy/sidebar.js +2 -4
- package/src/Layout/index.js +3 -3
- package/src/Locale/selector.js +2 -4
- package/src/Logo/index.js +3 -2
- package/src/Metric/index.js +2 -2
- package/src/NFTDisplay/aspect-ratio-container.js +3 -2
- package/src/NFTDisplay/broken.js +2 -1
- package/src/NFTDisplay/index.js +3 -2
- package/src/NFTDisplay/loading.js +2 -2
- package/src/NFTDisplay/svg-embedder/inline-svg.js +3 -2
- package/src/NavMenu/style.js +2 -2
- package/src/PricingTable/PricingPlan.js +2 -2
- package/src/PricingTable/index.js +2 -2
- package/src/Result/common.js +1 -1
- package/src/Result/result.js +3 -2
- package/src/Screenshot/index.js +2 -2
- package/src/SplitButton/index.js +2 -1
- package/src/Switch/index.js +1 -1
- package/src/Tabs/index.js +1 -1
- package/src/Tag/index.js +1 -3
- package/src/TextCollapse/index.js +2 -2
- package/src/Theme/index.js +1 -0
- package/src/Theme/theme-provider.js +4 -7
- package/src/Theme/theme.js +5 -3
- package/src/Video/index.js +2 -3
- package/src/Wallet/Action.js +2 -3
- package/src/Wallet/Download.js +2 -3
- package/src/Wallet/Open.js +2 -1
- package/src/WechatPrompt/index.js +2 -3
- package/src/withTheme/index.js +41 -54
package/lib/Earth/index.js
CHANGED
@@ -11,8 +11,6 @@ var _useSpring = _interopRequireDefault(require("react-use/lib/useSpring"));
|
|
11
11
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
13
|
|
14
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
15
|
-
|
16
14
|
var d3 = _interopRequireWildcard(require("d3-geo"));
|
17
15
|
|
18
16
|
var topojson = _interopRequireWildcard(require("topojson-client"));
|
@@ -23,6 +21,8 @@ var _countries = _interopRequireDefault(require("./countries.json"));
|
|
23
21
|
|
24
22
|
var _util = _interopRequireDefault(require("./util"));
|
25
23
|
|
24
|
+
var _Theme = require("../Theme");
|
25
|
+
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
27
27
|
|
28
28
|
var _templateObject, _templateObject2;
|
@@ -447,7 +447,5 @@ Earth.defaultProps = {
|
|
447
447
|
activeMarkerId: undefined,
|
448
448
|
colors: {}
|
449
449
|
};
|
450
|
-
|
451
|
-
const
|
452
|
-
|
453
|
-
const Tooltip = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n width: auto;\n min-width: 90px;\n max-width: 320px;\n padding: 8px 12px;\n font-size: 14px;\n background-color: #4a4a4a;\n border-radius: 2px;\n animation-name: fadeIn;\n animation-duration: 250ms;\n animation-iteration-count: 1;\n animation-timing-function: ease;\n\n .title,\n .description {\n margin: 0;\n font-size: 16px;\n color: #fff;\n }\n\n .description {\n margin-top: ", "px;\n color: #fff;\n font-size: 12px;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n"])), props => props.theme.spacing(1));
|
450
|
+
const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n position: relative;\n animation-name: zoomIn;\n animation-duration: 1s;\n animation-iteration-count: 1;\n animation-timing-function: ease;\n user-select: none;\n\n .defs {\n height: 0;\n width: 0;\n }\n\n .frame {\n fill: none;\n pointer-events: all;\n }\n\n .country {\n fill: ", ";\n stroke: ", ";\n stroke-width: 0.5px;\n transition: fill 300ms ease;\n\n &:hover {\n fill: ", ";\n }\n }\n\n .country--active {\n fill: ", ";\n }\n\n .globe {\n fill: ", ";\n stroke: rgba(255, 255, 255, 0.5);\n stroke-width: 0.25px;\n }\n\n .graticule {\n fill: none;\n stroke: ", ";\n }\n\n .star {\n fill: #fff;\n stroke: rgba(255, 255, 255, 0.5);\n stroke-width: 0.25px;\n }\n\n .marker {\n .marker__outer {\n fill-opacity: 0;\n animation: scaleIn 2s infinite ease-in-out;\n }\n }\n\n @keyframes zoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.1, 0.1, 0.1);\n }\n\n 50% {\n opacity: 1;\n }\n }\n\n @keyframes scaleIn {\n from {\n fill-opacity: 0.3;\n transform: scale3d(0.5, 0.5, 0.5);\n }\n to {\n fill-opacity: 0;\n transform: scale3d(1.5, 1.5, 1.5);\n }\n }\n"])), props => props.theme === 'light' ? '#f7f7f7' : '#222', props => props.width, props => props.height, props => props.colors.land, props => props.colors.border, props => props.colors.activeLand, props => props.colors.activeLand, props => props.colors.ocean, props => props.colors.graticule);
|
451
|
+
const Tooltip = (0, _Theme.styled)('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n width: auto;\n min-width: 90px;\n max-width: 320px;\n padding: 8px 12px;\n font-size: 14px;\n background-color: #4a4a4a;\n border-radius: 2px;\n animation-name: fadeIn;\n animation-duration: 250ms;\n animation-iteration-count: 1;\n animation-timing-function: ease;\n\n .title,\n .description {\n margin: 0;\n font-size: 16px;\n color: #fff;\n }\n\n .description {\n margin-top: ", "px;\n color: #fff;\n font-size: 12px;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n"])), props => props.theme.spacing(1));
|
package/lib/Empty/index.js
CHANGED
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
13
11
|
|
12
|
+
var _Theme = require("../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
const _excluded = ["name", "color", "size", "children"];
|
@@ -31,7 +31,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
31
31
|
|
32
32
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
33
33
|
|
34
|
-
const Wrapper =
|
34
|
+
const Wrapper = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n min-height: 100px;\n color: #999;\n .empty-icon {\n margin: 10px 0;\n }\n"])));
|
35
35
|
|
36
36
|
function Empty(_ref) {
|
37
37
|
let {
|
@@ -8,14 +8,12 @@ exports.ErrorFallbackRetry = ErrorFallbackRetry;
|
|
8
8
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
10
10
|
|
11
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
12
|
-
|
13
|
-
var _styles = require("@mui/material/styles");
|
14
|
-
|
15
11
|
var _colors = require("@mui/material/colors");
|
16
12
|
|
17
13
|
var _Button = _interopRequireDefault(require("../Button"));
|
18
14
|
|
15
|
+
var _Theme = require("../Theme");
|
16
|
+
|
19
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
20
18
|
|
21
19
|
var _templateObject;
|
@@ -30,7 +28,7 @@ function InternalErrorFallback(_ref) {
|
|
30
28
|
desc,
|
31
29
|
retryFunc
|
32
30
|
} = _ref;
|
33
|
-
const theme = (0,
|
31
|
+
const theme = (0, _Theme.useTheme)();
|
34
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
|
35
33
|
role: "alert",
|
36
34
|
$theme: theme,
|
@@ -86,5 +84,4 @@ ErrorFallbackRetry.propTypes = {
|
|
86
84
|
error: _propTypes.default.instanceOf(Error).isRequired,
|
87
85
|
resetErrorBoundary: _propTypes.default.func.isRequired
|
88
86
|
};
|
89
|
-
|
90
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px;\n border: 2px solid ", ";\n border-radius: 4px;\n color: ", ";\n background-color: ", ";\n font-size: 14px;\n h3 {\n margin: 0;\n font-size: 16px;\n }\n pre {\n white-space: normal;\n }\n"])), props => props.$theme.palette.error.main, props => props.$theme.palette.error.main, _colors.red[50]);
|
87
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px;\n border: 2px solid ", ";\n border-radius: 4px;\n color: ", ";\n background-color: ", ";\n font-size: 14px;\n h3 {\n margin: 0;\n font-size: 16px;\n }\n pre {\n white-space: normal;\n }\n"])), props => props.$theme.palette.error.main, props => props.$theme.palette.error.main, _colors.red[50]);
|
package/lib/Footer/index.js
CHANGED
@@ -7,8 +7,6 @@ exports.default = Footer;
|
|
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 _Container = _interopRequireDefault(require("@mui/material/Container"));
|
@@ -17,6 +15,8 @@ var _Util = require("../Util");
|
|
17
15
|
|
18
16
|
var _Logo = _interopRequireDefault(require("../Logo"));
|
19
17
|
|
18
|
+
var _Theme = require("../Theme");
|
19
|
+
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
21
|
|
22
22
|
var _templateObject;
|
@@ -88,8 +88,7 @@ Footer.defaultProps = {
|
|
88
88
|
className: '',
|
89
89
|
style: {}
|
90
90
|
};
|
91
|
-
|
92
|
-
const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 64px;\n padding: 24px 0 32px;\n border-top: 1px solid ", ";\n box-sizing: border-box;\n width: 100%;\n\n @media (max-width: 540px) {\n padding: 8px 0;\n }\n\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n .footer-item {\n color: ", ";\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n font-size: 0.9rem;\n }\n\n .footer-brand {\n margin-left: 8px;\n margin-right: 8px;\n }\n\n .logo-container {\n margin-left: 24px;\n width: 90px;\n opacity: 0.5;\n }\n\n @media (max-width: 540px) {\n .footer-item {\n font-size: 0.7rem;\n }\n\n .logo-container {\n margin: 0 0 0 16px;\n width: 70px;\n height: 40px;\n }\n }\n\n @media (max-width: 380px) {\n .footer-item {\n font-size: 0.65rem;\n }\n\n .logo-container {\n margin: 0 0 0 8px;\n height: 24px;\n }\n }\n }\n"])), props => props.dark ? props.theme.palette.grey[900] : '#dee2e7', _ref => {
|
91
|
+
const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 64px;\n padding: 24px 0 32px;\n border-top: 1px solid ", ";\n box-sizing: border-box;\n width: 100%;\n\n @media (max-width: 540px) {\n padding: 8px 0;\n }\n\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n .footer-item {\n color: ", ";\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n font-size: 0.9rem;\n }\n\n .footer-brand {\n margin-left: 8px;\n margin-right: 8px;\n }\n\n .logo-container {\n margin-left: 24px;\n width: 90px;\n opacity: 0.5;\n }\n\n @media (max-width: 540px) {\n .footer-item {\n font-size: 0.7rem;\n }\n\n .logo-container {\n margin: 0 0 0 16px;\n width: 70px;\n height: 40px;\n }\n }\n\n @media (max-width: 380px) {\n .footer-item {\n font-size: 0.65rem;\n }\n\n .logo-container {\n margin: 0 0 0 8px;\n height: 24px;\n }\n }\n }\n"])), props => props.dark ? props.theme.palette.grey[900] : '#dee2e7', _ref => {
|
93
92
|
let {
|
94
93
|
theme,
|
95
94
|
dark
|
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
13
11
|
|
12
|
+
var _Theme = require("../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
var _templateObject;
|
@@ -48,6 +48,6 @@ function AutoHidden(_ref) {
|
|
48
48
|
AutoHidden.propTypes = {
|
49
49
|
height: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
50
50
|
};
|
51
|
-
const Root = (0,
|
51
|
+
const Root = (0, _Theme.styled)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n &:before {\n content: '';\n display: inline-block;\n width: 1px;\n height: 100%;\n float: left;\n }\n > * {\n float: left;\n white-space: nowrap;\n }\n"])));
|
52
52
|
var _default = AutoHidden;
|
53
53
|
exports.default = _default;
|
package/lib/Header/header.js
CHANGED
@@ -7,16 +7,14 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
13
11
|
|
14
12
|
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
15
13
|
|
16
|
-
var _styles = require("@mui/material/styles");
|
17
|
-
|
18
14
|
var _autoHidden = _interopRequireDefault(require("./auto-hidden"));
|
19
15
|
|
16
|
+
var _Theme = require("../Theme");
|
17
|
+
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
19
|
|
22
20
|
var _templateObject;
|
@@ -54,7 +52,7 @@ function Header(_ref) {
|
|
54
52
|
} = _ref,
|
55
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
56
54
|
|
57
|
-
const theme = (0,
|
55
|
+
const theme = (0, _Theme.useTheme)();
|
58
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, _objectSpread(_objectSpread({}, rest), {}, {
|
59
57
|
$theme: theme,
|
60
58
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Container.default, {
|
@@ -123,8 +121,6 @@ Header.defaultProps = {
|
|
123
121
|
prepend: null,
|
124
122
|
align: 'left'
|
125
123
|
};
|
126
|
-
|
127
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n z-index: ", ";\n font-size: 14px;\n background: ", ";\n .header-container {\n display: flex;\n align-items: center;\n height: 64px;\n }\n .header-logo {\n display: inline-flex;\n position: relative;\n height: 44px;\n margin-right: 16px;\n img,\n svg {\n width: auto;\n height: 100%;\n max-height: 100%;\n }\n > a {\n height: 100%;\n line-height: 1;\n }\n > a::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: transparent;\n content: '';\n }\n }\n .header-brand {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 44px;\n margin-right: 16px;\n line-height: 1;\n a {\n color: inherit;\n text-decoration: none;\n }\n .header-brand-title {\n display: flex;\n align-items: center;\n h2 {\n margin: 0;\n font-size: 16px;\n }\n }\n .header-brand-desc {\n margin-top: 4px;\n color: #9397a1;\n }\n }\n .header-brand-addon {\n margin-right: 16px;\n }\n .header-addons {\n display: flex;\n align-items: center;\n }\n ", " {\n .header-brand {\n margin-right: 12px;\n .header-brand-title {\n h2 {\n font-size: 14px;\n }\n }\n }\n }\n ", " {\n .header-menu {\n display: inline-block;\n }\n .header-logo {\n height: 32px;\n }\n .header-brand {\n .header-brand-title {\n h2 {\n font-size: 13px;\n }\n }\n .header-brand-desc {\n font-size: 12px;\n }\n }\n .header-brand-addon {\n display: none;\n }\n }\n"])), props => props.$theme.zIndex.appBar, props => props.$theme.palette.common.white, props => props.$theme.breakpoints.down('lg'), props => props.$theme.breakpoints.down('md'));
|
128
|
-
|
124
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n z-index: ", ";\n font-size: 14px;\n background: ", ";\n .header-container {\n display: flex;\n align-items: center;\n height: 64px;\n }\n .header-logo {\n display: inline-flex;\n position: relative;\n height: 44px;\n margin-right: 16px;\n img,\n svg {\n width: auto;\n height: 100%;\n max-height: 100%;\n }\n > a {\n height: 100%;\n line-height: 1;\n }\n > a::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: transparent;\n content: '';\n }\n }\n .header-brand {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 44px;\n margin-right: 16px;\n line-height: 1;\n a {\n color: inherit;\n text-decoration: none;\n }\n .header-brand-title {\n display: flex;\n align-items: center;\n h2 {\n margin: 0;\n font-size: 16px;\n }\n }\n .header-brand-desc {\n margin-top: 4px;\n color: #9397a1;\n }\n }\n .header-brand-addon {\n margin-right: 16px;\n }\n .header-addons {\n display: flex;\n align-items: center;\n }\n ", " {\n .header-brand {\n margin-right: 12px;\n .header-brand-title {\n h2 {\n font-size: 14px;\n }\n }\n }\n }\n ", " {\n .header-menu {\n display: inline-block;\n }\n .header-logo {\n height: 32px;\n }\n .header-brand {\n .header-brand-title {\n h2 {\n font-size: 13px;\n }\n }\n .header-brand-desc {\n font-size: 12px;\n }\n }\n .header-brand-addon {\n display: none;\n }\n }\n"])), props => props.$theme.zIndex.appBar, props => props.$theme.palette.common.white, props => props.$theme.breakpoints.down('lg'), props => props.$theme.breakpoints.down('md'));
|
129
125
|
var _default = Header;
|
130
126
|
exports.default = _default;
|
@@ -9,8 +9,6 @@ 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 _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
|
15
13
|
|
16
14
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
@@ -19,14 +17,14 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
19
17
|
|
20
18
|
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
21
19
|
|
22
|
-
var _styles = require("@mui/material/styles");
|
23
|
-
|
24
20
|
var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
|
25
21
|
|
26
22
|
var _Drawer = _interopRequireDefault(require("@mui/material/Drawer"));
|
27
23
|
|
28
24
|
var _header = _interopRequireDefault(require("./header"));
|
29
25
|
|
26
|
+
var _Theme = require("../Theme");
|
27
|
+
|
30
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
31
29
|
|
32
30
|
var _templateObject, _templateObject2;
|
@@ -62,7 +60,7 @@ function ResponsiveHeader(_ref) {
|
|
62
60
|
} = _ref,
|
63
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
64
62
|
|
65
|
-
const theme = (0,
|
63
|
+
const theme = (0, _Theme.useTheme)();
|
66
64
|
const isMobile = (0, _useMediaQuery.default)(theme.breakpoints.down('md'));
|
67
65
|
const [drawerOpen, setDrawerOpen] = (0, _react.useState)(false);
|
68
66
|
|
@@ -125,7 +123,7 @@ ResponsiveHeader.propTypes = _objectSpread(_objectSpread({}, _header.default.Pro
|
|
125
123
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
|
126
124
|
});
|
127
125
|
ResponsiveHeader.defaultProps = _objectSpread({}, _header.default.defaultProps);
|
128
|
-
const Root = (0,
|
129
|
-
const MenuPanel = (0,
|
126
|
+
const Root = (0, _Theme.styled)(_header.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .header-menu {\n display: none;\n }\n ", " {\n .header-menu {\n display: flex;\n margin-right: 12px;\n }\n }\n"])), props => props.$theme.breakpoints.down('md'));
|
127
|
+
const MenuPanel = (0, _Theme.styled)(_Container.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: 8px;\n padding-bottom: 16px;\n .navmenu {\n margin: 0 -16px;\n .navmenu-root > .navmenu-item,\n .navmenu-root > .navmenu-sub {\n border: 0;\n }\n }\n"])));
|
130
128
|
var _default = ResponsiveHeader;
|
131
129
|
exports.default = _default;
|
package/lib/Icon/image.js
CHANGED
@@ -7,10 +7,10 @@ exports.default = ImageIcon;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Img = _interopRequireDefault(require("../Img"));
|
13
11
|
|
12
|
+
var _Theme = require("../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
var _templateObject;
|
@@ -80,5 +80,4 @@ ImageIcon.defaultProps = {
|
|
80
80
|
prefix: '/images',
|
81
81
|
showBadge: false
|
82
82
|
};
|
83
|
-
|
84
|
-
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n .badge-point {\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background-color: #fe4e44;\n right: -2px;\n top: 0;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3), 0px 0px 20px rgba(0, 0, 0, 0.1);\n }\n"])));
|
83
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n .badge-point {\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background-color: #fe4e44;\n right: -2px;\n top: 0;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3), 0px 0px 20px rgba(0, 0, 0, 0.1);\n }\n"])));
|
package/lib/Icon/index.js
CHANGED
@@ -9,10 +9,10 @@ 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 _Colors = _interopRequireDefault(require("../Colors"));
|
15
13
|
|
14
|
+
var _Theme = require("../Theme");
|
15
|
+
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
17
|
|
18
18
|
var _templateObject;
|
@@ -92,8 +92,7 @@ Icon.defaultProps = {
|
|
92
92
|
size: 24,
|
93
93
|
style: {}
|
94
94
|
};
|
95
|
-
|
96
|
-
const Span = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n border: 1px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n\n .fa,\n .fas,\n .fal,\n .far {\n line-height: ", "px;\n }\n"])), props => props.size * 2, props => props.size * 2, props => props.color, props => props.size);
|
95
|
+
const Span = (0, _Theme.styled)('span')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n border: 1px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n\n .fa,\n .fas,\n .fal,\n .far {\n line-height: ", "px;\n }\n"])), props => props.size * 2, props => props.size * 2, props => props.color, props => props.size);
|
97
96
|
|
98
97
|
var _default = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, _objectSpread(_objectSpread({}, props), {}, {
|
99
98
|
forwardedRef: ref
|
package/lib/Img/index.js
CHANGED
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _react = require("react");
|
9
9
|
|
10
|
-
var _styles = require("@mui/material/styles");
|
11
|
-
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
11
|
|
14
12
|
var _material = require("@mui/material");
|
@@ -19,6 +17,8 @@ var _Alert = _interopRequireDefault(require("mdi-material-ui/Alert"));
|
|
19
17
|
|
20
18
|
var _Image = _interopRequireDefault(require("mdi-material-ui/Image"));
|
21
19
|
|
20
|
+
var _Theme = require("../Theme");
|
21
|
+
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
23
23
|
|
24
24
|
const _excluded = ["lazy", "width", "height", "repeat", "ratio", "alt", "size", "position", "src", "placeholder", "fallback", "style", "className", "onError", "onSuccess"];
|
@@ -39,7 +39,7 @@ const PREFIX = 'Img';
|
|
39
39
|
const classes = {
|
40
40
|
root: "".concat(PREFIX, "-root")
|
41
41
|
};
|
42
|
-
const Root = (0,
|
42
|
+
const Root = (0, _Theme.styled)('div')(() => ({
|
43
43
|
["& .".concat(classes.root)]: {
|
44
44
|
position: 'relative',
|
45
45
|
overflow: 'hidden',
|
package/lib/InfoRow/index.js
CHANGED
@@ -11,10 +11,10 @@ var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
11
11
|
|
12
12
|
var _upperFirst = _interopRequireDefault(require("lodash/upperFirst"));
|
13
13
|
|
14
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
15
|
-
|
16
14
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
17
15
|
|
16
|
+
var _Theme = require("../Theme");
|
17
|
+
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
19
19
|
|
20
20
|
var _templateObject;
|
@@ -81,8 +81,6 @@ InfoRow.defaultProps = {
|
|
81
81
|
valueComponent: 'div',
|
82
82
|
layout: 'horizontal'
|
83
83
|
};
|
84
|
-
|
85
|
-
const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n justify-content: flex-start;\n align-items: ", ";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ", "px;\n margin-right: ", ";\n margin-bottom: ", ";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ", "px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])), props => props.layout === 'vertical' ? 'column' : 'row', props => props.layout === 'vertical' ? 'flex-start' : 'center', props => props.width, props => props.layout === 'vertical' ? '0' : '8px', props => props.layout === 'vertical' ? '8px' : '0', props => props.theme.breakpoints.values.md);
|
86
|
-
|
84
|
+
const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n justify-content: flex-start;\n align-items: ", ";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ", "px;\n margin-right: ", ";\n margin-bottom: ", ";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ", "px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])), props => props.layout === 'vertical' ? 'column' : 'row', props => props.layout === 'vertical' ? 'flex-start' : 'center', props => props.width, props => props.layout === 'vertical' ? '0' : '8px', props => props.layout === 'vertical' ? '8px' : '0', props => props.theme.breakpoints.values.md);
|
87
85
|
var _default = InfoRow;
|
88
86
|
exports.default = _default;
|
@@ -13,10 +13,6 @@ var _reactRouterDom = require("react-router-dom");
|
|
13
13
|
|
14
14
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
15
15
|
|
16
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
17
|
-
|
18
|
-
var _styles = require("@mui/material/styles");
|
19
|
-
|
20
16
|
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
21
17
|
|
22
18
|
var _Hidden = _interopRequireDefault(require("@mui/material/Hidden"));
|
@@ -37,6 +33,8 @@ var _sidebar = _interopRequireDefault(require("./sidebar"));
|
|
37
33
|
|
38
34
|
var _withExternalLink = require("./with-external-link");
|
39
35
|
|
36
|
+
var _Theme = require("../../Theme");
|
37
|
+
|
40
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
41
39
|
|
42
40
|
var _templateObject, _templateObject2;
|
@@ -106,7 +104,7 @@ function Dashboard(_ref2) {
|
|
106
104
|
} = _ref2,
|
107
105
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
108
106
|
|
109
|
-
const theme = (0,
|
107
|
+
const theme = (0, _Theme.useTheme)();
|
110
108
|
const location = (0, _reactRouterDom.useLocation)();
|
111
109
|
const navItems = (0, _react.useMemo)(() => formatLinks(links, location), [location, links]);
|
112
110
|
const flattendNavItems = navItems.flat();
|
@@ -184,10 +182,8 @@ Dashboard.defaultProps = {
|
|
184
182
|
sidebarWidth: 120,
|
185
183
|
dense: 'auto'
|
186
184
|
};
|
187
|
-
|
188
|
-
const
|
189
|
-
|
190
|
-
const StyledUxHeader = (0, _styled.default)(_Header.ResponsiveHeader)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .header-container {\n max-width: 100%;\n }\n"]))); // 兼容旧版 dashboard
|
185
|
+
const Wrapper = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.dashboard {\n display: flex;\n flex-direction: column;\n height: 100vh;\n }\n .dashboard-body {\n overflow: hidden;\n flex: 1;\n }\n .dashboard-sidebar {\n box-sizing: border-box;\n flex: 0 0 auto;\n width: ", "px;\n &:hover {\n overflow-y: auto;\n }\n }\n .dashboard-main {\n display: flex;\n flex-direction: column;\n overflow: auto;\n flex: 1;\n }\n .dashboard-content {\n flex: 1;\n }\n &.dashboard-dense {\n .dashboard-sidebar {\n width: auto;\n }\n }\n ", " {\n .header-logo {\n display: flex;\n justify-content: center;\n /* logo \u4E0E sidebar \u4E2D\u7684 icon \u5782\u76F4\u5BF9\u9F50, sidebarWidth - 24 * 2 */\n width: ", "px;\n }\n &.dashboard-dense {\n .header-logo {\n /* dense = true \u65F6 logo \u4E0E sidenav icons \u4E0D\u9700\u8981\u5BF9\u9F50 */\n width: auto;\n }\n }\n }\n"])), props => props.sidebarWidth, props => props.theme.breakpoints.up('md'), props => props.sidebarWidth - 24 * 2);
|
186
|
+
const StyledUxHeader = (0, _Theme.styled)(_Header.ResponsiveHeader)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .header-container {\n max-width: 100%;\n }\n"]))); // 兼容旧版 dashboard
|
191
187
|
|
192
188
|
function DashboardWrapper(_ref4) {
|
193
189
|
let {
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
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 _colors = require("@mui/material/colors");
|
@@ -17,6 +15,8 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
15
|
|
18
16
|
var _withExternalLink = require("./with-external-link");
|
19
17
|
|
18
|
+
var _Theme = require("../../Theme");
|
19
|
+
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
21
|
|
22
22
|
var _templateObject;
|
@@ -120,8 +120,6 @@ Sidebar.defaultProps = {
|
|
120
120
|
dense: false
|
121
121
|
};
|
122
122
|
const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))';
|
123
|
-
|
124
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n .layout-sidebar-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 22px 24px;\n color: ", ";\n text-decoration: none;\n\n &:hover,\n &.layout-sidebar-link--active {\n color: ", ";\n background: ", ";\n border-left-color: ", ";\n }\n }\n .layout-sidebar-icon {\n display: inline-block;\n width: 32px;\n height: 32px;\n > img,\n > svg {\n width: 32px;\n height: 32px;\n }\n }\n .layout-sidebar-badge {\n position: relative;\n &:after {\n content: '';\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background-color: #fe4e44;\n right: -2px;\n top: 0;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3), 0px 0px 20px rgba(0, 0, 0, 0.1);\n }\n }\n .layout-sidebar-link-text {\n margin-top: 8px;\n font-size: 12px;\n font-weight: 500;\n text-align: center;\n text-transform: capitalize;\n letter-spacing: normal;\n }\n .layout-sidebar-divider {\n display: flex;\n justify-content: center;\n align-items: center;\n &::after {\n content: '';\n display: inline-block;\n width: 80px;\n max-width: 100%;\n border-bottom: 1px solid #ddd;\n }\n }\n &.layout-sidebar-dense {\n box-sizing: border-box;\n height: 100%;\n padding-top: 28px;\n border-right: 1px solid #ddd;\n .layout-sidebar-link {\n flex-direction: row;\n align-items: center;\n padding: 10px 36px 10px 24px;\n }\n .layout-sidebar-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n margin-right: 12px;\n > img,\n > svg {\n width: 20px;\n height: 20px;\n }\n }\n .layout-sidebar-badge {\n &:after {\n width: 6px;\n height: 6px;\n border-radius: 6px;\n right: -2px;\n top: 0;\n }\n }\n .layout-sidebar-link-text {\n margin-top: 0;\n font-size: 14px;\n }\n .layout-sidebar-divider {\n &::after {\n content: '';\n display: inline-block;\n width: 100%;\n margin: 12px 0;\n }\n }\n }\n"])), props => props.theme.palette.text.secondary, props => props.theme.palette.primary.main, gradient, _colors.teal.A700);
|
125
|
-
|
123
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n .layout-sidebar-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 22px 24px;\n color: ", ";\n text-decoration: none;\n\n &:hover,\n &.layout-sidebar-link--active {\n color: ", ";\n background: ", ";\n border-left-color: ", ";\n }\n }\n .layout-sidebar-icon {\n display: inline-block;\n width: 32px;\n height: 32px;\n > img,\n > svg {\n width: 32px;\n height: 32px;\n }\n }\n .layout-sidebar-badge {\n position: relative;\n &:after {\n content: '';\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n background-color: #fe4e44;\n right: -2px;\n top: 0;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3), 0px 0px 20px rgba(0, 0, 0, 0.1);\n }\n }\n .layout-sidebar-link-text {\n margin-top: 8px;\n font-size: 12px;\n font-weight: 500;\n text-align: center;\n text-transform: capitalize;\n letter-spacing: normal;\n }\n .layout-sidebar-divider {\n display: flex;\n justify-content: center;\n align-items: center;\n &::after {\n content: '';\n display: inline-block;\n width: 80px;\n max-width: 100%;\n border-bottom: 1px solid #ddd;\n }\n }\n &.layout-sidebar-dense {\n box-sizing: border-box;\n height: 100%;\n padding-top: 28px;\n border-right: 1px solid #ddd;\n .layout-sidebar-link {\n flex-direction: row;\n align-items: center;\n padding: 10px 36px 10px 24px;\n }\n .layout-sidebar-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n margin-right: 12px;\n > img,\n > svg {\n width: 20px;\n height: 20px;\n }\n }\n .layout-sidebar-badge {\n &:after {\n width: 6px;\n height: 6px;\n border-radius: 6px;\n right: -2px;\n top: 0;\n }\n }\n .layout-sidebar-link-text {\n margin-top: 0;\n font-size: 14px;\n }\n .layout-sidebar-divider {\n &::after {\n content: '';\n display: inline-block;\n width: 100%;\n margin: 12px 0;\n }\n }\n }\n"])), props => props.theme.palette.text.secondary, props => props.theme.palette.primary.main, gradient, _colors.teal.A700);
|
126
124
|
var _default = Sidebar;
|
127
125
|
exports.default = _default;
|
@@ -7,8 +7,6 @@ exports.default = Header;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
13
11
|
|
14
12
|
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
@@ -27,6 +25,8 @@ var _reactRouterDom = require("react-router-dom");
|
|
27
25
|
|
28
26
|
var _Logo = _interopRequireDefault(require("../../Logo"));
|
29
27
|
|
28
|
+
var _Theme = require("../../Theme");
|
29
|
+
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
31
31
|
|
32
32
|
const _excluded = ["children", "brand", "brandAddon", "description", "addons", "onToggleMenu", "homeUrl", "logo"];
|
@@ -47,7 +47,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
47
47
|
|
48
48
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
49
49
|
|
50
|
-
const StyledAppBar = (0,
|
50
|
+
const StyledAppBar = (0, _Theme.styled)(_AppBar.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n z-index: ", ";\n background: ", ";\n box-shadow: none;\n top: 0;\n height: auto;\n }\n .header-toolbar {\n background: ", ";\n color: ", ";\n margin: ", "px 0;\n }\n .header-link {\n display: flex;\n text-decoration: none;\n flex-shrink: 1;\n overflow: hidden;\n }\n .header-logo {\n margin-right: 20px;\n }\n .header-title {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .header-title__primary {\n font-size: 24px;\n font-weight: 800;\n color: ", ";\n text-transform: uppercase;\n display: flex;\n align-items: center;\n }\n .header-title__secondary {\n font-size: 14px;\n line-height: 1.71;\n color: ", ";\n }\n\n .header-addons {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 9999999;\n\n .user-addon {\n .header-avatar {\n width: 32px;\n border-radius: 16px;\n height: auto;\n }\n }\n }\n .header-menu {\n display: none;\n }\n ", " {\n .header-title {\n display: none;\n }\n .header-title__primary {\n font-size: 20px;\n }\n .header-menu {\n display: block;\n }\n }\n"])), props => props.theme.zIndex.drawer, props => props.theme.palette.background.default, props => props.theme.palette.background.default, props => props.theme.palette.text.primary, props => props.theme.spacing(1), props => props.theme.typography.color.main, props => props.theme.typography.color.gray, props => props.theme.breakpoints.down('md'));
|
51
51
|
/*
|
52
52
|
自定义 logo 相关:
|
53
53
|
如果为 logo prop 传入一个自定义的 svg, 并且 svg 中的元素通过 id 引用了 defs 中的元素 (比如 linearGradient),
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
12
12
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
13
13
|
|
14
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
15
|
-
|
16
14
|
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
17
15
|
|
18
16
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
@@ -27,6 +25,8 @@ var _header = _interopRequireDefault(require("./header"));
|
|
27
25
|
|
28
26
|
var _Footer = _interopRequireDefault(require("../../Footer"));
|
29
27
|
|
28
|
+
var _Theme = require("../../Theme");
|
29
|
+
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
31
31
|
|
32
32
|
const _excluded = ["children", "title", "brand", "description", "brandAddon", "headerAddon", "images", "links", "prefix", "fullWidth", "contentLayout", "className", "homeUrl", "logo"];
|
@@ -47,7 +47,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
47
47
|
|
48
48
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
49
49
|
|
50
|
-
const Wrapper =
|
50
|
+
const Wrapper = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.dashboard {\n display: flex;\n flex-direction: column;\n height: 100vh;\n }\n .dashboard__body {\n overflow: hidden;\n flex: 1;\n }\n .dashboard__main {\n display: flex;\n flex-direction: column;\n overflow: auto;\n flex: 1;\n }\n .dashboard__content {\n flex: 1;\n }\n\n .drawerPaper {\n position: relative;\n white-space: nowrap;\n width: 120px;\n background: ", ";\n box-shadow: 2px 16px 10px 0 rgba(0, 0, 0, ", ");\n border: 0;\n }\n"])), props => props.theme.palette.background.default, props => props.theme.mode === 'light' ? 0.05 : 0.5);
|
51
51
|
|
52
52
|
function Dashboard(_ref) {
|
53
53
|
let {
|
@@ -9,12 +9,8 @@ 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 _reactRouterDom = require("react-router-dom");
|
15
13
|
|
16
|
-
var _styles = require("@mui/material/styles");
|
17
|
-
|
18
14
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
19
15
|
|
20
16
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
@@ -25,6 +21,8 @@ var _image = _interopRequireDefault(require("../../Icon/image"));
|
|
25
21
|
|
26
22
|
var _Logo = _interopRequireDefault(require("../../Logo"));
|
27
23
|
|
24
|
+
var _Theme = require("../../Theme");
|
25
|
+
|
28
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
29
27
|
|
30
28
|
var _templateObject, _templateObject2;
|
@@ -55,7 +53,7 @@ function Sidebar(_ref) {
|
|
55
53
|
} = _ref,
|
56
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
57
55
|
|
58
|
-
const theme = (0,
|
56
|
+
const theme = (0, _Theme.useTheme)();
|
59
57
|
const location = (0, _reactRouterDom.useLocation)();
|
60
58
|
|
61
59
|
const isSelected = (url, name) => {
|
@@ -115,6 +113,6 @@ Sidebar.defaultProps = {
|
|
115
113
|
addons: null,
|
116
114
|
logo: null
|
117
115
|
};
|
118
|
-
const MenuItems = /*#__PURE__*/(0, _react.memo)(
|
116
|
+
const MenuItems = /*#__PURE__*/(0, _react.memo)((0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n\n && .sidebar-logo {\n display: none;\n border-bottom: 1px solid #eee;\n background: ", ";\n position: sticky;\n top: 0;\n z-index: 1;\n padding: 10px 0;\n text-align: center;\n font-size: 0;\n }\n ", " {\n && .sidebar-logo {\n display: block;\n }\n }\n"])), props => props.theme.palette.background.default, props => props.theme.breakpoints.down('md')));
|
119
117
|
const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))';
|
120
|
-
const MenuItem = (0,
|
118
|
+
const MenuItem = (0, _Theme.styled)(_Button.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n && {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n transition: all 200ms ease-in-out;\n background: ", ";\n padding: 24px 0;\n border-left: 2px solid ", ";\n border-radius: 0;\n\n &:hover {\n background: ", ";\n border-left-color: ", ";\n }\n\n .menu-title {\n margin-top: 8px;\n font-size: 12px;\n font-weight: 500;\n text-align: center;\n text-transform: capitalize;\n letter-spacing: normal;\n width: 80%;\n color: ", ";\n }\n }\n"])), props => props.selected ? gradient : '', props => props.selected ? _colors.teal.A700 : 'transparent', gradient, _colors.teal.A700, props => props.theme.palette.text.primary);
|
package/lib/Layout/index.js
CHANGED
@@ -9,8 +9,6 @@ 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 _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
15
13
|
|
16
14
|
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
@@ -45,6 +43,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
45
43
|
|
46
44
|
var _Logo = _interopRequireDefault(require("../Logo"));
|
47
45
|
|
46
|
+
var _Theme = require("../Theme");
|
47
|
+
|
48
48
|
var _jsxRuntime = require("react/jsx-runtime");
|
49
49
|
|
50
50
|
var _templateObject, _templateObject2;
|
@@ -271,7 +271,5 @@ Layout.defaultProps = {
|
|
271
271
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.default, {})
|
272
272
|
})
|
273
273
|
};
|
274
|
-
|
275
|
-
const
|
276
|
-
|
277
|
-
const DrawerDiv = _styled.default.nav(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 240px;\n .drawer-paper {\n width: 240px;\n }\n .toolbar {\n min-height: 56px;\n }\n\n a:hover,\n a:active,\n a:visited,\n a:focus {\n text-decoration: none;\n }\n\n .drawer-highlight-nav {\n background-color: #eee;\n }\n\n .toolbar--drawer {\n font-size: 18px;\n .menu-logo {\n display: inline-flex;\n }\n }\n"])));
|
274
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n .appbar {\n &.appbar--border {\n box-shadow: none;\n &::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n bottom: -1px;\n display: block;\n background-color: rgba(0, 0, 0, 0.12);\n }\n }\n }\n\n .toolbar {\n min-height: 56px;\n background: inherit;\n white-space: nowrap;\n .menu-logo {\n font-size: 0;\n margin-right: 8px;\n }\n\n .nav-links {\n display: flex;\n align-items: center;\n .nav-link {\n margin: 8px 12px;\n font-size: 16px;\n display: flex;\n align-items: center;\n }\n\n .highlight-nav {\n font-weight: bolder;\n }\n }\n .brand {\n cursor: pointer;\n text-decoration: none;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 1;\n }\n .description {\n color: #999;\n font-size: 15px;\n margin-left: 10px;\n font-weight: normal;\n flex-shrink: 999999;\n }\n }\n\n ", " {\n .toolbar {\n .menu-button {\n display: none;\n }\n .menu-logo {\n & + .brand {\n padding-left: 45px;\n margin-left: -45px;\n }\n }\n }\n }\n\n ", " {\n .toolbar {\n .nav-links,\n .menu-logo,\n .description {\n display: none;\n }\n }\n }\n"])), props => props.theme.breakpoints.up('md'), props => props.theme.breakpoints.down('md'));
|
275
|
+
const DrawerDiv = (0, _Theme.styled)('nav')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 240px;\n .drawer-paper {\n width: 240px;\n }\n .toolbar {\n min-height: 56px;\n }\n\n a:hover,\n a:active,\n a:visited,\n a:focus {\n text-decoration: none;\n }\n\n .drawer-highlight-nav {\n background-color: #eee;\n }\n\n .toolbar--drawer {\n font-size: 18px;\n .menu-logo {\n display: inline-flex;\n }\n }\n"])));
|
package/lib/Locale/selector.js
CHANGED
@@ -9,10 +9,6 @@ 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
|
-
var _styles = require("@mui/material/styles");
|
15
|
-
|
16
12
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
17
13
|
|
18
14
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
@@ -37,6 +33,8 @@ var _Util = require("../Util");
|
|
37
33
|
|
38
34
|
var _context = require("./context");
|
39
35
|
|
36
|
+
var _Theme = require("../Theme");
|
37
|
+
|
40
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
41
39
|
|
42
40
|
var _templateObject;
|
@@ -74,7 +72,7 @@ function LocaleSelector(props) {
|
|
74
72
|
} = (0, _react.useContext)(_context.LocaleContext);
|
75
73
|
const anchorEl = (0, _react.useRef)(null);
|
76
74
|
const [open, setOpen] = (0, _react.useState)(false);
|
77
|
-
const theme = (0,
|
75
|
+
const theme = (0, _Theme.useTheme)();
|
78
76
|
const dark = (theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.mode) === 'dark';
|
79
77
|
|
80
78
|
const onSelect = newLocale => {
|
@@ -185,5 +183,4 @@ LocaleSelector.defaultProps = {
|
|
185
183
|
};
|
186
184
|
var _default = LocaleSelector;
|
187
185
|
exports.default = _default;
|
188
|
-
|
189
|
-
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n\n .trigger-image {\n width: ", "px;\n height: ", "px;\n }\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ", ";\n }\n }\n\n .locales {\n background: ", ";\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ", ";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])), props => props.size, props => props.size, props => (0, _Util.getColor)(props), props => (0, _Util.getBackground)(props), props => (0, _Util.getColor)(props));
|
186
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n\n .trigger-image {\n width: ", "px;\n height: ", "px;\n }\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ", ";\n }\n }\n\n .locales {\n background: ", ";\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ", ";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])), props => props.size, props => props.size, props => (0, _Util.getColor)(props), props => (0, _Util.getBackground)(props), props => (0, _Util.getColor)(props));
|
package/lib/Logo/index.js
CHANGED
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _Theme = require("../Theme");
|
13
13
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
@@ -142,5 +142,4 @@ Logo.defaultProps = {
|
|
142
142
|
showText: true,
|
143
143
|
showLogo: true
|
144
144
|
};
|
145
|
-
|
146
|
-
const Container = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n flex-direction: ", ";\n justify-content: center;\n align-items: center;\n\n .logo-text {\n ", "\n ", ";\n }\n"])), props => props.layout === 'horizontal' ? 'row' : 'column', props => props.layout === 'vertical' ? 'margin-top: 8px;' : '', props => props.layout === 'vertical' ? '' : 'margin-left: 8px;');
|
145
|
+
const Container = (0, _Theme.styled)('span')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n flex-direction: ", ";\n justify-content: center;\n align-items: center;\n\n .logo-text {\n ", "\n ", ";\n }\n"])), props => props.layout === 'horizontal' ? 'row' : 'column', props => props.layout === 'vertical' ? 'margin-top: 8px;' : '', props => props.layout === 'vertical' ? '' : 'margin-left: 8px;');
|