File tree Expand file tree Collapse file tree 12 files changed +86
-112
lines changed Expand file tree Collapse file tree 12 files changed +86
-112
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ Also provides a [Render Props Component](https://reactjs.org/docs/render-props.h
15
15
keeps track of the local state for a single popup, and passes the state and
16
16
mutation functions to a child render function.
17
17
18
+ # Beta version
19
+
20
+ These are the docs for the beta version that supports the MUI v5 release candidate.
21
+ For v4, see https://github.com/jcoreio/material-ui-popup-state .
22
+
18
23
# Table of Contents
19
24
20
25
<!-- toc -->
@@ -53,7 +58,7 @@ mutation functions to a child render function.
53
58
# Installation
54
59
55
60
``` sh
56
- npm install --save material-ui-popup-state
61
+ npm install --save material-ui-popup-state@beta
57
62
```
58
63
59
64
# Examples with React Hooks
Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
- import { withStyles } from '@material-ui /styles'
3
- import Code from '@material-ui /icons/Code'
2
+ import { withStyles } from '@mui /styles'
3
+ import Code from '@mui /icons-material /Code'
4
4
import Collapse from '@mui/material/Collapse'
5
5
import Button from '@mui/material/Button'
6
6
import IconButton from '@mui/material/IconButton'
@@ -92,7 +92,7 @@ const Demo = ({
92
92
) }
93
93
< div className = { classes . toolbarSpacer } />
94
94
< Tooltip title = "Show Source" placement = "top" >
95
- < IconButton onClick = { ( ) => setShowSource ( ! showSource ) } >
95
+ < IconButton onClick = { ( ) => setShowSource ( ! showSource ) } size = "large" >
96
96
< Code />
97
97
</ IconButton >
98
98
</ Tooltip >
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ import CascadingHoverMenusHooks from './examples/CascadingHoverMenus.hooks'
34
34
import CascadingHoverMenusHooksCode from '!!raw-loader!./examples/CascadingHoverMenus.hooks'
35
35
import Demo from './Demo'
36
36
import Typography from '@mui/material/Typography'
37
- import { withStyles } from '@material-ui /styles'
37
+ import { withStyles } from '@mui /styles'
38
38
import { StyledEngineProvider } from '@mui/material/styles'
39
39
import { createTheme , ThemeProvider } from '@mui/material/styles'
40
40
Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
- import { makeStyles } from '@material-ui /styles'
2
+ import { makeStyles } from '@mui /styles'
3
3
import HoverMenu from 'material-ui-popup-state/HoverMenu'
4
4
import MenuItem from '@mui/material/MenuItem'
5
- import ChevronRight from '@material-ui /icons/ChevronRight'
5
+ import ChevronRight from '@mui /icons-material /ChevronRight'
6
6
import Button from '@mui/material/Button'
7
7
import {
8
8
usePopupState ,
Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
- import { makeStyles } from '@material-ui /styles'
2
+ import { makeStyles } from '@mui /styles'
3
3
import MenuItem from '@mui/material/MenuItem'
4
- import ChevronRight from '@material-ui /icons/ChevronRight'
4
+ import ChevronRight from '@mui /icons-material /ChevronRight'
5
5
import Button from '@mui/material/Button'
6
6
import PopupState , { bindHover , bindMenu } from 'material-ui-popup-state'
7
7
import HoverMenu from 'material-ui-popup-state/HoverMenu'
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import List from '@mui/material/List'
8
8
import ListItem from '@mui/material/ListItem'
9
9
import ListItemText from '@mui/material/ListItemText'
10
10
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction'
11
- import MoreVertIcon from '@material-ui /icons/MoreVert'
11
+ import MoreVertIcon from '@mui /icons-material /MoreVert'
12
12
import PopupState , {
13
13
anchorRef ,
14
14
bindTrigger ,
@@ -34,7 +34,7 @@ const CustomAnchor = () => (
34
34
secondary = "Last Modified Apr 9, 2019"
35
35
/>
36
36
< ListItemSecondaryAction >
37
- < IconButton { ...bindTrigger ( popupState ) } >
37
+ < IconButton { ...bindTrigger ( popupState ) } size = "large" >
38
38
< MoreVertIcon />
39
39
</ IconButton >
40
40
</ ListItemSecondaryAction >
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const HoverPopperPopupState = ({ classes }) => {
19
19
< Button variant = "contained" { ...bindHover ( popupState ) } >
20
20
Hover to open Popper
21
21
</ Button >
22
- < Popper { ...bindPopper ( popupState ) } transition >
22
+ < Popper { ...bindPopper ( popupState ) } placement = "bottom" >
23
23
< Paper >
24
24
< Typography style = { { margin : 10 } } >
25
25
The content of the Popper.
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
- import { withStyles } from '@material-ui /styles'
3
+ import { withStyles } from '@mui /styles'
4
4
import Typography from '@mui/material/Typography'
5
5
import Button from '@mui/material/Button'
6
6
import Popover from '@mui/material/Popover'
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
- import { withStyles } from '@material-ui /styles'
3
+ import { withStyles } from '@mui /styles'
4
4
import Typography from '@mui/material/Typography'
5
5
import Button from '@mui/material/Button'
6
6
import Popover from '@mui/material/Popover'
Original file line number Diff line number Diff line change 111
111
"@mui/material" : " ^5.0.0-rc.0" ,
112
112
"@types/classnames" : " ^2.2.9" ,
113
113
"@types/prop-types" : " ^15.7.3" ,
114
+ "@wojtekmaj/enzyme-adapter-react-17" : " ^0.6.3" ,
114
115
"babel-eslint" : " ^10.1.0" ,
115
116
"babel-loader" : " ^8.0.5" ,
116
117
"babel-plugin-istanbul" : " ^6.0.0" ,
119
120
"copy" : " ^0.3.2" ,
120
121
"cross-env" : " ^7.0.3" ,
121
122
"enzyme" : " ^3.11.0" ,
122
- "enzyme-adapter-react-16" : " ^1.15.6" ,
123
123
"eslint" : " ^7.18.0" ,
124
124
"eslint-config-prettier" : " ^7.2.0" ,
125
125
"eslint-plugin-flowtype" : " ^5.2.0" ,
157
157
"prop-types" : " ^15.7.2"
158
158
},
159
159
"peerDependencies" : {
160
- "@mui/material" : " ^4.0.0 || ^ 5.0.0-rc.0" ,
160
+ "@mui/material" : " ^5.0.0-rc.0" ,
161
161
"react" : " ^15.0.0 || ^16.0.0 || ^17.0.0"
162
+ },
163
+ "release" : {
164
+ "branches" : [
165
+ " master" ,
166
+ {
167
+ "name" : " beta" ,
168
+ "prerelease" : true
169
+ }
170
+ ]
162
171
}
163
172
}
You can’t perform that action at this time.
0 commit comments