@arcblock/ux 2.13.11 → 2.13.13
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 +9 -5
- package/lib/Address/did-address.js +14 -7
- package/lib/BlockletV2/blocklet.js +1 -1
- package/lib/CloseButton/index.js +1 -2
- package/lib/Colors/index.d.ts +1 -3
- package/lib/Colors/index.js +2 -4
- package/lib/Colors/themes/default.d.ts +3 -66
- package/lib/Colors/themes/default.js +4 -74
- package/lib/Colors/themes/did-connect.d.ts +11 -6
- package/lib/Colors/themes/did-connect.js +17 -12
- package/lib/Colors/themes/temp.d.ts +3 -0
- package/lib/Colors/themes/temp.js +3 -0
- package/lib/Config/config-provider.d.ts +4 -5
- package/lib/Config/config-provider.js +7 -26
- package/lib/Config/theme-mode-toggle.js +0 -1
- package/lib/DID/index.js +3 -4
- package/lib/Datatable/CustomToolbar.js +3 -0
- package/lib/Datatable/index.js +105 -71
- package/lib/Footer/index.js +2 -5
- package/lib/Header/header.js +3 -1
- package/lib/Header/responsive-header.js +3 -1
- package/lib/Layout/dashboard/index.js +14 -2
- package/lib/Layout/dashboard/sidebar.js +1 -2
- package/lib/LoadingMask/index.js +4 -3
- package/lib/Locale/selector.js +3 -3
- package/lib/NavMenu/nav-menu.js +14 -9
- package/lib/NavMenu/products.js +3 -1
- package/lib/NavMenu/style.js +7 -3
- package/lib/NavMenu/sub-item-group.js +1 -1
- package/lib/PhoneInput/country-select.js +2 -3
- package/lib/SessionBlocklet/index.js +3 -3
- package/lib/SessionUser/components/did-space.js +14 -28
- package/lib/SessionUser/components/logged-in.js +2 -2
- package/lib/SessionUser/components/quick-login-item.js +13 -11
- package/lib/SessionUser/components/session-user-item.js +5 -6
- package/lib/SessionUser/components/session-user-switch.js +15 -13
- package/lib/SessionUser/components/un-login.js +9 -7
- package/lib/SessionUser/components/user-info.js +9 -8
- package/lib/SessionUser/images/did-spaces.svg +7 -13
- package/lib/Success/index.js +8 -4
- package/lib/Switch/index.js +3 -3
- package/lib/Tabs/index.js +8 -9
- package/lib/Theme/theme-provider.d.ts +5 -1
- package/lib/Theme/theme-provider.js +60 -5
- package/lib/Theme/theme.d.ts +6 -3
- package/lib/Theme/theme.js +55 -19
- package/lib/UserCard/Container/card.js +1 -1
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/Util/index.d.ts +8 -0
- package/lib/Util/index.js +23 -1
- package/lib/type.d.ts +5 -1
- package/package.json +7 -6
- package/src/ActivityIndicator/index.jsx +4 -4
- package/src/Address/did-address.tsx +5 -5
- package/src/BlockletV2/blocklet.tsx +1 -1
- package/src/CloseButton/index.tsx +1 -2
- package/src/Colors/index.ts +2 -7
- package/src/Colors/themes/default.ts +4 -50
- package/src/Colors/themes/did-connect.ts +13 -6
- package/src/Colors/themes/temp.ts +3 -0
- package/src/Config/config-provider.tsx +17 -30
- package/src/Config/theme-mode-toggle.tsx +1 -1
- package/src/DID/index.tsx +3 -4
- package/src/Datatable/CustomToolbar.jsx +1 -0
- package/src/Datatable/index.jsx +107 -70
- package/src/Footer/index.tsx +2 -2
- package/src/Header/header.tsx +1 -1
- package/src/Header/responsive-header.tsx +2 -0
- package/src/Layout/dashboard/index.tsx +8 -4
- package/src/Layout/dashboard/sidebar.tsx +1 -2
- package/src/LoadingMask/index.tsx +3 -4
- package/src/Locale/selector.tsx +3 -4
- package/src/NavMenu/nav-menu.tsx +15 -10
- package/src/NavMenu/products.tsx +1 -1
- package/src/NavMenu/style.ts +5 -2
- package/src/NavMenu/sub-item-group.tsx +1 -1
- package/src/PhoneInput/country-select.tsx +2 -3
- package/src/SessionBlocklet/index.tsx +3 -3
- package/src/SessionUser/components/did-space.tsx +14 -10
- package/src/SessionUser/components/logged-in.tsx +2 -2
- package/src/SessionUser/components/quick-login-item.tsx +11 -12
- package/src/SessionUser/components/session-user-item.tsx +3 -6
- package/src/SessionUser/components/session-user-switch.tsx +13 -12
- package/src/SessionUser/components/un-login.tsx +7 -6
- package/src/SessionUser/components/user-info.tsx +7 -8
- package/src/SessionUser/images/did-spaces.svg +7 -13
- package/src/Success/index.tsx +6 -4
- package/src/Switch/index.jsx +3 -3
- package/src/Tabs/index.tsx +8 -9
- package/src/Theme/theme-provider.tsx +73 -2
- package/src/Theme/theme.ts +73 -22
- package/src/UserCard/Container/card.tsx +1 -1
- package/src/UserCard/Container/dialog.tsx +1 -1
- package/src/Util/index.ts +25 -0
- package/src/type.d.ts +5 -1
@@ -1,3 +1,8 @@
|
|
1
|
+
import type { Theme } from '@mui/material';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated 请使用 MUI theme 对象替代
|
5
|
+
*/
|
1
6
|
const colors = {
|
2
7
|
background: {
|
3
8
|
overlay: 'rgba(15, 23, 42, 0.5)',
|
@@ -10,7 +15,7 @@ const colors = {
|
|
10
15
|
text: {
|
11
16
|
primary: '#18181B',
|
12
17
|
secondary: '#71717B',
|
13
|
-
|
18
|
+
disabled: '#D4D4D8',
|
14
19
|
hint: '#D4D4D8',
|
15
20
|
},
|
16
21
|
state: {
|
@@ -23,37 +28,39 @@ const colors = {
|
|
23
28
|
main: '#2B7FFF',
|
24
29
|
light: '#51A2FF',
|
25
30
|
dark: '#155DFC',
|
31
|
+
contrastText: '#fff',
|
26
32
|
},
|
27
33
|
secondary: {
|
28
34
|
main: '#615FFF',
|
29
35
|
light: '#7C86FF',
|
30
36
|
dark: '#4F39F6',
|
37
|
+
contrastText: '#fff',
|
31
38
|
},
|
32
39
|
error: {
|
33
40
|
main: '#FB2C36',
|
34
41
|
light: '#FF6467',
|
35
42
|
dark: '#E7000B',
|
43
|
+
contrastText: '#fff',
|
36
44
|
},
|
37
45
|
warning: {
|
38
46
|
main: '#FF6900',
|
39
47
|
light: '#FF8904',
|
40
48
|
dark: '#F54900',
|
49
|
+
contrastText: '#fff',
|
41
50
|
},
|
42
51
|
info: {
|
43
52
|
main: '#2B7FFF',
|
44
53
|
light: '#51A2FF',
|
45
54
|
dark: '#155DFC',
|
55
|
+
contrastText: '#fff',
|
46
56
|
},
|
47
57
|
success: {
|
48
58
|
main: '#00C950',
|
49
59
|
light: '#05DF72',
|
50
60
|
dark: '#00A63E',
|
61
|
+
contrastText: '#fff',
|
51
62
|
},
|
52
|
-
divider:
|
53
|
-
main: 'rgba(18, 22, 24, 0.06)',
|
54
|
-
light: '#F4F4F5',
|
55
|
-
dark: '#D4D4D5',
|
56
|
-
},
|
63
|
+
divider: 'rgba(18, 22, 24, 0.06)',
|
57
64
|
};
|
58
65
|
|
59
66
|
export default colors;
|
@@ -1,34 +1,33 @@
|
|
1
1
|
import { createContext, useContext, ReactNode, useMemo, useState, useCallback, useEffect } from 'react';
|
2
|
-
import { type PaletteMode } from '@mui/material';
|
3
|
-
import
|
4
|
-
import useMediaQuery from '@mui/material/useMediaQuery';
|
2
|
+
import { ThemeOptions, type PaletteMode } from '@mui/material';
|
3
|
+
import { BLOCKLET_THEME_PREFER_KEY } from '@blocklet/theme';
|
5
4
|
import set from 'lodash/set';
|
6
5
|
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
7
6
|
import { LocaleProvider, LocaleProviderProps, useLocaleContext } from '../Locale/context';
|
8
7
|
import ThemeProvider, { ThemeProviderProps } from '../Theme/theme-provider';
|
9
|
-
import {
|
8
|
+
import {
|
9
|
+
createTheme,
|
10
|
+
getDefaultThemePrefer,
|
11
|
+
lazyThemeConfig,
|
12
|
+
useTheme,
|
13
|
+
type UserThemeOptions,
|
14
|
+
type ThemeConfig,
|
15
|
+
} from '../Theme';
|
10
16
|
|
11
17
|
export interface ConfigContextType {
|
12
18
|
mode: PaletteMode;
|
13
|
-
themeOptions:
|
19
|
+
themeOptions: UserThemeOptions;
|
14
20
|
toggleMode: () => void;
|
15
21
|
}
|
16
22
|
|
17
23
|
const ConfigContext = createContext<ConfigContextType>({} as ConfigContextType);
|
18
|
-
const preferThemeModeKey = 'blocklet_theme_prefer';
|
19
|
-
|
20
|
-
export function isThemeRecord(
|
21
|
-
theme: ThemeOptions | Record<PaletteMode, ThemeOptions>
|
22
|
-
): theme is Record<PaletteMode, ThemeOptions> {
|
23
|
-
return 'light' in theme || 'dark' in theme;
|
24
|
-
}
|
25
24
|
|
26
25
|
export interface ConfigProviderProps
|
27
26
|
extends Omit<LocaleProviderProps, 'translations'>,
|
28
27
|
Omit<ThemeProviderProps, 'theme'> {
|
29
28
|
children: ReactNode;
|
30
29
|
prefer?: PaletteMode;
|
31
|
-
theme?:
|
30
|
+
theme?: UserThemeOptions | ((config: ThemeConfig) => UserThemeOptions);
|
32
31
|
disableBlockletTheme?: boolean;
|
33
32
|
translations?: Record<string, any>;
|
34
33
|
}
|
@@ -50,33 +49,21 @@ export function ConfigProvider({
|
|
50
49
|
languages,
|
51
50
|
onLoadingTranslation,
|
52
51
|
}: ConfigProviderProps) {
|
53
|
-
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
|
54
52
|
const [mode, setMode] = useState<PaletteMode>(() => {
|
55
53
|
if (prefer) {
|
56
54
|
return prefer;
|
57
55
|
}
|
58
56
|
|
59
|
-
|
60
|
-
if (['1', 'true'].includes(window.blocklet?.USE_DARK_THEME) === false) {
|
61
|
-
return 'light';
|
62
|
-
}
|
63
|
-
|
64
|
-
// 本地缓存
|
65
|
-
const localPrefer = localStorage.getItem(preferThemeModeKey) as PaletteMode;
|
66
|
-
if (localPrefer && (localPrefer === 'light' || localPrefer === 'dark')) {
|
67
|
-
return localPrefer;
|
68
|
-
}
|
69
|
-
|
70
|
-
// 系统偏好
|
71
|
-
return prefersDarkMode ? 'dark' : 'light';
|
57
|
+
return getDefaultThemePrefer();
|
72
58
|
});
|
73
59
|
|
74
60
|
const _themeOptions = useMemo(() => {
|
75
61
|
let result: ThemeOptions = {};
|
62
|
+
const getThemeConfig = lazyThemeConfig(mode);
|
76
63
|
|
77
64
|
if (themeOptions) {
|
78
|
-
if (
|
79
|
-
result = themeOptions
|
65
|
+
if (typeof themeOptions === 'function') {
|
66
|
+
result = themeOptions(getThemeConfig());
|
80
67
|
} else {
|
81
68
|
result = { ...themeOptions };
|
82
69
|
}
|
@@ -95,7 +82,7 @@ export function ConfigProvider({
|
|
95
82
|
const toggleMode = useCallback(() => {
|
96
83
|
const newMode = mode === 'light' ? 'dark' : 'light';
|
97
84
|
setMode(newMode);
|
98
|
-
localStorage.setItem(
|
85
|
+
localStorage.setItem(BLOCKLET_THEME_PREFER_KEY, newMode);
|
99
86
|
}, [mode, setMode]);
|
100
87
|
|
101
88
|
const config = useMemo(
|
package/src/DID/index.tsx
CHANGED
@@ -9,7 +9,6 @@ import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
9
9
|
|
10
10
|
import Address, { IDidAddressWrapper } from '../Address';
|
11
11
|
import Avatar from '../Avatar';
|
12
|
-
import { temp as colors } from '../Colors';
|
13
12
|
import { DID_PREFIX } from '../Util/constant';
|
14
13
|
|
15
14
|
import { HTMLDidAddressElement } from '../Address/did-address';
|
@@ -222,7 +221,7 @@ export const DID = forwardRef<HTMLDIDElement, DIDProps>((props, ref) => {
|
|
222
221
|
flexShrink: 0,
|
223
222
|
cursor: 'pointer',
|
224
223
|
ml: 0.5,
|
225
|
-
color: '
|
224
|
+
color: 'text.secondary',
|
226
225
|
}}
|
227
226
|
/>
|
228
227
|
) : null}
|
@@ -290,7 +289,7 @@ export function DIDDialog({
|
|
290
289
|
target="_blank"
|
291
290
|
rel="noreferrer"
|
292
291
|
sx={{
|
293
|
-
color:
|
292
|
+
color: 'secondary.main',
|
294
293
|
textDecoration: 'none',
|
295
294
|
'&:hover': {
|
296
295
|
textDecoration: 'underline',
|
@@ -371,7 +370,7 @@ export function DIDDialog({
|
|
371
370
|
<Typography
|
372
371
|
variant="body2"
|
373
372
|
sx={{
|
374
|
-
color:
|
373
|
+
color: 'text.secondary',
|
375
374
|
fontSize: '12px',
|
376
375
|
mt: 1,
|
377
376
|
}}>
|
package/src/Datatable/index.jsx
CHANGED
@@ -488,101 +488,138 @@ const alignCss = css`
|
|
488
488
|
}
|
489
489
|
`;
|
490
490
|
|
491
|
-
const TableContainer = styled('div', { shouldForwardProp: (prop) => prop !== 'verticalKeyWidth' })
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
491
|
+
const TableContainer = styled('div', { shouldForwardProp: (prop) => prop !== 'verticalKeyWidth' })(({
|
492
|
+
theme,
|
493
|
+
verticalKeyWidth,
|
494
|
+
}) => {
|
495
|
+
const primaryTextColor = theme.palette.text.primary;
|
496
|
+
const defaultBgColor = theme.palette.background.default;
|
497
|
+
const hoverBgColor = theme.palette.action.hover;
|
498
|
+
const oddRowBgColor = theme.palette.grey[50];
|
499
|
+
|
500
|
+
const verticalKeyWidthStyle = verticalKeyWidth
|
501
|
+
? `
|
502
|
+
${theme.breakpoints.down('md')} {
|
503
|
+
[class*='MUIDataTable-responsiveBase'] {
|
504
|
+
tr:not([class*='responsiveSimple']) {
|
505
|
+
td.MuiTableCell-body {
|
506
|
+
> div {
|
507
|
+
&:first-of-type {
|
508
|
+
width: ${verticalKeyWidth + (!/\D/.test(verticalKeyWidth) ? 'px' : '')};
|
509
|
+
}
|
510
|
+
}
|
511
|
+
}
|
512
|
+
}
|
513
|
+
}
|
514
|
+
}
|
515
|
+
`
|
516
|
+
: '';
|
497
517
|
|
498
|
-
|
499
|
-
&.
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
align-items: center;
|
518
|
+
return css`
|
519
|
+
&.datatable-hide-header {
|
520
|
+
thead.MuiTableHead-root {
|
521
|
+
display: none;
|
522
|
+
}
|
504
523
|
}
|
505
|
-
|
506
|
-
|
524
|
+
|
525
|
+
td {
|
526
|
+
&.vertical-align-top {
|
527
|
+
align-items: flex-start;
|
528
|
+
}
|
529
|
+
&.vertical-align-center {
|
530
|
+
align-items: center;
|
531
|
+
}
|
532
|
+
&.vertical-align-bottom {
|
533
|
+
align-items: flex-end;
|
534
|
+
}
|
507
535
|
}
|
508
|
-
}
|
509
536
|
|
510
|
-
height: 100%;
|
511
|
-
> .MuiPaper-root {
|
512
|
-
display: flex;
|
513
|
-
flex-direction: column;
|
514
537
|
height: 100%;
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
538
|
+
> .MuiPaper-root {
|
539
|
+
display: flex;
|
540
|
+
flex-direction: column;
|
541
|
+
height: 100%;
|
542
|
+
box-shadow: none;
|
543
|
+
background: none;
|
544
|
+
background-color: ${defaultBgColor};
|
520
545
|
}
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
font-size: 14px;
|
546
|
+
${theme.breakpoints.down('md')} {
|
547
|
+
td.MuiTableCell-body {
|
548
|
+
padding-right: 0;
|
549
|
+
}
|
550
|
+
[class*='MUIDataTable-responsiveBase'] {
|
551
|
+
tr:not([class*='responsiveSimple']) {
|
552
|
+
td.MuiTableCell-body {
|
553
|
+
display: flex;
|
554
|
+
> div {
|
531
555
|
width: auto;
|
532
|
-
flex:
|
533
|
-
|
534
|
-
|
535
|
-
|
556
|
+
flex: 1;
|
557
|
+
&:first-of-type {
|
558
|
+
font-weight: bold;
|
559
|
+
font-size: 14px;
|
560
|
+
width: auto;
|
561
|
+
flex: 0 0 auto;
|
562
|
+
padding-right: 16px;
|
563
|
+
&:empty {
|
564
|
+
padding-right: 0;
|
565
|
+
}
|
536
566
|
}
|
537
567
|
}
|
538
568
|
}
|
539
569
|
}
|
540
570
|
}
|
541
571
|
}
|
542
|
-
|
543
|
-
${(props) => props.theme.breakpoints.up('md')} {
|
544
|
-
${alignCss}
|
545
|
-
}
|
546
|
-
${(props) => props.theme.breakpoints.up('sm')} {
|
547
|
-
[class*='responsiveSimple'] {
|
572
|
+
${theme.breakpoints.up('md')} {
|
548
573
|
${alignCss}
|
549
574
|
}
|
550
|
-
|
575
|
+
${theme.breakpoints.up('sm')} {
|
576
|
+
[class*='responsiveSimple'] {
|
577
|
+
${alignCss}
|
578
|
+
}
|
579
|
+
}
|
551
580
|
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
tr:not([class*='responsiveSimple']) {
|
558
|
-
td.MuiTableCell-body {
|
559
|
-
> div {
|
560
|
-
&:first-of-type {
|
561
|
-
width: ${inProps.verticalKeyWidth + (!/\D/.test(inProps.verticalKeyWidth) ? 'px' : '')};
|
562
|
-
}
|
563
|
-
}
|
564
|
-
}
|
565
|
-
}
|
566
|
-
}
|
567
|
-
}
|
568
|
-
`;
|
581
|
+
${verticalKeyWidthStyle}
|
582
|
+
|
583
|
+
.MuiTableCell-head {
|
584
|
+
color: ${primaryTextColor};
|
585
|
+
background-color: ${defaultBgColor};
|
569
586
|
}
|
570
587
|
|
571
|
-
|
572
|
-
|
588
|
+
.MuiTableCell-root {
|
589
|
+
color: ${primaryTextColor};
|
590
|
+
}
|
573
591
|
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
background-color: ${
|
592
|
+
.MuiTableRow-root {
|
593
|
+
background-color: ${defaultBgColor};
|
594
|
+
&:nth-of-type(even) {
|
595
|
+
background-color: ${defaultBgColor};
|
596
|
+
}
|
597
|
+
&:hover {
|
598
|
+
background-color: ${hoverBgColor};
|
599
|
+
}
|
600
|
+
&.MuiTableRow-footer {
|
601
|
+
background-color: ${defaultBgColor};
|
578
602
|
}
|
579
603
|
}
|
580
|
-
|
581
|
-
|
604
|
+
|
605
|
+
&.datatable-stripped {
|
606
|
+
.MuiTableRow-root:nth-of-type(odd) {
|
607
|
+
background-color: ${oddRowBgColor};
|
608
|
+
&:hover {
|
609
|
+
background-color: ${hoverBgColor};
|
610
|
+
}
|
611
|
+
&.MuiTableRow-footer {
|
612
|
+
background-color: ${defaultBgColor};
|
613
|
+
}
|
614
|
+
}
|
615
|
+
}
|
616
|
+
`;
|
617
|
+
});
|
582
618
|
|
583
619
|
const FooterContainer = styled('div')`
|
584
620
|
display: flex;
|
585
621
|
align-items: center;
|
622
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
586
623
|
.datatable-footer {
|
587
624
|
position: relative;
|
588
625
|
margin-left: auto;
|
package/src/Footer/index.tsx
CHANGED
@@ -77,7 +77,7 @@ const Container = styled('div', {
|
|
77
77
|
position: relative;
|
78
78
|
margin-top: 64px;
|
79
79
|
padding: 24px 0 32px;
|
80
|
-
border-top: 1px solid ${(props) =>
|
80
|
+
border-top: 1px solid ${(props) => props.theme.palette.divider};
|
81
81
|
box-sizing: border-box;
|
82
82
|
width: 100%;
|
83
83
|
|
@@ -92,7 +92,7 @@ const Container = styled('div', {
|
|
92
92
|
flex-wrap: wrap;
|
93
93
|
|
94
94
|
.footer-item {
|
95
|
-
color: ${(
|
95
|
+
color: ${(props) => props.theme.palette.text.hint};
|
96
96
|
display: flex;
|
97
97
|
align-items: center;
|
98
98
|
flex-wrap: wrap;
|
package/src/Header/header.tsx
CHANGED
@@ -102,6 +102,8 @@ function ResponsiveHeader({ menu, prepend, children, ...rest }: ResponsiveHeader
|
|
102
102
|
top: 64,
|
103
103
|
bottom: 0,
|
104
104
|
boxShadow: 'none',
|
105
|
+
backgroundImage: 'none',
|
106
|
+
backgroundColor: theme.palette.background.paper,
|
105
107
|
},
|
106
108
|
}}>
|
107
109
|
<MenuPanel>{_children}</MenuPanel>
|
@@ -73,6 +73,7 @@ function Dashboard({
|
|
73
73
|
fullWidth = false,
|
74
74
|
dense = 'auto',
|
75
75
|
footerProps = {},
|
76
|
+
sx,
|
76
77
|
children,
|
77
78
|
...rest
|
78
79
|
}: DashboardProps) {
|
@@ -98,7 +99,7 @@ function Dashboard({
|
|
98
99
|
}, []);
|
99
100
|
|
100
101
|
return (
|
101
|
-
<Wrapper {...rest} className={classes} sidebarWidth={sidebarWidth}>
|
102
|
+
<Wrapper sx={sx} {...rest} className={classes} sidebarWidth={sidebarWidth}>
|
102
103
|
<Helmet title={title} key={title} />
|
103
104
|
|
104
105
|
{headerVisible && (
|
@@ -164,7 +165,7 @@ function Dashboard({
|
|
164
165
|
<Container className="dashboard-content" id="arc__dashboard-content" {...(fullWidth && { maxWidth: false })}>
|
165
166
|
{children}
|
166
167
|
</Container>
|
167
|
-
{footerVisible && <Footer {...footerProps} />}
|
168
|
+
{footerVisible && <Footer {...{ dark: theme.palette.mode === 'dark', ...footerProps }} />}
|
168
169
|
</Box>
|
169
170
|
</Box>
|
170
171
|
</Wrapper>
|
@@ -180,6 +181,7 @@ const Wrapper = styled('div', {
|
|
180
181
|
display: flex;
|
181
182
|
flex-direction: column;
|
182
183
|
height: 100vh;
|
184
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
183
185
|
}
|
184
186
|
.dashboard-body {
|
185
187
|
overflow: hidden;
|
@@ -209,11 +211,13 @@ const Wrapper = styled('div', {
|
|
209
211
|
}
|
210
212
|
&.dashboard-dense {
|
211
213
|
.dashboard-header {
|
212
|
-
border-bottom: 1px solid
|
214
|
+
border-bottom: 1px solid;
|
215
|
+
border-color: ${({ theme }) => theme.palette.divider};
|
213
216
|
}
|
214
217
|
.dashboard-sidebar {
|
215
218
|
width: 256px;
|
216
|
-
border-right: 1px solid
|
219
|
+
border-right: 1px solid;
|
220
|
+
border-color: ${({ theme }) => theme.palette.divider};
|
217
221
|
}
|
218
222
|
}
|
219
223
|
${(props) => props.theme.breakpoints.up('md')} {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import Typography from '@mui/material/Typography';
|
2
|
-
import { teal } from '@mui/material/colors';
|
3
2
|
import clsx from 'clsx';
|
4
3
|
import { styled } from '../../Theme';
|
5
4
|
import { NavLink } from './external-link';
|
@@ -87,7 +86,7 @@ const Root = styled('div')`
|
|
87
86
|
&.layout-sidebar-link--active {
|
88
87
|
color: ${(props) => props.theme.palette.primary.main};
|
89
88
|
background: ${gradient};
|
90
|
-
border-left-color: ${
|
89
|
+
border-left-color: ${(props) => props.theme.palette.primary.main};
|
91
90
|
}
|
92
91
|
}
|
93
92
|
.layout-sidebar-icon {
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import { Box } from '@mui/material';
|
2
2
|
|
3
|
-
import { temp as colors } from '../Colors';
|
4
|
-
|
5
3
|
export interface LoadingMaskProps {
|
6
4
|
size?: number;
|
7
5
|
padding?: number;
|
@@ -49,7 +47,7 @@ export default function LoadingMask({
|
|
49
47
|
height: finialSize,
|
50
48
|
overflow: 'hidden',
|
51
49
|
borderRadius: `${finialRadius}px`,
|
52
|
-
backgroundColor:
|
50
|
+
backgroundColor: 'grey.200',
|
53
51
|
'&::before,&::after': {
|
54
52
|
content: '""',
|
55
53
|
position: 'absolute',
|
@@ -68,7 +66,8 @@ export default function LoadingMask({
|
|
68
66
|
borderRadius: `${finialRadius - finialBorderWidth}px`,
|
69
67
|
},
|
70
68
|
'&::before': {
|
71
|
-
background:
|
69
|
+
background: ({ palette }) =>
|
70
|
+
`conic-gradient(from 45deg, transparent 0%, transparent 50%, ${palette.secondary.main} 90%, ${palette.secondary.main} 100%)`,
|
72
71
|
transform: 'scale(100)',
|
73
72
|
animation: `rotate ${finialDuration}s linear infinite`,
|
74
73
|
'@keyframes rotate': {
|
package/src/Locale/selector.tsx
CHANGED
@@ -6,7 +6,6 @@ import CheckIcon from '@iconify-icons/material-symbols/check';
|
|
6
6
|
import LanguageIcon from 'iconify-icons-material-symbols-400/language';
|
7
7
|
import noop from 'lodash/noop';
|
8
8
|
|
9
|
-
import { temp as colors } from '../Colors';
|
10
9
|
import { LocaleContext } from './context';
|
11
10
|
import { styled, useTheme } from '../Theme';
|
12
11
|
import type { Locale } from '../type';
|
@@ -108,9 +107,9 @@ export default function LocaleSelector(props: LocaleSelectorProps) {
|
|
108
107
|
<Box
|
109
108
|
className="locales"
|
110
109
|
sx={{
|
111
|
-
backgroundColor: 'background.
|
110
|
+
backgroundColor: 'background.paper',
|
112
111
|
boxShadow: 2,
|
113
|
-
borderRadius:
|
112
|
+
borderRadius: 1,
|
114
113
|
}}>
|
115
114
|
<ClickAwayListener onClickAway={onClose}>
|
116
115
|
<MenuList>
|
@@ -138,7 +137,7 @@ export default function LocaleSelector(props: LocaleSelectorProps) {
|
|
138
137
|
icon={CheckIcon}
|
139
138
|
className={code === locale ? 'check-icon check-icon-visible' : 'check-icon'}
|
140
139
|
sx={{
|
141
|
-
marginRight:
|
140
|
+
marginRight: 1,
|
142
141
|
visibility: code === locale ? 'visible' : 'hidden',
|
143
142
|
}}
|
144
143
|
/>
|
package/src/NavMenu/nav-menu.tsx
CHANGED
@@ -7,6 +7,7 @@ import { useCreation, useMemoizedFn, useReactive, useSize, useThrottleFn } from
|
|
7
7
|
import { NavMenuProvider, useNavMenuContext } from './nav-menu-context';
|
8
8
|
import { NavMenuRoot, NavMenuItem, NavMenuSub, NavMenuSubList, NavMenuStyled } from './style';
|
9
9
|
import { SubContainer } from './sub-container';
|
10
|
+
import { useTheme } from '../Theme';
|
10
11
|
|
11
12
|
// 过滤 children 中的 Item/Sub, 忽略其它类型的 element
|
12
13
|
function filterItems(children: React.ReactNode) {
|
@@ -57,12 +58,16 @@ function NavMenu({
|
|
57
58
|
mode = 'horizontal',
|
58
59
|
children: _childs = null,
|
59
60
|
activeId = null,
|
60
|
-
textColor
|
61
|
-
activeTextColor
|
62
|
-
bgColor
|
61
|
+
textColor,
|
62
|
+
activeTextColor,
|
63
|
+
bgColor,
|
63
64
|
onSelected,
|
64
65
|
...rest
|
65
66
|
}: NavMenuProps) {
|
67
|
+
const theme = useTheme();
|
68
|
+
const $textColor = useCreation(() => theme.palette.grey[400], [theme]);
|
69
|
+
const $activeTextColor = useCreation(() => theme.palette.text.primary, [theme]);
|
70
|
+
const $bgColor = useCreation(() => theme.palette.background.default, [theme]);
|
66
71
|
// eslint-disable-next-line no-param-reassign
|
67
72
|
const children = filterItems(_childs);
|
68
73
|
if (!items?.length && !children?.length) {
|
@@ -89,9 +94,9 @@ function NavMenu({
|
|
89
94
|
return {
|
90
95
|
...currentState,
|
91
96
|
mode,
|
92
|
-
textColor,
|
93
|
-
activeTextColor,
|
94
|
-
bgColor,
|
97
|
+
textColor: $textColor,
|
98
|
+
activeTextColor: $activeTextColor,
|
99
|
+
bgColor: $bgColor,
|
95
100
|
activate,
|
96
101
|
open,
|
97
102
|
close,
|
@@ -101,9 +106,9 @@ function NavMenu({
|
|
101
106
|
currentState.hiddenItemCount,
|
102
107
|
currentState.openedIds,
|
103
108
|
mode,
|
104
|
-
textColor,
|
105
|
-
activeTextColor,
|
106
|
-
bgColor,
|
109
|
+
$textColor,
|
110
|
+
$activeTextColor,
|
111
|
+
$bgColor,
|
107
112
|
activate,
|
108
113
|
open,
|
109
114
|
close,
|
@@ -259,7 +264,7 @@ function NavMenu({
|
|
259
264
|
|
260
265
|
return (
|
261
266
|
<NavMenuProvider value={contextValue}>
|
262
|
-
<NavMenuStyled {...rest} className={classes} $textColor={textColor} $bgColor={bgColor}>
|
267
|
+
<NavMenuStyled {...rest} className={classes} $textColor={$textColor} $bgColor={$bgColor}>
|
263
268
|
<NavMenuRoot className={clsx('navmenu-root', `navmenu-root--${mode}`)} ref={navMenuRef}>
|
264
269
|
{items ? items.map((item, index) => renderItem(item, index)) : renderChildrenWithRef(children || [])}
|
265
270
|
{currentState.hiddenItemCount > 0 && (
|
package/src/NavMenu/products.tsx
CHANGED