Skip to content

Commit

Permalink
[docs-infra] Allow Link component to receive the role attribute (#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed Jun 13, 2024
1 parent 6c2874a commit 424dfff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/pages/experiments/website/branding-theme-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AppHeader from 'docs/src/layouts/AppHeader';
import Section from 'docs/src/layouts/Section';
import AppFooter from 'docs/src/layouts/AppFooter';
import GitHubIcon from '@mui/icons-material/GitHub';
import { Link } from '@mui/docs/Link';

export default function BrandingThemeTest() {
return (
Expand All @@ -18,6 +19,12 @@ export default function BrandingThemeTest() {
<AppHeader gitHubRepository="https://github.com/mui/material-ui" />
<main id="main-content">
<Section>
<Stack direction="row" spacing={2} useFlexGap sx={{ width: 'fit-content', mb: 4 }}>
<Link href="/">Link with no role</Link>
<Link href="/" role="menuitem">
Link role menuitem
</Link>
</Stack>
<Stack direction="row" spacing={2} useFlexGap sx={{ width: 'fit-content' }}>
<Chip size="small" variant="outlined" color="primary" label="Hiring" />
<Chip size="small" variant="outlined" color="info" label="Hiring" />
Expand Down
1 change: 0 additions & 1 deletion packages/mui-docs/src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link
noLinkStyle,
prefetch,
replace,
role, // Link don't have roles.
scroll,
shallow,
...other
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-docs/src/branding/brandingTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ export function getThemedComponents(): ThemeOptions {
root: ({ theme }) => ({
display: 'inline-flex',
alignItems: 'center',
fontWeight: theme.typography.fontWeightSemiBold,
fontWeight: theme.typography.fontWeightMedium,
'&.MuiTypography-body1 > svg': {
marginTop: 2,
},
Expand Down

0 comments on commit 424dfff

Please sign in to comment.