Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IconButton] Add size large and update styles #26748

Merged
merged 14 commits into from
Jun 17, 2021
4 changes: 3 additions & 1 deletion docs/pages/api-docs/icon-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"size": {
"type": {
"name": "union",
"description": "'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
"description": "'small'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
Expand All @@ -39,6 +39,8 @@
"colorSecondary",
"disabled",
"sizeSmall",
"sizeMedium",
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
"sizeLarge",
"label"
],
"globalClasses": { "disabled": "Mui-disabled" },
Expand Down
4 changes: 3 additions & 1 deletion docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ function AppFrame(props) {
<AppBar className={appBarClassName}>
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label={t('appFrame.openDrawer')}
Expand Down Expand Up @@ -273,7 +274,7 @@ function AppFrame(props) {
</Menu>
</NoSsr>
<Tooltip title={t('appFrame.toggleSettings')} enterDelay={300}>
<IconButton color="inherit" onClick={handleSettingsDrawerOpen}>
<IconButton color="inherit" size="large" onClick={handleSettingsDrawerOpen}>
<SettingsIcon />
</IconButton>
</Tooltip>
Expand All @@ -285,6 +286,7 @@ function AppFrame(props) {
href={process.env.SOURCE_CODE_REPO}
data-ga-event-category="header"
data-ga-event-action="github"
size="large"
>
<GitHubIcon />
</IconButton>
Expand Down
7 changes: 7 additions & 0 deletions docs/src/modules/components/DemoToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const useDemoToolbarStyles = makeStyles(
height: theme.spacing(6),
},
justifyContent: 'space-between',
alignItems: 'center',
},
toggleButtonGroup: {
margin: '8px 0',
Expand Down Expand Up @@ -480,6 +481,7 @@ export default function DemoToolbar(props) {
placement="bottom"
>
<IconButton
size="large"
aria-controls={openDemoSource ? demoSourceId : null}
data-ga-event-category="demo"
data-ga-event-label={demoOptions.demo}
Expand All @@ -498,6 +500,7 @@ export default function DemoToolbar(props) {
placement="bottom"
>
<IconButton
size="large"
data-ga-event-category="demo"
data-ga-event-label={demoOptions.demo}
data-ga-event-action="codesandbox"
Expand All @@ -510,6 +513,7 @@ export default function DemoToolbar(props) {
)}
<Tooltip classes={{ popper: classes.tooltip }} title={t('copySource')} placement="bottom">
<IconButton
size="large"
data-ga-event-category="demo"
data-ga-event-label={demoOptions.demo}
data-ga-event-action="copy"
Expand All @@ -521,6 +525,7 @@ export default function DemoToolbar(props) {
</Tooltip>
<Tooltip classes={{ popper: classes.tooltip }} title={t('resetFocus')} placement="bottom">
<IconButton
size="large"
data-ga-event-category="demo"
data-ga-event-label={demoOptions.demo}
data-ga-event-action="reset-focus"
Expand All @@ -532,6 +537,7 @@ export default function DemoToolbar(props) {
</Tooltip>
<Tooltip classes={{ popper: classes.tooltip }} title={t('resetDemo')} placement="bottom">
<IconButton
size="large"
aria-controls={demoId}
data-ga-event-category="demo"
data-ga-event-label={demoOptions.demo}
Expand All @@ -543,6 +549,7 @@ export default function DemoToolbar(props) {
</IconButton>
</Tooltip>
<IconButton
size="large"
onClick={handleMoreClick}
aria-label={t('seeMore')}
aria-owns={anchorEl ? 'demo-menu-more' : undefined}
Expand Down
1 change: 1 addition & 0 deletions docs/src/modules/components/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default function Notifications() {
>
<IconButton
color="inherit"
size="large"
ref={anchorRef}
aria-controls={open ? 'notifications-popup' : undefined}
aria-haspopup="true"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/app-bar/BottomAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function BottomAppBar() {
</Paper>
<AppBar position="fixed" color="primary" sx={{ top: 'auto', bottom: 0 }}>
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="open drawer">
<IconButton color="inherit" aria-label="open drawer">
<MenuIcon />
</IconButton>
<StyledFab color="secondary" aria-label="add">
Expand All @@ -122,7 +122,7 @@ export default function BottomAppBar() {
<IconButton color="inherit">
<SearchIcon />
</IconButton>
<IconButton edge="end" color="inherit">
<IconButton color="inherit">
<MoreIcon />
</IconButton>
</Toolbar>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/app-bar/BottomAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function BottomAppBar() {
</Paper>
<AppBar position="fixed" color="primary" sx={{ top: 'auto', bottom: 0 }}>
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="open drawer">
<IconButton color="inherit" aria-label="open drawer">
<MenuIcon />
</IconButton>
<StyledFab color="secondary" aria-label="add">
Expand All @@ -120,7 +120,7 @@ export default function BottomAppBar() {
<IconButton color="inherit">
<SearchIcon />
</IconButton>
<IconButton edge="end" color="inherit">
<IconButton color="inherit">
<MoreIcon />
</IconButton>
</Toolbar>
Expand Down
8 changes: 7 additions & 1 deletion docs/src/pages/components/app-bar/ButtonAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export default function ButtonAppBar() {
<Box sx={{ flexGrow: 1 }}>
<AppBar position="static">
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }}>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Expand Down
8 changes: 7 additions & 1 deletion docs/src/pages/components/app-bar/ButtonAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export default function ButtonAppBar() {
<Box sx={{ flexGrow: 1 }}>
<AppBar position="static">
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }}>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Expand Down
9 changes: 8 additions & 1 deletion docs/src/pages/components/app-bar/MenuAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export default function MenuAppBar() {
</FormGroup>
<AppBar position="static">
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }}>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Expand All @@ -53,6 +59,7 @@ export default function MenuAppBar() {
{auth && (
<div>
<IconButton
size="large"
aria-label="account of current user"
aria-controls="menu-appbar"
aria-haspopup="true"
Expand Down
9 changes: 8 additions & 1 deletion docs/src/pages/components/app-bar/MenuAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export default function MenuAppBar() {
</FormGroup>
<AppBar position="static">
<Toolbar>
<IconButton edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }}>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Expand All @@ -53,6 +59,7 @@ export default function MenuAppBar() {
{auth && (
<div>
<IconButton
size="large"
aria-label="account of current user"
aria-controls="menu-appbar"
aria-haspopup="true"
Expand Down
20 changes: 16 additions & 4 deletions docs/src/pages/components/app-bar/PrimarySearchAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,19 @@ export default function PrimarySearchAppBar() {
onClose={handleMobileMenuClose}
>
<MenuItem>
<IconButton aria-label="show 4 new mails" color="inherit">
<IconButton size="large" aria-label="show 4 new mails" color="inherit">
<Badge badgeContent={4} color="secondary">
<MailIcon />
</Badge>
</IconButton>
<p>Messages</p>
</MenuItem>
<MenuItem>
<IconButton aria-label="show 11 new notifications" color="inherit">
<IconButton
size="large"
aria-label="show 11 new notifications"
color="inherit"
>
<Badge badgeContent={11} color="secondary">
<NotificationsIcon />
</Badge>
Expand All @@ -137,6 +141,7 @@ export default function PrimarySearchAppBar() {
</MenuItem>
<MenuItem onClick={handleProfileMenuOpen}>
<IconButton
size="large"
aria-label="account of current user"
aria-controls="primary-search-account-menu"
aria-haspopup="true"
Expand All @@ -154,6 +159,7 @@ export default function PrimarySearchAppBar() {
<AppBar position="static">
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="open drawer"
Expand All @@ -180,17 +186,22 @@ export default function PrimarySearchAppBar() {
</Search>
<Box sx={{ flexGrow: 1 }} />
<Box sx={{ display: { xs: 'none', md: 'flex' } }}>
<IconButton aria-label="show 4 new mails" color="inherit">
<IconButton size="large" aria-label="show 4 new mails" color="inherit">
<Badge badgeContent={4} color="secondary">
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show 17 new notifications" color="inherit">
<IconButton
size="large"
aria-label="show 17 new notifications"
color="inherit"
>
<Badge badgeContent={17} color="secondary">
<NotificationsIcon />
</Badge>
</IconButton>
<IconButton
size="large"
edge="end"
aria-label="account of current user"
aria-controls={menuId}
Expand All @@ -203,6 +214,7 @@ export default function PrimarySearchAppBar() {
</Box>
<Box sx={{ display: { xs: 'flex', md: 'none' } }}>
<IconButton
size="large"
aria-label="show more"
aria-controls={mobileMenuId}
aria-haspopup="true"
Expand Down
20 changes: 16 additions & 4 deletions docs/src/pages/components/app-bar/PrimarySearchAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,19 @@ export default function PrimarySearchAppBar() {
onClose={handleMobileMenuClose}
>
<MenuItem>
<IconButton aria-label="show 4 new mails" color="inherit">
<IconButton size="large" aria-label="show 4 new mails" color="inherit">
<Badge badgeContent={4} color="secondary">
<MailIcon />
</Badge>
</IconButton>
<p>Messages</p>
</MenuItem>
<MenuItem>
<IconButton aria-label="show 11 new notifications" color="inherit">
<IconButton
size="large"
aria-label="show 11 new notifications"
color="inherit"
>
<Badge badgeContent={11} color="secondary">
<NotificationsIcon />
</Badge>
Expand All @@ -138,6 +142,7 @@ export default function PrimarySearchAppBar() {
</MenuItem>
<MenuItem onClick={handleProfileMenuOpen}>
<IconButton
size="large"
aria-label="account of current user"
aria-controls="primary-search-account-menu"
aria-haspopup="true"
Expand All @@ -155,6 +160,7 @@ export default function PrimarySearchAppBar() {
<AppBar position="static">
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="open drawer"
Expand All @@ -181,17 +187,22 @@ export default function PrimarySearchAppBar() {
</Search>
<Box sx={{ flexGrow: 1 }} />
<Box sx={{ display: { xs: 'none', md: 'flex' } }}>
<IconButton aria-label="show 4 new mails" color="inherit">
<IconButton size="large" aria-label="show 4 new mails" color="inherit">
<Badge badgeContent={4} color="secondary">
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show 17 new notifications" color="inherit">
<IconButton
size="large"
aria-label="show 17 new notifications"
color="inherit"
>
<Badge badgeContent={17} color="secondary">
<NotificationsIcon />
</Badge>
</IconButton>
<IconButton
size="large"
edge="end"
aria-label="account of current user"
aria-controls={menuId}
Expand All @@ -204,6 +215,7 @@ export default function PrimarySearchAppBar() {
</Box>
<Box sx={{ display: { xs: 'flex', md: 'none' } }}>
<IconButton
size="large"
aria-label="show more"
aria-controls={mobileMenuId}
aria-haspopup="true"
Expand Down
10 changes: 8 additions & 2 deletions docs/src/pages/components/app-bar/ProminentAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function ProminentAppBar() {
<AppBar position="static">
<StyledToolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="open drawer"
Expand All @@ -40,10 +41,15 @@ export default function ProminentAppBar() {
>
Material-UI
</Typography>
<IconButton aria-label="search" color="inherit">
<IconButton size="large" aria-label="search" color="inherit">
<SearchIcon />
</IconButton>
<IconButton aria-label="display more actions" edge="end" color="inherit">
<IconButton
size="large"
aria-label="display more actions"
edge="end"
color="inherit"
>
<MoreIcon />
</IconButton>
</StyledToolbar>
Expand Down
Loading