-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecation instead of breaking change
- Loading branch information
1 parent
4b52faa
commit f9e5029
Showing
29 changed files
with
496 additions
and
213 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,29 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
padding: 16, | ||
color: 'red', | ||
'& p': { | ||
color: 'green', | ||
'& span': { | ||
color: 'blue', | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
export default function NestedStylesHook() { | ||
const classes = useStyles(); | ||
return ( | ||
<Paper className={classes.root}> | ||
This is red since it is inside the paper. | ||
<p> | ||
This is green since it is inside the paragraph{' '} | ||
<span>and this is blue since it is inside the span</span> | ||
</p> | ||
</Paper> | ||
); | ||
} |
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,29 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
padding: 16, | ||
color: 'red', | ||
'& p': { | ||
color: 'green', | ||
'& span': { | ||
color: 'blue', | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
export default function NestedStylesHook() { | ||
const classes = useStyles(); | ||
return ( | ||
<Paper className={classes.root}> | ||
This is red since it is inside the paper. | ||
<p> | ||
This is green since it is inside the paragraph{' '} | ||
<span>and this is blue since it is inside the span</span> | ||
</p> | ||
</Paper> | ||
); | ||
} |
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
34 changes: 34 additions & 0 deletions
34
docs/src/pages/demos/bottom-navigation/LabelBottomNavigation.tsx
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,34 @@ | ||
import React from 'react'; | ||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | ||
import BottomNavigation from '@material-ui/core/BottomNavigation'; | ||
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction'; | ||
import Icon from '@material-ui/core/Icon'; | ||
import RestoreIcon from '@material-ui/icons/Restore'; | ||
import FavoriteIcon from '@material-ui/icons/Favorite'; | ||
import LocationOnIcon from '@material-ui/icons/LocationOn'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
width: 500, | ||
}, | ||
}); | ||
|
||
function LabelBottomNavigation() { | ||
const classes = useStyles(); | ||
const [value, setValue] = React.useState('recents'); | ||
|
||
function handleChange(event: React.ChangeEvent<{}>, newValue: string) { | ||
setValue(newValue); | ||
} | ||
|
||
return ( | ||
<BottomNavigation value={value} onChange={handleChange} className={classes.root}> | ||
<BottomNavigationAction label="Recents" value="recents" icon={<RestoreIcon />} /> | ||
<BottomNavigationAction label="Favorites" value="favorites" icon={<FavoriteIcon />} /> | ||
<BottomNavigationAction label="Nearby" value="nearby" icon={<LocationOnIcon />} /> | ||
<BottomNavigationAction label="Folder" value="folder" icon={<Icon>folder</Icon>} /> | ||
</BottomNavigation> | ||
); | ||
} | ||
|
||
export default LabelBottomNavigation; |
35 changes: 35 additions & 0 deletions
35
docs/src/pages/demos/bottom-navigation/SimpleBottomNavigation.tsx
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,35 @@ | ||
import React from 'react'; | ||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | ||
import BottomNavigation from '@material-ui/core/BottomNavigation'; | ||
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction'; | ||
import RestoreIcon from '@material-ui/icons/Restore'; | ||
import FavoriteIcon from '@material-ui/icons/Favorite'; | ||
import LocationOnIcon from '@material-ui/icons/LocationOn'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
width: 500, | ||
}, | ||
}); | ||
|
||
function SimpleBottomNavigation() { | ||
const classes = useStyles(); | ||
const [value, setValue] = React.useState(0); | ||
|
||
return ( | ||
<BottomNavigation | ||
value={value} | ||
onChange={(event, newValue) => { | ||
setValue(newValue); | ||
}} | ||
showLabels | ||
className={classes.root} | ||
> | ||
<BottomNavigationAction label="Recents" icon={<RestoreIcon />} /> | ||
<BottomNavigationAction label="Favorites" icon={<FavoriteIcon />} /> | ||
<BottomNavigationAction label="Nearby" icon={<LocationOnIcon />} /> | ||
</BottomNavigation> | ||
); | ||
} | ||
|
||
export default SimpleBottomNavigation; |
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
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,16 @@ | ||
import * as React from 'react'; | ||
import { StandardProps } from '..'; | ||
|
||
export interface GridListProps | ||
extends StandardProps<React.HTMLAttributes<HTMLUListElement>, GridListClassKey> { | ||
cellHeight?: number | 'auto'; | ||
cols?: number; | ||
component?: React.ElementType<GridListProps>; | ||
spacing?: number; | ||
} | ||
|
||
export type GridListClassKey = 'root'; | ||
|
||
declare const GridList: React.ComponentType<GridListProps>; | ||
|
||
export default GridList; |
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,17 @@ | ||
import React from 'react'; | ||
import warning from 'warning'; | ||
import ImageList from '../ImageList'; | ||
|
||
/** | ||
* Deprecated, use ImageList instead. | ||
*/ | ||
export default function GridList(props) { | ||
warning( | ||
false, | ||
[ | ||
'Material-UI: the GridList component is deprecated.', | ||
'The component was renamed to ImageList.', | ||
].join('\n'), | ||
); | ||
return <ImageList {...props} />; | ||
} |
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,2 @@ | ||
export { default } from './GridList'; | ||
export * from './GridList'; |
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 @@ | ||
export { default } from './GridList'; |
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,15 @@ | ||
import * as React from 'react'; | ||
import { StandardProps } from '..'; | ||
|
||
export interface GridListTileProps | ||
extends StandardProps<React.HTMLAttributes<HTMLLIElement>, GridListTileClassKey> { | ||
cols?: number; | ||
component?: React.ElementType<GridListTileProps>; | ||
rows?: number; | ||
} | ||
|
||
export type GridListTileClassKey = 'root' | 'tile' | 'imgFullHeight' | 'imgFullWidth'; | ||
|
||
declare const GridListTile: React.ComponentType<GridListTileProps>; | ||
|
||
export default GridListTile; |
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,17 @@ | ||
import React from 'react'; | ||
import warning from 'warning'; | ||
import ImageListTile from '../ImageListTile'; | ||
|
||
/** | ||
* Deprecated, use ImageListTile instead. | ||
*/ | ||
export default function GridListTile(props) { | ||
warning( | ||
false, | ||
[ | ||
'Material-UI: the GridListTile component is deprecated.', | ||
'The component was renamed to ImageListTile.', | ||
].join('\n'), | ||
); | ||
return <ImageListTile {...props} />; | ||
} |
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,2 @@ | ||
export { default } from './GridListTile'; | ||
export * from './GridListTile'; |
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 @@ | ||
export { default } from './GridListTile'; |
27 changes: 27 additions & 0 deletions
27
packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
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,27 @@ | ||
import * as React from 'react'; | ||
import { StandardProps } from '..'; | ||
|
||
export interface GridListTileBarProps extends StandardProps<{}, GridListTileBarClassKey> { | ||
actionIcon?: React.ReactNode; | ||
actionPosition?: 'left' | 'right'; | ||
subtitle?: React.ReactNode; | ||
title?: React.ReactNode; | ||
titlePosition?: 'top' | 'bottom'; | ||
} | ||
|
||
export type GridListTileBarClassKey = | ||
| 'root' | ||
| 'titlePositionBottom' | ||
| 'titlePositionTop' | ||
| 'rootSubtitle' | ||
| 'titleWrap' | ||
| 'titleWrapActionPosLeft' | ||
| 'titleWrapActionPosRight' | ||
| 'title' | ||
| 'subtitle' | ||
| 'actionIcon' | ||
| 'actionIconActionPosLeft'; | ||
|
||
declare const GridListTileBar: React.ComponentType<GridListTileBarProps>; | ||
|
||
export default GridListTileBar; |
17 changes: 17 additions & 0 deletions
17
packages/material-ui/src/GridListTileBar/GridListTileBar.js
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,17 @@ | ||
import React from 'react'; | ||
import warning from 'warning'; | ||
import ImageListTileBar from '../ImageListTileBar'; | ||
|
||
/** | ||
* Deprecated, use ImageListTileBar instead. | ||
*/ | ||
export default function GridListTileBar(props) { | ||
warning( | ||
false, | ||
[ | ||
'Material-UI: the GridListTileBar component is deprecated.', | ||
'The component was renamed to ImageListTileBar.', | ||
].join('\n'), | ||
); | ||
return <ImageListTileBar {...props} />; | ||
} |
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,2 @@ | ||
export { default } from './GridListTileBar'; | ||
export * from './GridListTileBar'; |
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 @@ | ||
export { default } from './GridListTileBar'; |
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
Oops, something went wrong.