@bytebrand/fe-ui-core 4.1.200 → 4.1.201
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.
package/package.json
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
|
3
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
4
|
-
import
|
|
3
|
+
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { IconSvgWrapper } from './MaterialTooltip.styled';
|
|
5
6
|
|
|
6
7
|
interface IMaterialTooltip {
|
|
7
8
|
text: string;
|
|
8
|
-
icon
|
|
9
|
+
icon?: string;
|
|
10
|
+
placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
const
|
|
13
|
+
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
14
|
+
<Tooltip {...props} classes={{ popper: className }} />
|
|
15
|
+
))(({ theme }) => ({
|
|
16
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
17
|
+
backgroundColor: theme.palette.common.white,
|
|
18
|
+
color: 'rgba(0, 0, 0, 0.87)',
|
|
19
|
+
boxShadow: theme.shadows[1],
|
|
20
|
+
fontSize: 11,
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
const MaterialTooltip = ({ text, icon = 'infoIcon', placement }: IMaterialTooltip) => {
|
|
12
25
|
return (
|
|
13
|
-
<
|
|
26
|
+
<LightTooltip placement={placement} title={text}>
|
|
14
27
|
<IconButton>
|
|
15
|
-
<
|
|
28
|
+
<IconSvgWrapper name={icon} customDimensions />
|
|
16
29
|
</IconButton>
|
|
17
|
-
</
|
|
30
|
+
</LightTooltip>
|
|
18
31
|
);
|
|
19
32
|
};
|
|
20
33
|
|
|
21
|
-
export default MaterialTooltip;
|
|
34
|
+
export default MaterialTooltip;
|