forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[Hidden] Remove component (mui#26135)"
This reverts commit 2b50b0f.
- Loading branch information
1 parent
02d6348
commit 117a081
Showing
48 changed files
with
2,276 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './hidden.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context('docs/translations/api-docs/hidden', false, /hidden.*.json$/); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"props": { | ||
"children": { "type": { "name": "node" } }, | ||
"implementation": { | ||
"type": { "name": "enum", "description": "'css'<br>| 'js'" }, | ||
"default": "'js'" | ||
}, | ||
"initialWidth": { | ||
"type": { | ||
"name": "enum", | ||
"description": "'xs'<br>| 'sm'<br>| 'md'<br>| 'lg'<br>| 'xl'" | ||
} | ||
}, | ||
"lgDown": { "type": { "name": "bool" } }, | ||
"lgUp": { "type": { "name": "bool" } }, | ||
"mdDown": { "type": { "name": "bool" } }, | ||
"mdUp": { "type": { "name": "bool" } }, | ||
"only": { | ||
"type": { | ||
"name": "union", | ||
"description": "'xs'<br>| 'sm'<br>| 'md'<br>| 'lg'<br>| 'xl'<br>| Array<'xs'<br>| 'sm'<br>| 'md'<br>| 'lg'<br>| 'xl'>" | ||
} | ||
}, | ||
"smDown": { "type": { "name": "bool" } }, | ||
"smUp": { "type": { "name": "bool" } }, | ||
"xlDown": { "type": { "name": "bool" } }, | ||
"xlUp": { "type": { "name": "bool" } }, | ||
"xsDown": { "type": { "name": "bool" } }, | ||
"xsUp": { "type": { "name": "bool" } } | ||
}, | ||
"name": "Hidden", | ||
"styles": { "classes": [], "globalClasses": {}, "name": null }, | ||
"spread": true, | ||
"filename": "/packages/material-ui/src/Hidden/Hidden.js", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/components/hidden/\">Hidden</a></li></ul>", | ||
"styledComponent": true, | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
||
const pageFilename = 'components/hidden'; | ||
const requireDemo = require.context('docs/src/pages/components/hidden', false, /\.(js|tsx)$/); | ||
const requireRaw = require.context( | ||
'!raw-loader!../../src/pages/components/hidden', | ||
false, | ||
/\.(js|md|tsx)$/, | ||
); | ||
|
||
export default function Page({ demos, docs }) { | ||
return <MarkdownDocs demos={demos} docs={docs} requireDemo={requireDemo} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
return { demos, docs }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Hidden from '@material-ui/core/Hidden'; | ||
import withWidth from '@material-ui/core/withWidth'; | ||
import Typography from '@material-ui/core/Typography'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
}, | ||
container: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}, | ||
paper: { | ||
padding: theme.spacing(2), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
flex: '1 0 auto', | ||
margin: theme.spacing(1), | ||
}, | ||
})); | ||
|
||
function BreakpointDown(props) { | ||
const classes = useStyles(); | ||
const { width } = props; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Typography variant="subtitle1" component="div"> | ||
Current width: {width} | ||
</Typography> | ||
<div className={classes.container}> | ||
<Hidden xsDown> | ||
<Paper className={classes.paper}>xsDown</Paper> | ||
</Hidden> | ||
<Hidden smDown> | ||
<Paper className={classes.paper}>smDown</Paper> | ||
</Hidden> | ||
<Hidden mdDown> | ||
<Paper className={classes.paper}>mdDown</Paper> | ||
</Hidden> | ||
<Hidden lgDown> | ||
<Paper className={classes.paper}>lgDown</Paper> | ||
</Hidden> | ||
<Hidden xlDown> | ||
<Paper className={classes.paper}>xlDown</Paper> | ||
</Hidden> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
BreakpointDown.propTypes = { | ||
width: PropTypes.oneOf(['lg', 'md', 'sm', 'xl', 'xs']).isRequired, | ||
}; | ||
|
||
export default withWidth()(BreakpointDown); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as React from 'react'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Hidden from '@material-ui/core/Hidden'; | ||
import withWidth, { WithWidth } from '@material-ui/core/withWidth'; | ||
import Typography from '@material-ui/core/Typography'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
}, | ||
container: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}, | ||
paper: { | ||
padding: theme.spacing(2), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
flex: '1 0 auto', | ||
margin: theme.spacing(1), | ||
}, | ||
})); | ||
|
||
function BreakpointDown(props: WithWidth) { | ||
const classes = useStyles(); | ||
const { width } = props; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Typography variant="subtitle1" component="div"> | ||
Current width: {width} | ||
</Typography> | ||
<div className={classes.container}> | ||
<Hidden xsDown> | ||
<Paper className={classes.paper}>xsDown</Paper> | ||
</Hidden> | ||
<Hidden smDown> | ||
<Paper className={classes.paper}>smDown</Paper> | ||
</Hidden> | ||
<Hidden mdDown> | ||
<Paper className={classes.paper}>mdDown</Paper> | ||
</Hidden> | ||
<Hidden lgDown> | ||
<Paper className={classes.paper}>lgDown</Paper> | ||
</Hidden> | ||
<Hidden xlDown> | ||
<Paper className={classes.paper}>xlDown</Paper> | ||
</Hidden> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default withWidth()(BreakpointDown); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Hidden from '@material-ui/core/Hidden'; | ||
import withWidth from '@material-ui/core/withWidth'; | ||
import Typography from '@material-ui/core/Typography'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
}, | ||
container: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}, | ||
paper: { | ||
padding: theme.spacing(2), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
flex: '1 0 auto', | ||
margin: theme.spacing(1), | ||
}, | ||
})); | ||
|
||
function BreakpointOnly(props) { | ||
const classes = useStyles(); | ||
const { width } = props; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Typography variant="subtitle1" component="div"> | ||
Current width: {width} | ||
</Typography> | ||
<div className={classes.container}> | ||
<Hidden only="lg"> | ||
<Paper className={classes.paper}>Hidden on lg</Paper> | ||
</Hidden> | ||
<Hidden only="sm"> | ||
<Paper className={classes.paper}>Hidden on sm</Paper> | ||
</Hidden> | ||
<Hidden only={['sm', 'lg']}> | ||
<Paper className={classes.paper}>Hidden on sm and lg</Paper> | ||
</Hidden> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
BreakpointOnly.propTypes = { | ||
width: PropTypes.oneOf(['lg', 'md', 'sm', 'xl', 'xs']).isRequired, | ||
}; | ||
|
||
export default withWidth()(BreakpointOnly); |
Oops, something went wrong.