Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"datatables.net": "^1.11.4",
"datatables.net-bs": "^1.11.4",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"framer-motion": "4.1.17",
"framer-motion": "^6.0.0",
"jquery": ">=3.5.0",
"jshint": "^2.13.4",
"lodash": "^4.17.21",
Expand Down
84 changes: 53 additions & 31 deletions airflow/www/static/js/grid/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
Portal,
PortalProps,
} from '@chakra-ui/react';
import { motion, AnimatePresence } from 'framer-motion';

export interface TooltipProps
extends HTMLChakraProps<'div'>,
Expand Down Expand Up @@ -69,6 +70,27 @@ export interface TooltipProps
portalProps?: Pick<PortalProps, 'appendToParentPortal' | 'containerRef'>
}

const scale = {
exit: {
scale: 0.85,
opacity: 0,
transition: {
opacity: { duration: 0.15, easings: 'easeInOut' },
scale: { duration: 0.2, easings: 'easeInOut' },
},
},
enter: {
scale: 1,
opacity: 1,
transition: {
opacity: { easings: 'easeOut', duration: 0.2 },
scale: { duration: 0.2, ease: [0.175, 0.885, 0.4, 1.1] },
},
},
};

const StyledTooltip = chakra(motion.div);

const styles = {
'--popper-arrow-bg': ['var(--tooltip-bg)'],
'--tooltip-bg': 'colors.gray.700',
Expand Down Expand Up @@ -134,42 +156,42 @@ const Tooltip = forwardRef<TooltipProps, 'div'>((props, ref) => {
return (
<>
{trigger}
{/* TODO: put back in AnimatePresence when we can upgrade framer-motion without ts errors */}
{/* <AnimatePresence> */}
{tooltip.isOpen && (
<Portal {...portalProps}>
<chakra.div
{...tooltip.getTooltipPositionerProps()}
__css={{
zIndex: styles.zIndex,
pointerEvents: 'none',
}}
>
<AnimatePresence>
{tooltip.isOpen && (
<Portal {...portalProps}>
<chakra.div
{...(tooltipProps as any)}
initial="exit"
animate="enter"
exit="exit"
__css={styles}
{...tooltip.getTooltipPositionerProps()}
__css={{
zIndex: styles.zIndex,
pointerEvents: 'none',
}}
>
{label}
{hasArrow && (
<chakra.div
data-popper-arrow
className="chakra-tooltip__arrow-wrapper"
<StyledTooltip
variants={scale}
{...(tooltipProps as any)}
initial="exit"
animate="enter"
exit="exit"
__css={styles}
>
{label}
{hasArrow && (
<chakra.div
data-popper-arrow-inner
className="chakra-tooltip__arrow"
__css={{ bg: styles.bg }}
/>
</chakra.div>
)}
data-popper-arrow
className="chakra-tooltip__arrow-wrapper"
>
<chakra.div
data-popper-arrow-inner
className="chakra-tooltip__arrow"
__css={{ bg: styles.bg }}
/>
</chakra.div>
)}
</StyledTooltip>
</chakra.div>
</chakra.div>
</Portal>
)}
{/* </AnimatePresence> */}
</Portal>
)}
</AnimatePresence>
</>
);
});
Expand Down
41 changes: 24 additions & 17 deletions airflow/www/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5509,15 +5509,15 @@ form-data@^3.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"

framer-motion@4.1.17:
version "4.1.17"
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-4.1.17.tgz#4029469252a62ea599902e5a92b537120cc89721"
integrity sha512-thx1wvKzblzbs0XaK2X0G1JuwIdARcoNOW7VVwjO8BUltzXPyONGAElLu6CiCScsOQRI7FIk/45YTFtJw5Yozw==
framer-motion@^6.0.0:
version "6.3.11"
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.3.11.tgz#c304ce9728601ad9377d47d5d9264e43d741d470"
integrity sha512-xQLk+ZSklNs5QNCUmdWPpKMOuWiB8ZETsvcIOWw8xvri9K3TamuifgCI/B6XpaEDR0/V2ZQF2Wm+gUAZrXo+rw==
dependencies:
framesync "5.3.0"
framesync "6.0.1"
hey-listen "^1.0.8"
popmotion "9.3.6"
style-value-types "4.1.4"
popmotion "11.0.3"
style-value-types "5.0.0"
tslib "^2.1.0"
optionalDependencies:
"@emotion/is-prop-valid" "^0.8.2"
Expand All @@ -5529,6 +5529,13 @@ framesync@5.3.0:
dependencies:
tslib "^2.1.0"

framesync@6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20"
integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA==
dependencies:
tslib "^2.1.0"

fs-minipass@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
Expand Down Expand Up @@ -7993,14 +8000,14 @@ polished@^4.1.3:
dependencies:
"@babel/runtime" "^7.14.0"

popmotion@9.3.6:
version "9.3.6"
resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.3.6.tgz#b5236fa28f242aff3871b9e23721f093133248d1"
integrity sha512-ZTbXiu6zIggXzIliMi8LGxXBF5ST+wkpXGEjeTUDUOCdSQ356hij/xjeUdv0F8zCQNeqB1+PR5/BB+gC+QLAPw==
popmotion@11.0.3:
version "11.0.3"
resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.3.tgz#565c5f6590bbcddab7a33a074bb2ba97e24b0cc9"
integrity sha512-Y55FLdj3UxkR7Vl3s7Qr4e9m0onSnP8W7d/xQLsoJM40vs6UKHFdygs6SWryasTZYqugMjm3BepCF4CWXDiHgA==
dependencies:
framesync "5.3.0"
framesync "6.0.1"
hey-listen "^1.0.8"
style-value-types "4.1.4"
style-value-types "5.0.0"
tslib "^2.1.0"

postcss-calc@^8.2.3:
Expand Down Expand Up @@ -9316,10 +9323,10 @@ style-search@^0.1.0:
resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"
integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=

style-value-types@4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-4.1.4.tgz#80f37cb4fb024d6394087403dfb275e8bb627e75"
integrity sha512-LCJL6tB+vPSUoxgUBt9juXIlNJHtBMy8jkXzUJSBzeHWdBu6lhzHqCvLVkXFGsFIlNa2ln1sQHya/gzaFmB2Lg==
style-value-types@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad"
integrity sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA==
dependencies:
hey-listen "^1.0.8"
tslib "^2.1.0"
Expand Down