pcm-shared-components 0.0.42 → 0.0.43
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.
|
@@ -39,6 +39,11 @@ const useStyles = makeStyles(() => ({
|
|
|
39
39
|
}) => `${iconSize}px !important`,
|
|
40
40
|
marginTop: 'auto',
|
|
41
41
|
marginBottom: 'auto'
|
|
42
|
+
},
|
|
43
|
+
buttonText: {
|
|
44
|
+
fontSize: ({
|
|
45
|
+
buttonFontSize
|
|
46
|
+
}) => buttonFontSize
|
|
42
47
|
}
|
|
43
48
|
}));
|
|
44
49
|
|
|
@@ -61,13 +66,13 @@ const CustomFab = props => {
|
|
|
61
66
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
62
67
|
theme: defaultTheme
|
|
63
68
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
64
|
-
title: /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
title: tooltipText && tooltipText.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
65
70
|
style: {
|
|
66
|
-
fontSize:
|
|
67
|
-
|
|
71
|
+
fontSize: 12,
|
|
72
|
+
padding: 4
|
|
68
73
|
}
|
|
69
|
-
}, tooltipText),
|
|
70
|
-
disableHoverListener: tooltipText
|
|
74
|
+
}, tooltipText) : undefined,
|
|
75
|
+
disableHoverListener: !tooltipText || tooltipText.length === 0 ? true : false
|
|
71
76
|
}, /*#__PURE__*/React.createElement(Fab, {
|
|
72
77
|
size: size,
|
|
73
78
|
color: backgroundColor ? backgroundColor : color,
|
|
@@ -80,7 +85,7 @@ const CustomFab = props => {
|
|
|
80
85
|
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
81
86
|
className: classes.Icon
|
|
82
87
|
}), buttonText && buttonText.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className:
|
|
88
|
+
className: clsx('mx-6 my-auto', classes.buttonText)
|
|
84
89
|
}, " ", buttonText)))));
|
|
85
90
|
};
|
|
86
91
|
|
|
@@ -91,6 +96,7 @@ CustomFab.defaultProps = {
|
|
|
91
96
|
iconSize: 24,
|
|
92
97
|
iconLocation: 'left',
|
|
93
98
|
buttonText: '',
|
|
99
|
+
buttonFontSize: 14,
|
|
94
100
|
variant: 'circular',
|
|
95
101
|
boxShadow: true,
|
|
96
102
|
size: 'large',
|
|
@@ -114,6 +120,8 @@ CustomFab.propTypes = {
|
|
|
114
120
|
|
|
115
121
|
/** Text inside of the button */
|
|
116
122
|
buttonText: PropTypes.string,
|
|
123
|
+
//** Font size of the button text */
|
|
124
|
+
buttonFontSize: PropTypes.number,
|
|
117
125
|
|
|
118
126
|
/** Either [circular or extended] if including text */
|
|
119
127
|
variant: PropTypes.oneOf(['extended', 'circular']),
|