@bytebrand/fe-ui-core 4.1.199 → 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.199",
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;
@@ -39,7 +39,7 @@ export const Theme = createTheme({
39
39
  root: ({ ownerState }) => ({
40
40
  minHeight: '44px !important',
41
41
  fontSize: '14px important',
42
- ...(ownerState.isComponent && {
42
+ ...(ownerState.disableRipple && {
43
43
  cursor: 'initial !important',
44
44
  '&:hover': {
45
45
  background: 'transparent !important'
@@ -12,18 +12,16 @@ interface IListItem {
12
12
  divider?: boolean;
13
13
  onClick?: () => void;
14
14
  href?: string;
15
- isComponent?: string;
16
15
  isSelect?: boolean;
17
16
  Link?: any;
17
+ handleClose?: () => void;
18
18
  }
19
19
 
20
- const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose }: IListItem) => {
20
+ const ListItem = ({ icon, label, amount, divider, onClick, href, Link, handleClose }: IListItem) => {
21
21
  return !!href ? (
22
22
  <Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
23
23
  <MenuItem
24
24
  divider={divider}
25
- disableRipple={isComponent ? true : false}
26
- isComponent={isComponent}
27
25
  >
28
26
  {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
29
27
  <ListItemText>
@@ -39,8 +37,7 @@ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Li
39
37
  handleClose();
40
38
  }}
41
39
  divider={divider}
42
- disableRipple={isComponent ? true : false}
43
- isComponent={isComponent}
40
+ disableRipple={true}
44
41
  >
45
42
  {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
46
43
  <ListItemText>