@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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.200",
3
+ "version": "4.1.201",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -0,0 +1,8 @@
1
+ import { styled } from '@mui/system';
2
+ import IconSVG from '../IconSVG/IconSVG';
3
+
4
+ export const IconSvgWrapper = styled(IconSVG)({
5
+ fill: '#005ccb',
6
+ width: '12px',
7
+ height: '12px'
8
+ });
@@ -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 IconSVG from '../IconSVG/IconSVG';
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: string;
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 MaterialTooltip = ({ text, icon }: IMaterialTooltip) => {
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
- <Tooltip title={text}>
26
+ <LightTooltip placement={placement} title={text}>
14
27
  <IconButton>
15
- <IconSVG name={icon} customDimensions />
28
+ <IconSvgWrapper name={icon} customDimensions />
16
29
  </IconButton>
17
- </Tooltip>
30
+ </LightTooltip>
18
31
  );
19
32
  };
20
33
 
21
- export default MaterialTooltip;
34
+ export default MaterialTooltip;