@pie-lib/math-toolbar 2.0.0-beta.3 → 2.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,41 @@
1
1
  import React from 'react';
2
2
 
3
- import IconButton from '@material-ui/core/IconButton';
4
- import Check from '@material-ui/icons/Check';
5
- import { withStyles } from '@material-ui/core/styles';
3
+ import IconButton from '@mui/material/IconButton';
4
+ import Check from '@mui/icons-material/Check';
5
+ import { styled } from '@mui/material/styles';
6
6
  import PropTypes from 'prop-types';
7
- import classNames from 'classnames';
8
7
 
9
- export const RawDoneButton = ({ classes, onClick, hideBackground }) => (
10
- <IconButton
8
+ const StyledIconButton = styled(IconButton)(({ theme, hideBackground }) => ({
9
+ verticalAlign: 'top',
10
+ width: '28px',
11
+ height: '28px',
12
+ color: '#00bb00',
13
+ ...(hideBackground && {
14
+ backgroundColor: theme.palette.common.white,
15
+ '&:hover': {
16
+ backgroundColor: theme.palette.grey[200],
17
+ },
18
+ }),
19
+ '& .MuiIconButton-label': {
20
+ position: 'absolute',
21
+ top: '2px',
22
+ },
23
+ }));
24
+
25
+ export const RawDoneButton = ({ onClick, hideBackground }) => (
26
+ <StyledIconButton
11
27
  aria-label="Done"
12
- className={classes.iconRoot}
13
28
  onClick={onClick}
14
- classes={{
15
- label: classes.label,
16
- root: classNames(classes.iconRoot, { [classes.hideBackground]: hideBackground }),
17
- }}
29
+ hideBackground={hideBackground}
30
+ size="large"
18
31
  >
19
32
  <Check />
20
- </IconButton>
33
+ </StyledIconButton>
21
34
  );
22
35
 
23
36
  RawDoneButton.propTypes = {
24
- classes: PropTypes.object.isRequired,
25
37
  onClick: PropTypes.func,
38
+ hideBackground: PropTypes.bool,
26
39
  };
27
40
 
28
- const styles = (theme) => ({
29
- iconRoot: {
30
- verticalAlign: 'top',
31
- width: '28px',
32
- height: '28px',
33
- color: '#00bb00',
34
- },
35
- hideBackground: {
36
- backgroundColor: theme.palette.common.white,
37
-
38
- '&:hover': {
39
- backgroundColor: theme.palette.grey[200],
40
- },
41
- },
42
- label: {
43
- position: 'absolute',
44
- top: '2px',
45
- },
46
- });
47
- export const DoneButton = withStyles(styles)(RawDoneButton);
41
+ export const DoneButton = RawDoneButton;