Skip to content

Commit

Permalink
[core] Fix docs demo export function consistency (#38191)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Aug 5, 2023
1 parent 0dcc6fa commit 03e1598
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 30 deletions.
16 changes: 6 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ module.exports = {
],
},
},
// Next.js entry points pages
{
files: ['docs/pages/**/*.js'],
rules: {
Expand All @@ -284,12 +285,7 @@ module.exports = {
},
// demos
{
files: [
'docs/src/pages/**/*.js',
'docs/src/pages/**/*.tsx',
'docs/data/**/*.js',
'docs/data/**/*.tsx',
],
files: ['docs/src/pages/**/*{.tsx,.js}', 'docs/data/**/*{.tsx,.js}'],
rules: {
// This most often reports data that is defined after the component definition.
// This is safe to do and helps readability of the demo code since the data is mostly irrelevant.
Expand All @@ -300,12 +296,12 @@ module.exports = {
},
},
{
files: ['docs/data/**/*.tsx'],
files: ['docs/data/**/*{.tsx,.js}'],
excludedFiles: [
'docs/data/joy/getting-started/templates/**/*.tsx',
'docs/data/**/css/*.tsx',
'docs/data/**/system/*.tsx',
'docs/data/**/tailwind/*.tsx',
'docs/data/**/css/*{.tsx,.js}',
'docs/data/**/system/*{.tsx,.js}',
'docs/data/**/tailwind/*{.tsx,.js}',
],
rules: {
'filenames/match-exported': ['error'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { TextareaAutosize } from '@mui/base/TextareaAutosize';
import { styled } from '@mui/system';

export default function EmptyTextarea() {
export default function UnstyledTextareaIntroduction() {
const blue = {
100: '#DAECFF',
200: '#b6daff',
Expand Down Expand Up @@ -40,16 +40,16 @@ export default function EmptyTextarea() {
box-shadow: 0px 2px 24px ${
theme.palette.mode === 'dark' ? blue[900] : blue[100]
};
&:hover {
border-color: ${blue[400]};
}
&:focus {
border-color: ${blue[400]};
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]};
}
// firefox
&:focus-visible {
outline: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/joy/Stack';
import LiveTv from '@mui/icons-material/LiveTv';
import JoyVariablesDemo from 'docs/src/modules/components/JoyVariablesDemo';

export default function ButtonVariables() {
export default function AutocompleteVariables() {
return (
<JoyVariablesDemo
componentName="Autocomplete"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/button-group/ButtonGroupUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import IconButton from '@mui/joy/IconButton';
import FavoriteBorder from '@mui/icons-material/FavoriteBorder';
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';

export default function ButtonUsage() {
export default function ButtonGroupUsage() {
return (
<JoyUsageDemo
componentName="ButtonGroup"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/button/ButtonsSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import Button from '@mui/joy/Button';
import Box from '@mui/joy/Box';

export default function UnstyledButtonsSimple() {
export default function ButtonsSimple() {
return (
<Box>
<Button>Button</Button>
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/chip/ChipUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import Chip from '@mui/joy/Chip';
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';

export default function ChipUsages() {
export default function ChipUsage() {
return (
<JoyUsageDemo
componentName="Chip"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/table/TableUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Sheet from '@mui/joy/Sheet';
import Typography from '@mui/joy/Typography';
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';

export default function ButtonUsage() {
export default function TableUsage() {
return (
<JoyUsageDemo
componentName="Table"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/tabs/TabsVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Tab from '@mui/joy/Tab';
import TabPanel from '@mui/joy/TabPanel';
import JoyVariablesDemo from 'docs/src/modules/components/JoyVariablesDemo';

export default function ListVariables() {
export default function TabsVariables() {
return (
<JoyVariablesDemo
componentName="Tabs"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/typography/TypographyUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Box from '@mui/joy/Box';
import Typography from '@mui/joy/Typography';
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';

export default function TypographyUsages() {
export default function TypographyUsage() {
return (
<JoyUsageDemo
componentName="Typography"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const theme = extendTheme({
const useEnhancedEffect =
typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;

export default function BootstrapVariantTokens() {
export default function RemoveActiveTokens() {
// the `node` is used for attaching CSS variables to this demo, you might not need it in your application.
const [node, setNode] = React.useState(null);
useEnhancedEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/getting-started/tutorial/LoginFinal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ModeToggle() {
);
}

export default function App() {
export default function LoginFinal() {
return (
<CssVarsProvider>
<main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Input from '@mui/joy/Input';
import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';

export default function InputIntegration() {
export default function InputVariables() {
const [radius, setRadius] = React.useState(16);
const [childHeight, setChildHeight] = React.useState(32);
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ToggleOffRoundedIcon from '@mui/icons-material/ToggleOffRounded';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import BrandingProvider from 'docs/src/BrandingProvider';

export default function ButtonThemes() {
export default function ListThemes() {
const [preset, setPreset] = React.useState('');
const rootPresets = {
dense: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from '@mui/material-next/Button';
import FavoriteBorder from '@mui/icons-material/FavoriteBorder';
import MaterialYouUsageDemo from 'docs/src/modules/components/MaterialYouUsageDemo';

export default function ButtonUsage() {
export default function ButtonMaterialYouPlayground() {
const [variant, setVariant] = React.useState('text');
return (
<MaterialYouUsageDemo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Slider from '@mui/material-next/Slider';
import Box from '@mui/material/Box';
import MaterialYouUsageDemo from 'docs/src/modules/components/MaterialYouUsageDemo';

export default function ButtonUsage() {
export default function SliderMaterialYouPlayground() {
return (
<MaterialYouUsageDemo
componentName="Slider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const colors = [
];
const variants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1'];

export default function ResponsiveFontSizes() {
export default function ResponsiveFontSizesChart() {
const convert = convertLength(theme.typography.htmlFontSize);
const toPx = (rem) => parseFloat(convert(rem, 'px'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CssVarsCustomButton = styled(Button)({
const useEnhancedEffect =
typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;

export default function App() {
export default function CssVariablesCustomization() {
// the `node` is used for attaching CSS variables to this demo, you might not need it in your application.
const [node, setNode] = React.useState(null);
useEnhancedEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Box from '@mui/material/Box';
import Grid2 from '@mui/material/Unstable_Grid2';
import Typography from '@mui/material/Typography';

export default function GridsDiff() {
export default function GridDisableEqualOverflow() {
return (
<Box sx={{ pt: 3 }}>
<Box sx={{ border: '1px solid', borderColor: 'primary.main' }}>
Expand Down

0 comments on commit 03e1598

Please sign in to comment.