pcm-shared-components 0.0.47 → 0.0.48
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.
|
@@ -7,8 +7,6 @@ import clsx from 'clsx';
|
|
|
7
7
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
8
8
|
import { ThemeProvider } from '@mui/system';
|
|
9
9
|
import { createTheme } from '@mui/material/styles';
|
|
10
|
-
import { theme } from '../../Theme/theme';
|
|
11
|
-
const defaultTheme = createTheme(theme.pitchCamp);
|
|
12
10
|
const useStyles = makeStyles(() => ({
|
|
13
11
|
rootFabElement: {
|
|
14
12
|
margin: 2,
|
|
@@ -59,8 +57,10 @@ const CustomFab = props => {
|
|
|
59
57
|
Icon,
|
|
60
58
|
buttonText,
|
|
61
59
|
boxShadow,
|
|
62
|
-
iconLocation
|
|
60
|
+
iconLocation,
|
|
61
|
+
theme
|
|
63
62
|
} = props;
|
|
63
|
+
const defaultTheme = createTheme(theme);
|
|
64
64
|
const classes = useStyles(props);
|
|
65
65
|
console.log('debug boxShadow', boxShadow);
|
|
66
66
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
@@ -106,7 +106,8 @@ CustomFab.defaultProps = {
|
|
|
106
106
|
textColor: 'textPrimary',
|
|
107
107
|
hoverTextColor: 'textPrimary',
|
|
108
108
|
className: '',
|
|
109
|
-
color: 'primary'
|
|
109
|
+
color: 'primary',
|
|
110
|
+
theme: {}
|
|
110
111
|
};
|
|
111
112
|
CustomFab.propTypes = {
|
|
112
113
|
/** onClick function passed to the button */
|
|
@@ -154,5 +155,8 @@ CustomFab.propTypes = {
|
|
|
154
155
|
className: PropTypes.string,
|
|
155
156
|
|
|
156
157
|
/** Theme colors if not using backgroundColor ['primary','secondary'] */
|
|
157
|
-
color: PropTypes.oneOf(['primary', 'secondary'])
|
|
158
|
+
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
159
|
+
|
|
160
|
+
/** Theme object to use on this component*/
|
|
161
|
+
theme: PropTypes.object
|
|
158
162
|
};
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import CustomFab from '../CustomFab/CustomFab';
|
|
3
3
|
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import { ThemeProvider } from '@mui/system';
|
|
6
|
+
import { createTheme } from '@mui/material/styles';
|
|
5
7
|
export const HelpButton = props => {
|
|
6
8
|
const {
|
|
7
9
|
onClickLink,
|
|
@@ -9,9 +11,13 @@ export const HelpButton = props => {
|
|
|
9
11
|
color,
|
|
10
12
|
tooltipText,
|
|
11
13
|
size,
|
|
12
|
-
iconSize
|
|
14
|
+
iconSize,
|
|
15
|
+
theme
|
|
13
16
|
} = props;
|
|
14
|
-
|
|
17
|
+
const defaultTheme = createTheme(theme);
|
|
18
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
19
|
+
theme: defaultTheme
|
|
20
|
+
}, /*#__PURE__*/React.createElement(CustomFab, {
|
|
15
21
|
className: className,
|
|
16
22
|
Icon: HelpOutlineIcon,
|
|
17
23
|
tooltipText: tooltipText,
|
|
@@ -19,10 +25,11 @@ export const HelpButton = props => {
|
|
|
19
25
|
size: size,
|
|
20
26
|
iconSize: iconSize,
|
|
21
27
|
variant: 'round',
|
|
28
|
+
theme: theme,
|
|
22
29
|
onClick: () => {
|
|
23
30
|
window.open(onClickLink, "_blank");
|
|
24
31
|
}
|
|
25
|
-
});
|
|
32
|
+
}));
|
|
26
33
|
};
|
|
27
34
|
export default HelpButton;
|
|
28
35
|
HelpButton.defaultProps = {
|
|
@@ -31,7 +38,8 @@ HelpButton.defaultProps = {
|
|
|
31
38
|
color: 'primary',
|
|
32
39
|
tooltipText: '',
|
|
33
40
|
size: 'large',
|
|
34
|
-
iconSize: 24
|
|
41
|
+
iconSize: 24,
|
|
42
|
+
theme: {}
|
|
35
43
|
};
|
|
36
44
|
HelpButton.propTypes = {
|
|
37
45
|
/** On click link, it's the URL to navigate too */
|
|
@@ -50,5 +58,8 @@ HelpButton.propTypes = {
|
|
|
50
58
|
iconSize: PropTypes.number,
|
|
51
59
|
|
|
52
60
|
/** The size of the button ['small','medium','large'] */
|
|
53
|
-
size: PropTypes.oneOf(['small', 'medium', 'large'])
|
|
61
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
62
|
+
|
|
63
|
+
/** Theme object to use on this component*/
|
|
64
|
+
theme: PropTypes.object
|
|
54
65
|
};
|