From bc153593a053fb59b282f0d9d4699fd03d434a2b Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 15:59:57 -0300 Subject: [PATCH 1/9] overall tighten up to the header design --- .../src/components/header/ThemeModeToggle.tsx | 2 + docs/src/icons/SvgHamburgerMenu.tsx | 4 +- docs/src/layouts/AppHeader.tsx | 1 + docs/src/modules/components/AppFrame.js | 28 +++++--- docs/src/modules/components/AppNavDrawer.js | 69 ++++++------------- docs/src/modules/components/AppSearch.js | 14 ++-- .../modules/components/ComponentPageTabs.js | 4 +- docs/src/modules/components/Notifications.js | 1 + .../mui-docs/src/branding/brandingTheme.ts | 27 +++++--- 9 files changed, 72 insertions(+), 78 deletions(-) diff --git a/docs/src/components/header/ThemeModeToggle.tsx b/docs/src/components/header/ThemeModeToggle.tsx index fda2d61676d99d..05bfa95bb8ea14 100644 --- a/docs/src/components/header/ThemeModeToggle.tsx +++ b/docs/src/components/header/ThemeModeToggle.tsx @@ -14,6 +14,7 @@ function CssVarsModeToggle(props: { onChange: (newMode: string) => void }) { { @@ -51,6 +52,7 @@ export default function ThemeModeToggle() { { setMode(calculatedMode === 'dark' ? 'light' : 'dark'); diff --git a/docs/src/icons/SvgHamburgerMenu.tsx b/docs/src/icons/SvgHamburgerMenu.tsx index e47c00f841f79b..834d16372b7b6a 100644 --- a/docs/src/icons/SvgHamburgerMenu.tsx +++ b/docs/src/icons/SvgHamburgerMenu.tsx @@ -5,8 +5,8 @@ export default function SvgHamburgerMenu(props: RootSvgProps) { return ( prop !== 'disablePermanent', })(({ disablePermanent, theme }) => { return { - padding: theme.spacing(1, 2), + padding: theme.spacing(1.5), transition: theme.transitions.create('width'), ...(disablePermanent && { boxShadow: 'none', @@ -114,11 +114,9 @@ const StyledAppBar = styled(AppBar, { }), boxShadow: 'none', backdropFilter: 'blur(8px)', - borderStyle: 'solid', + borderBottom: '1px solid', borderColor: (theme.vars || theme).palette.divider, - borderWidth: 0, - borderBottomWidth: 'thin', - backgroundColor: 'rgba(255,255,255,0.8)', + backgroundColor: '#FFF', color: (theme.vars || theme).palette.grey[800], ...theme.applyDarkStyles({ backgroundColor: alpha(theme.palette.primaryDark[900], 0.8), @@ -156,7 +154,7 @@ const StyledAppNavDrawer = styled(AppNavDrawer)(({ disablePermanent, theme }) => }; }); -export const HEIGHT = 64; +export const HEIGHT = 59; export default function AppFrame(props) { const { children, disableDrawer = false, className, BannerComponent = AppFrameBanner } = props; @@ -178,7 +176,10 @@ export default function AppFrame(props) { - + - + setMobileOpen(true)} @@ -214,6 +216,7 @@ export default function AppFrame(props) { - setSettingsOpen(true)} sx={{ px: '8px' }}> + setSettingsOpen(true)} + sx={{ px: '8px' }} + > - + ({ + px: 1, + height: 26, + fontSize: theme.typography.pxToRem(13), + fontWeight: theme.typography.fontWeightMedium, + letterSpacing: '0.01rem', +}); + function ProductDrawerButton(props) { const [anchorEl, setAnchorEl] = React.useState(null); @@ -67,26 +75,15 @@ function ProductDrawerButton(props) { return ( @@ -121,8 +118,8 @@ function ProductIdentifier(props) { ({ - ml: 1, - fontSize: theme.typography.pxToRem(11), + ml: '6px', + fontSize: theme.typography.pxToRem(10), fontWeight: theme.typography.fontWeightBold, textTransform: 'uppercase', letterSpacing: '.1rem', @@ -184,7 +181,7 @@ PersistScroll.propTypes = { }; const ToolbarDiv = styled('div')(({ theme }) => ({ - padding: theme.spacing(1.6, 2), + padding: theme.spacing(1.5), paddingRight: 0, flexShrink: 0, height: 'var(--MuiDocs-header-height)', @@ -193,6 +190,8 @@ const ToolbarDiv = styled('div')(({ theme }) => ({ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', + borderBottom: '1px solid', + borderColor: (theme.vars || theme).palette.divider, })); const StyledDrawer = styled(Drawer)(({ theme }) => ({ @@ -332,6 +331,8 @@ export default function AppNavDrawer(props) { return ( @@ -392,7 +376,7 @@ export default function AppNavDrawer(props) { onClick: onClose, })} > - {item.text} {item.current && } + {item.text} {item.current && } ); })} @@ -405,17 +389,7 @@ export default function AppNavDrawer(props) { - + @@ -425,7 +399,6 @@ export default function AppNavDrawer(props) { versionSelector={renderVersionSelector(productIdentifier.versions)} /> - [ { - minHeight: 34, - minWidth: 34, + minHeight: 32, + minWidth: 32, display: 'flex', alignItems: 'center', margin: 0, @@ -46,7 +46,7 @@ const SearchButton = styled('button')(({ theme }) => [ }, fontFamily: theme.typography.fontFamily, position: 'relative', - backgroundColor: (theme.vars || theme).palette.grey[50], + backgroundColor: alpha(theme.palette.grey[50], 0.8), color: (theme.vars || theme).palette.text.secondary, fontSize: theme.typography.pxToRem(14), border: `1px solid ${(theme.vars || theme).palette.grey[200]}`, @@ -54,7 +54,7 @@ const SearchButton = styled('button')(({ theme }) => [ cursor: 'pointer', transitionProperty: 'all', transitionDuration: '150ms', - boxShadow: `hsl(200, 0%, 100%) 0 2px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1.5px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, + boxShadow: `hsl(200, 0%, 100%) 0 1px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, '&:hover': { background: (theme.vars || theme).palette.grey[100], borderColor: (theme.vars || theme).palette.grey[300], @@ -66,8 +66,8 @@ const SearchButton = styled('button')(({ theme }) => [ }, theme.applyDarkStyles({ backgroundColor: alpha(theme.palette.primaryDark[700], 0.4), - borderColor: (theme.vars || theme).palette.primaryDark[700], - boxShadow: `${alpha(theme.palette.primaryDark[600], 0.1)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, + borderColor: alpha(theme.palette.primaryDark[600], 0.4), + boxShadow: `${alpha(theme.palette.primaryDark[600], 0.1)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, '&:hover': { background: (theme.vars || theme).palette.primaryDark[700], borderColor: (theme.vars || theme).palette.primaryDark[600], @@ -84,7 +84,7 @@ const Shortcut = styled('div')(({ theme }) => { return { fontSize: theme.typography.pxToRem(12), fontWeight: 'bold', - lineHeight: '20px', + lineHeight: '19px', marginLeft: theme.spacing(0.5), border: `1px solid ${(theme.vars || theme).palette.grey[200]}`, backgroundColor: '#FFF', diff --git a/docs/src/modules/components/ComponentPageTabs.js b/docs/src/modules/components/ComponentPageTabs.js index 8011cb52920376..a9ff3de0329505 100644 --- a/docs/src/modules/components/ComponentPageTabs.js +++ b/docs/src/modules/components/ComponentPageTabs.js @@ -56,9 +56,9 @@ export default function ComponentPageTabs(props) { value={activeTab} sx={{ position: 'sticky', - top: 65, // to be positioned below the app bar + top: 59, // to be positioned below the app bar mt: 2, - mx: -1, + mx: { xs: -2, sm: -1 }, backgroundColor: 'background.default', borderBottom: 1, borderColor: 'divider', diff --git a/docs/src/modules/components/Notifications.js b/docs/src/modules/components/Notifications.js index 265312ae688114..d4b4ff1628b9f8 100644 --- a/docs/src/modules/components/Notifications.js +++ b/docs/src/modules/components/Notifications.js @@ -167,6 +167,7 @@ export default function Notifications() { > ({ + borderRadius: theme.shape.borderRadius, + ...(ownerState.size === 'small' && { + height: 32, + width: 32, + '& .MuiSvgIcon-root': { + fontSize: defaultTheme.typography.pxToRem(18), + }, + }), + }), + }, variants: [ { props: { color: 'primary' }, style: ({ theme }) => [ { - height: 34, - width: 34, border: `1px solid`, - borderRadius: theme.shape.borderRadius, color: (theme.vars || theme).palette.primary.main, backgroundColor: alpha(theme.palette.primaryDark[50], 0.1), borderColor: (theme.vars || theme).palette.primaryDark[100], - boxShadow: `${alpha(theme.palette.grey[50], 0.4)} 0 2px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1.5px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, + boxShadow: `${alpha(theme.palette.grey[50], 0.4)} 0 1px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, '&:hover': { borderColor: (theme.vars || theme).palette.grey[300], background: (theme.vars || theme).palette.grey[50], @@ -724,10 +733,10 @@ export function getThemedComponents(): ThemeOptions { color: (theme.vars || theme).palette.primary[300], borderColor: alpha(theme.palette.primaryDark[600], 0.5), backgroundColor: alpha(theme.palette.primaryDark[700], 0.2), - boxShadow: `${alpha(theme.palette.primaryDark[600], 0.2)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, + boxShadow: `${alpha(theme.palette.primaryDark[600], 0.2)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, '&:hover': { - borderColor: (theme.vars || theme).palette.primaryDark[500], - background: alpha(theme.palette.primaryDark[700], 0.4), + borderColor: (theme.vars || theme).palette.primaryDark[600], + background: alpha(theme.palette.primaryDark[700], 0.8), }, }), ], @@ -743,7 +752,7 @@ export function getThemedComponents(): ThemeOptions { border: `1px solid`, backgroundColor: alpha(theme.palette.primaryDark[50], 0.1), borderColor: (theme.vars || theme).palette.primaryDark[100], - boxShadow: `${alpha(theme.palette.grey[50], 0.4)} 0 2px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1.5px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, + boxShadow: `${alpha(theme.palette.grey[50], 0.4)} 0 1px 0 inset, ${alpha(theme.palette.grey[100], 0.5)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`, '&:hover': { color: (theme.vars || theme).palette.primary.main, borderColor: (theme.vars || theme).palette.grey[300], @@ -753,7 +762,7 @@ export function getThemedComponents(): ThemeOptions { theme.applyDarkStyles({ borderColor: alpha(theme.palette.primaryDark[600], 0.5), backgroundColor: alpha(theme.palette.primaryDark[700], 0.2), - boxShadow: `${alpha(theme.palette.primaryDark[600], 0.2)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, + boxShadow: `${alpha(theme.palette.primaryDark[600], 0.2)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`, '&:hover': { color: (theme.vars || theme).palette.primary[400], borderColor: (theme.vars || theme).palette.primaryDark[500], From 44fe455371cafc3a4b0994e538dd4cc5c25b8165 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 16:00:13 -0300 Subject: [PATCH 2/9] remove "MUI Core" from the product selector label --- docs/pages/_app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/_app.js b/docs/pages/_app.js index b17a4b54351526..a9b1066aac2118 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -163,7 +163,7 @@ function AppWrapper(props) { if (productId === 'material-ui') { return { - metadata: 'MUI Core', + metadata: '', name: 'Material UI', versions: [ { text: `v${materialPkgJson.version}`, current: true }, @@ -182,7 +182,7 @@ function AppWrapper(props) { if (productId === 'joy-ui') { return { - metadata: 'MUI Core', + metadata: '', name: 'Joy UI', versions: [{ text: `v${joyPkgJson.version}`, current: true }], }; @@ -190,7 +190,7 @@ function AppWrapper(props) { if (productId === 'system') { return { - metadata: 'MUI Core', + metadata: '', name: 'MUI System', versions: [ { text: `v${systemPkgJson.version}`, current: true }, @@ -206,7 +206,7 @@ function AppWrapper(props) { if (productId === 'base-ui') { return { - metadata: 'MUI Core', + metadata: '', name: 'Base UI', versions: [{ text: `v${basePkgJson.version}`, current: true }], }; From 2695ad74c71a4cc207f945ced7da101641919b8b Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 16:08:53 -0300 Subject: [PATCH 3/9] icon button; remove size definition from color declarations --- packages/mui-docs/src/branding/brandingTheme.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/mui-docs/src/branding/brandingTheme.ts b/packages/mui-docs/src/branding/brandingTheme.ts index 74919c69004d41..3cd175156eccbc 100644 --- a/packages/mui-docs/src/branding/brandingTheme.ts +++ b/packages/mui-docs/src/branding/brandingTheme.ts @@ -745,8 +745,6 @@ export function getThemedComponents(): ThemeOptions { props: { color: 'info' }, style: ({ theme }) => [ { - height: 34, - width: 34, color: (theme.vars || theme).palette.text.tertiary, borderRadius: theme.shape.borderRadius, border: `1px solid`, From b504896dffc87960d151d7283af16982e09c740d Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 16:09:46 -0300 Subject: [PATCH 4/9] remove unused import --- docs/src/modules/components/AppFrame.js | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index 0ce87fc01ad548..28e57f71bbe32d 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -7,7 +7,6 @@ import NProgress from 'nprogress'; import CssBaseline from '@mui/material/CssBaseline'; import AppBar from '@mui/material/AppBar'; import Stack from '@mui/material/Stack'; -import Toolbar from '@mui/material/Toolbar'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; import Box from '@mui/material/Box'; From 9ba712526ae7d819ad156bc3d2546457e94228ab Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 16:11:03 -0300 Subject: [PATCH 5/9] remove unnecessary padding declaration --- docs/src/modules/components/AppFrame.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index 28e57f71bbe32d..95f19e1ec05909 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -225,12 +225,7 @@ export default function AppFrame(props) { - setSettingsOpen(true)} - sx={{ px: '8px' }} - > + setSettingsOpen(true)}> From 17e808444137c295aea9aff8bd74dbda067d6d08 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 9 May 2024 16:23:25 -0300 Subject: [PATCH 6/9] fix lint: remove unused sx prop --- docs/src/modules/components/AppNavDrawer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/modules/components/AppNavDrawer.js b/docs/src/modules/components/AppNavDrawer.js index 8ad12a75a348f1..f5a1711605047f 100644 --- a/docs/src/modules/components/AppNavDrawer.js +++ b/docs/src/modules/components/AppNavDrawer.js @@ -322,7 +322,7 @@ export default function AppNavDrawer(props) { const drawer = React.useMemo(() => { const navItems = renderNavItems({ onClose, pages, activePageParents, depth: 0, t }); - const renderVersionSelector = (versions, sx) => { + const renderVersionSelector = (versions) => { if (!versions?.length) { return null; } From 0a06ef217d69c670caa425dbd1c27702b5e43492 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 10 May 2024 18:53:32 -0300 Subject: [PATCH 7/9] add refinements based on Colm's feedback --- .../website/branding-theme-test.tsx | 2 +- docs/src/modules/components/AppFrame.js | 12 +++---- docs/src/modules/components/AppNavDrawer.js | 9 ++--- docs/src/modules/components/AppSearch.js | 23 +++++-------- .../modules/components/ComponentPageTabs.js | 2 +- .../mui-docs/src/branding/brandingTheme.ts | 34 +++++++++++++++---- 6 files changed, 48 insertions(+), 34 deletions(-) diff --git a/docs/pages/experiments/website/branding-theme-test.tsx b/docs/pages/experiments/website/branding-theme-test.tsx index 82e5393540bdbf..67140e15e00d5b 100644 --- a/docs/pages/experiments/website/branding-theme-test.tsx +++ b/docs/pages/experiments/website/branding-theme-test.tsx @@ -43,7 +43,7 @@ export default function BrandingThemeTest() { - diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index 95f19e1ec05909..b0f2a0d5372381 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -111,6 +111,7 @@ const StyledAppBar = styled(AppBar, { width: 'calc(100% - var(--MuiDocs-navDrawer-width))', }, }), + justifyContent: 'center', boxShadow: 'none', backdropFilter: 'blur(8px)', borderBottom: '1px solid', @@ -124,10 +125,6 @@ const StyledAppBar = styled(AppBar, { }; }); -const GrowingDiv = styled('div')({ - flex: '1 1 auto', -}); - const NavIconButton = styled(IconButton, { shouldForwardProp: (prop) => prop !== 'disablePermanent', })(({ disablePermanent, theme }) => { @@ -153,7 +150,7 @@ const StyledAppNavDrawer = styled(AppNavDrawer)(({ disablePermanent, theme }) => }; }); -export const HEIGHT = 59; +export const HEIGHT = 57; export default function AppFrame(props) { const { children, disableDrawer = false, className, BannerComponent = AppFrameBanner } = props; @@ -186,7 +183,7 @@ export default function AppFrame(props) { }, }} /> - + - - + diff --git a/docs/src/modules/components/AppNavDrawer.js b/docs/src/modules/components/AppNavDrawer.js index f5a1711605047f..0665d1a5364796 100644 --- a/docs/src/modules/components/AppNavDrawer.js +++ b/docs/src/modules/components/AppNavDrawer.js @@ -45,7 +45,8 @@ function transitionTheme(theme) { const savedScrollTop = {}; const customButtonStyles = (theme) => ({ - px: 1, + pl: 1, + pr: '6px', height: 26, fontSize: theme.typography.pxToRem(13), fontWeight: theme.typography.fontWeightMedium, @@ -75,7 +76,6 @@ function ProductDrawerButton(props) { return (