Skip to content

Commit

Permalink
match previous styles
Browse files Browse the repository at this point in the history
rebase2
  • Loading branch information
jjisabi committed May 8, 2024
1 parent fe90f65 commit a5a484d
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions packages/mui-material/src/SpeedDialAction/SpeedDialAction.js
Expand Up @@ -7,7 +7,7 @@ import composeClasses from '@mui/utils/composeClasses';
import { emphasize } from '@mui/system/colorManipulator';
import { styled, createUseThemeProps } from '../zero-styled';
import Fab from '../Fab';
import Tooltip from '../Tooltip';
import Tooltip, { tooltipClasses } from '../Tooltip';
import { getSpeedDialActionUtilityClass } from './speedDialActionClasses';

const useThemeProps = createUseThemeProps('MuiSpeedDialAction');
Expand Down Expand Up @@ -40,6 +40,9 @@ const SpeedDialActionFab = styled(Fab, {
? theme.vars.palette.SpeedDialAction.fabHoverBg
: emphasize(theme.palette.background.paper, 0.15),
},
transition: `${theme.transitions.create('transform', {
duration: theme.transitions.duration.shorter,
})}, opacity 0.8s`,
opacity: 1,
variants: [
{
Expand Down Expand Up @@ -174,6 +177,24 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref)
</SpeedDialActionFab>
);

if (tooltipOpenProp) {
return (
<PersistentTooltip
id={id}
ref={ref}
title={tooltipTitle}
placement={tooltipPlacement}
onClose={handleTooltipClose}
onOpen={handleTooltipOpen}
open={open && tooltipOpenProp}
classes={TooltipClasses}
{...other}
>
{fab}
</PersistentTooltip>
);
}

if (!open && tooltipOpen) {
setTooltipOpen(false);
}
Expand All @@ -186,16 +207,7 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref)
placement={tooltipPlacement}
onClose={handleTooltipClose}
onOpen={handleTooltipOpen}
open={open && (tooltipOpen || tooltipOpenProp)}
slotProps={{
tooltip: {
sx: (theme) => ({
backgroundColor:
tooltipOpenProp === true ? (theme.vars || theme).palette.background.paper : '',
color: tooltipOpenProp === true ? (theme.vars || theme).palette.text.secondary : '',
}),
},
}}
open={open && tooltipOpen}
classes={TooltipClasses}
{...other}
>
Expand Down

0 comments on commit a5a484d

Please sign in to comment.