Skip to content

Commit

Permalink
[docs] Migrate system props to sx prop (#42475)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored Jun 5, 2024
1 parent 460d6f7 commit 6fe1242
Show file tree
Hide file tree
Showing 810 changed files with 3,208 additions and 4,422 deletions.
11 changes: 7 additions & 4 deletions docs/data/base/components/badge/BadgeVisibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,20 @@ export default function BadgeVisibility() {
};

return (
<Stack direction="column" justifyContent="center" spacing={1} useFlexGap>
<Stack
direction="column"
spacing={1}
useFlexGap
sx={{ justifyContent: 'center' }}
>
<Badge badgeContent={count} invisible={invisible}>
<MailIcon />
</Badge>
<Divider sx={{ my: 2 }} />
<Stack
direction="row"
justifyContent="center"
alignItems="center"
gap={1}
useFlexGap
sx={{ justifyContent: 'center', alignItems: 'center', gap: 1 }}
>
<StyledButton
aria-label="decrease"
Expand Down
11 changes: 7 additions & 4 deletions docs/data/base/components/badge/BadgeVisibility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,20 @@ export default function BadgeVisibility() {
};

return (
<Stack direction="column" justifyContent="center" spacing={1} useFlexGap>
<Stack
direction="column"
spacing={1}
useFlexGap
sx={{ justifyContent: 'center' }}
>
<Badge badgeContent={count} invisible={invisible}>
<MailIcon />
</Badge>
<Divider sx={{ my: 2 }} />
<Stack
direction="row"
justifyContent="center"
alignItems="center"
gap={1}
useFlexGap
sx={{ justifyContent: 'center', alignItems: 'center', gap: 1 }}
>
<StyledButton
aria-label="decrease"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function ContainedToggleTrappedFocus() {

return (
<FocusTrap open={open} disableRestoreFocus disableAutoFocus>
<Stack alignItems="center" spacing={2}>
<Stack spacing={2} sx={{ alignItems: 'center' }}>
<button type="button" onClick={() => setOpen(!open)}>
{open ? 'Close' : 'Open'}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function ContainedToggleTrappedFocus() {

return (
<FocusTrap open={open} disableRestoreFocus disableAutoFocus>
<Stack alignItems="center" spacing={2}>
<Stack spacing={2} sx={{ alignItems: 'center' }}>
<button type="button" onClick={() => setOpen(!open)}>
{open ? 'Close' : 'Open'}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<FocusTrap open={open} disableRestoreFocus disableAutoFocus>
<Stack alignItems="center" spacing={2}>
<Stack spacing={2} sx={{ alignItems: 'center' }}>
<button type="button" onClick={() => setOpen(!open)}>
{open ? 'Close' : 'Open'}
</button>
Expand Down
6 changes: 1 addition & 5 deletions docs/data/base/components/input/InputAdornments.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ export default function InputAdornments() {

return (
<Box
sx={{
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
gap: 2,
}}
sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2 }}
>
<Input
id="outlined-start-adornment"
Expand Down
6 changes: 1 addition & 5 deletions docs/data/base/components/input/InputAdornments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ export default function InputAdornments() {

return (
<Box
sx={{
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
gap: 2,
}}
sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2 }}
>
<Input
id="outlined-start-adornment"
Expand Down
8 changes: 1 addition & 7 deletions docs/data/base/components/input/OTPInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,7 @@ export default function OTPInput() {
const [otp, setOtp] = React.useState('');

return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
gap: 2,
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<OTP separator={<span>-</span>} value={otp} onChange={setOtp} length={5} />
<span>Entered value: {otp}</span>
</Box>
Expand Down
8 changes: 1 addition & 7 deletions docs/data/base/components/input/OTPInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,7 @@ export default function OTPInput() {
const [otp, setOtp] = React.useState('');

return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
gap: 2,
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<OTP separator={<span>-</span>} value={otp} onChange={setOtp} length={5} />
<span>Entered value: {otp}</span>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) {
export default function NumberInputAdornments() {
return (
<Box
sx={{
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
gap: 2,
}}
sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2 }}
>
<NumberInput
startAdornment={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ const NumberInput = React.forwardRef(function CustomNumberInput(
export default function NumberInputAdornments() {
return (
<Box
sx={{
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
gap: 2,
}}
sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2 }}
>
<NumberInput
startAdornment={
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/accordion/AccordionTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BrandingProvider } from '@mui/docs/branding';
export default function AccordionTransition() {
const [transition, setTransition] = React.useState('0.2s ease');
return (
<Stack alignItems="center" spacing={2} sx={{ flex: 1 }}>
<Stack spacing={2} sx={{ alignItems: 'center', flex: 1 }}>
<RadioGroup
orientation="horizontal"
value={transition}
Expand Down
3 changes: 1 addition & 2 deletions docs/data/joy/components/alert/AlertColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ export default function AlertColors() {
<Sheet sx={{ pl: 4, ml: 3, borderLeft: '1px solid', borderColor: 'divider' }}>
<Typography
level="body-sm"
fontWeight="xl"
id="variant-label"
textColor="text.primary"
mb={1}
sx={{ fontWeight: 'xl', mb: 1 }}
>
Variant:
</Typography>
Expand Down
3 changes: 1 addition & 2 deletions docs/data/joy/components/alert/AlertColors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ export default function AlertColors() {
<Sheet sx={{ pl: 4, ml: 3, borderLeft: '1px solid', borderColor: 'divider' }}>
<Typography
level="body-sm"
fontWeight="xl"
id="variant-label"
textColor="text.primary"
mb={1}
sx={{ fontWeight: 'xl', mb: 1 }}
>
Variant:
</Typography>
Expand Down
6 changes: 1 addition & 5 deletions docs/data/joy/components/aspect-ratio/CustomRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export default function CustomRatio() {
<AspectRatio
variant="outlined"
ratio="4/3"
sx={{
width: 300,
bgcolor: 'background.level2',
borderRadius: 'md',
}}
sx={{ width: 300, bgcolor: 'background.level2', borderRadius: 'md' }}
>
<Typography level="h2" component="div">
4/3
Expand Down
6 changes: 1 addition & 5 deletions docs/data/joy/components/aspect-ratio/CustomRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export default function CustomRatio() {
<AspectRatio
variant="outlined"
ratio="4/3"
sx={{
width: 300,
bgcolor: 'background.level2',
borderRadius: 'md',
}}
sx={{ width: 300, bgcolor: 'background.level2', borderRadius: 'md' }}
>
<Typography level="h2" component="div">
4/3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<AspectRatio
variant="outlined"
ratio="4/3"
sx={{
width: 300,
bgcolor: 'background.level2',
borderRadius: 'md',
}}
sx={{ width: 300, bgcolor: 'background.level2', borderRadius: 'md' }}
>
<Typography level="h2" component="div">
4/3
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/aspect-ratio/FlexAspectRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Switch from '@mui/joy/Switch';
export default function FlexAspectRatio() {
const [flex, setFlex] = React.useState(false);
return (
<Stack spacing={2} alignItems="center">
<Stack spacing={2} sx={{ alignItems: 'center' }}>
<FormControl orientation="horizontal">
<FormLabel>Flex</FormLabel>
<Switch checked={flex} onChange={(event) => setFlex(event.target.checked)} />
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/aspect-ratio/FlexAspectRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Switch from '@mui/joy/Switch';
export default function FlexAspectRatio() {
const [flex, setFlex] = React.useState(false);
return (
<Stack spacing={2} alignItems="center">
<Stack spacing={2} sx={{ alignItems: 'center' }}>
<FormControl orientation="horizontal">
<FormLabel>Flex</FormLabel>
<Switch checked={flex} onChange={(event) => setFlex(event.target.checked)} />
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/aspect-ratio/ListStackRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ListStackRatio() {
/>
</AspectRatio>
<ListItemContent>
<Typography fontWeight="md">{item.title}</Typography>
<Typography sx={{ fontWeight: 'md' }}>{item.title}</Typography>
<Typography level="body-sm">{item.description}</Typography>
</ListItemContent>
</ListItemButton>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/aspect-ratio/ListStackRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ListStackRatio() {
/>
</AspectRatio>
<ListItemContent>
<Typography fontWeight="md">{item.title}</Typography>
<Typography sx={{ fontWeight: 'md' }}>{item.title}</Typography>
<Typography level="body-sm">{item.description}</Typography>
</ListItemContent>
</ListItemButton>
Expand Down
8 changes: 4 additions & 4 deletions docs/data/joy/components/aspect-ratio/VariantsRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ export default function VariantsRatio() {
<Grid container spacing={2} sx={{ width: '100%' }}>
<Grid xs={6} md>
<AspectRatio variant="solid">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Solid
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="soft">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Soft
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="outlined">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Outlined
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="plain">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Plain
</Typography>
</AspectRatio>
Expand Down
8 changes: 4 additions & 4 deletions docs/data/joy/components/aspect-ratio/VariantsRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ export default function VariantsRatio() {
<Grid container spacing={2} sx={{ width: '100%' }}>
<Grid xs={6} md>
<AspectRatio variant="solid">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Solid
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="soft">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Soft
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="outlined">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Outlined
</Typography>
</AspectRatio>
</Grid>
<Grid xs={6} md>
<AspectRatio variant="plain">
<Typography level="inherit" fontWeight="lg">
<Typography level="inherit" sx={{ fontWeight: 'lg' }}>
Plain
</Typography>
</AspectRatio>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,14 @@ export default function FreeSoloCreateOptionDialog() {
id="basic-modal-dialog-title"
component="h2"
level="inherit"
fontSize="1.25em"
mb="0.25em"
sx={{ fontSize: '1.25em', mb: '0.25em' }}
>
Add a new film
</Typography>
<Typography
id="basic-modal-dialog-description"
mt={0.5}
mb={2}
textColor="text.tertiary"
sx={{ mt: 0.5, mb: 2 }}
>
Did you miss any film in our list? Please, add it!
</Typography>
Expand Down Expand Up @@ -147,7 +145,7 @@ export default function FreeSoloCreateOptionDialog() {
}
/>
</FormControl>
<Stack direction="row" justifyContent="flex-end" spacing={2}>
<Stack direction="row" spacing={2} sx={{ justifyContent: 'flex-end' }}>
<Button variant="plain" color="neutral" onClick={handleClose}>
Cancel
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,14 @@ export default function FreeSoloCreateOptionDialog() {
id="basic-modal-dialog-title"
component="h2"
level="inherit"
fontSize="1.25em"
mb="0.25em"
sx={{ fontSize: '1.25em', mb: '0.25em' }}
>
Add a new film
</Typography>
<Typography
id="basic-modal-dialog-description"
mt={0.5}
mb={2}
textColor="text.tertiary"
sx={{ mt: 0.5, mb: 2 }}
>
Did you miss any film in our list? Please, add it!
</Typography>
Expand Down Expand Up @@ -147,7 +145,7 @@ export default function FreeSoloCreateOptionDialog() {
}
/>
</FormControl>
<Stack direction="row" justifyContent="flex-end" spacing={2}>
<Stack direction="row" spacing={2} sx={{ justifyContent: 'flex-end' }}>
<Button variant="plain" color="neutral" onClick={handleClose}>
Cancel
</Button>
Expand Down
Loading

0 comments on commit 6fe1242

Please sign in to comment.