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

[base] Remove unstyled suffix from Base components + Codemod script #36873

Merged
merged 29 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e23b8c6
[codemod][base] Codemod script for removal of unstyled suffix
hbjORbj Apr 13, 2023
1e8413b
changes in mui-base package
hbjORbj Apr 17, 2023
6203e72
changes in mui-joy package
hbjORbj Apr 17, 2023
33a7a75
changes in mui-material package
hbjORbj Apr 17, 2023
cb37c4c
changes in mui-material-next package
hbjORbj Apr 17, 2023
8f10ad6
changes in docs/data/base
hbjORbj Apr 18, 2023
ede7dbd
changes in docs/data/joy
hbjORbj Apr 18, 2023
3aa466f
changes in docs/pages/base
hbjORbj Apr 18, 2023
1dafdb0
changes in docs/pages/experiments/base
hbjORbj Apr 18, 2023
ce8ab26
remove unstyled.json files from docs/translations/api-docs
hbjORbj Apr 18, 2023
4c0ccb4
add base component json files to docs/translations/api-docs-base
hbjORbj Apr 18, 2023
c1bb45a
changes in docs/translations
hbjORbj Apr 18, 2023
c6bc6b1
changes in packages/api-docs-builder
hbjORbj Apr 18, 2023
db47961
final changes
hbjORbj Apr 19, 2023
ee8c016
Add a new codemod script that doesn't remove suffix from default import
hbjORbj Apr 19, 2023
1b3d2b3
improve codemod again
hbjORbj Apr 20, 2023
7354b77
only change imports
hbjORbj Apr 21, 2023
7dfe145
Refactor the method for detecting the unstyled components
mnajdova Apr 21, 2023
097e9e5
remove unused variables
hbjORbj Apr 22, 2023
c4399ad
run docs:api script
hbjORbj Apr 24, 2023
0752ca7
address comments
hbjORbj Apr 24, 2023
900ee37
address 1 more comment
hbjORbj Apr 24, 2023
dd0cefa
leave explanatory comment
hbjORbj Apr 24, 2023
be3e07a
revert changes in replaceUrl and its test
hbjORbj Apr 24, 2023
25105fe
Add previous redirects too
mnajdova Apr 24, 2023
35325a7
Add effect to remove the unstyled suffix from the anchors
mnajdova Apr 24, 2023
d1b9c21
add comment
mnajdova Apr 24, 2023
277d5c8
Fix the double hash change on the API links
mnajdova Apr 24, 2023
1d1b84a
Remove unnecesery catch statement
mnajdova Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/AccessibleBadges.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

function notificationsLabel(count) {
Expand Down Expand Up @@ -31,7 +31,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -43,7 +43,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/AccessibleBadges.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

function notificationsLabel(count: number) {
Expand Down Expand Up @@ -31,7 +31,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -43,7 +43,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/BadgeMax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function BadgeMax() {
Expand All @@ -28,7 +28,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -40,7 +40,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/BadgeMax.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function BadgeMax() {
Expand All @@ -28,7 +28,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -40,7 +40,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/badge/BadgeVisibility.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import ButtonGroup from '@mui/material/ButtonGroup';
import Button from '@mui/material/Button';
import AddIcon from '@mui/icons-material/Add';
Expand All @@ -27,7 +27,7 @@ export default function BadgeVisibility() {
'& > *': {
marginBottom: 2,
},
[`& .${badgeUnstyledClasses.root}`]: {
[`& .${badgeClasses.root}`]: {
marginRight: 4,
},
}}
Expand Down Expand Up @@ -77,7 +77,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -89,7 +89,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand All @@ -110,7 +110,7 @@ const StyledBadge = styled(BadgeUnstyled)(
transform-origin: 100% 0;
}

& .${badgeUnstyledClasses.invisible} {
& .${badgeClasses.invisible} {
opacity: 0;
pointer-events: none;
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/badge/BadgeVisibility.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import ButtonGroup from '@mui/material/ButtonGroup';
import Button from '@mui/material/Button';
import AddIcon from '@mui/icons-material/Add';
Expand All @@ -27,7 +27,7 @@ export default function BadgeVisibility() {
'& > *': {
marginBottom: 2,
},
[`& .${badgeUnstyledClasses.root}`]: {
[`& .${badgeClasses.root}`]: {
marginRight: 4,
},
}}
Expand Down Expand Up @@ -77,7 +77,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -89,7 +89,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand All @@ -110,7 +110,7 @@ const StyledBadge = styled(BadgeUnstyled)(
transform-origin: 100% 0;
}

& .${badgeUnstyledClasses.invisible} {
& .${badgeClasses.invisible} {
opacity: 0;
pointer-events: none;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/ShowZeroBadge.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function ShowZeroBadge() {
Expand All @@ -26,7 +26,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -38,7 +38,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand All @@ -59,7 +59,7 @@ const StyledBadge = styled(BadgeUnstyled)(
transform-origin: 100% 0;
}

& .${badgeUnstyledClasses.invisible} {
& .${badgeClasses.invisible} {
display: none;
}
`,
Expand Down
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/ShowZeroBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function ShowZeroBadge() {
Expand All @@ -26,7 +26,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -38,7 +38,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand All @@ -59,7 +59,7 @@ const StyledBadge = styled(BadgeUnstyled)(
transform-origin: 100% 0;
}

& .${badgeUnstyledClasses.invisible} {
& .${badgeClasses.invisible} {
display: none;
}
`,
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/UnstyledBadge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand Down Expand Up @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -50,7 +50,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/UnstyledBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand Down Expand Up @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -50,7 +50,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/UnstyledBadgeIntroduction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand Down Expand Up @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -50,7 +50,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
6 changes: 3 additions & 3 deletions docs/data/base/components/badge/UnstyledBadgeIntroduction.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import BadgeUnstyled, { badgeUnstyledClasses } from '@mui/base/BadgeUnstyled';
import Badge, { badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand Down Expand Up @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(BadgeUnstyled)(
const StyledBadge = styled(Badge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand All @@ -50,7 +50,7 @@ const StyledBadge = styled(BadgeUnstyled)(
display: inline-block;
line-height: 1;

& .${badgeUnstyledClasses.badge} {
& .${badgeClasses.badge} {
z-index: auto;
position: absolute;
top: 0;
Expand Down
Loading