diff --git a/lib/components/ActionsMenu/ActionsMenu.animations.js b/lib/components/ActionsMenu/ActionsMenu.animations.js new file mode 100644 index 00000000..7f62a8e3 --- /dev/null +++ b/lib/components/ActionsMenu/ActionsMenu.animations.js @@ -0,0 +1,121 @@ +import { keyframes } from "styled-components"; + +export const crossFadeIn = keyframes` + 0% { + opacity: 0; + } + 75% { + opacity: 0; + } + 100% { + opacity: 1; + } +`; + +export const beforeDotCollapsing = keyframes` + 0% { + transform: translate(0, -6px); + } + 50% { + transform: translate(0, 0); + } + 100% { + transform: translate(0, 0); + } +`; + +export const beforeDotExpanding = keyframes` + 0% { + transform: translate(0, 0); + } + 50% { + transform: translate(0, 0); + } + 100% { + transform: translate(0, -6px); + } +`; + +export const afterDotCollapsing = keyframes` + 0% { + transform: translate(0, 6px); + } + 50% { + transform: translate(0, 0); + } + 100% { + transform: translate(0, 0); + } +`; + +export const afterDotExpanding = keyframes` + 0% { + transform: translate(0, 0); + } + 50% { + transform: translate(0, 0); + } + 100% { + transform: translate(0, 6px); + } +`; + +export const beforeCrossExpanding = keyframes` + 0% { + height: 4px; + transform: rotate(-45deg); + } + 50% { + height: 4px; + transform: rotate(-45deg); + } + 100% { + height: 18px; + transform: translate(0, -7px) rotate(-45deg); + } +`; + +export const beforeCrossCollapsing = keyframes` + 0% { + height: 18px; + transform: translate(0, -7px) rotate(-45deg); + } + 50% { + height: 4px; + transform: rotate(-45deg); + } + 100% { + height: 4px; + transform: rotate(-45deg); + } +`; + +export const afterCrossExpanding = keyframes` + 0% { + height: 4px; + transform: rotate(45deg); + } + 50% { + height: 4px; + transform: rotate(45deg); + } + 100% { + height: 18px; + transform: translate(0, -7px) rotate(45deg); + } +`; + +export const afterCrossCollapsing = keyframes` + 0% { + height: 18px; + transform: translate(0, -7px) rotate(45deg); + } + 50% { + height: 4px; + transform: rotate(45deg); + } + 100% { + height: 4px; + transform: rotate(45deg); + } +`; diff --git a/lib/components/ActionsMenu/ActionsMenu.stories.js b/lib/components/ActionsMenu/ActionsMenu.stories.js index b2760dd8..c5d2bce3 100644 --- a/lib/components/ActionsMenu/ActionsMenu.stories.js +++ b/lib/components/ActionsMenu/ActionsMenu.stories.js @@ -102,6 +102,7 @@ const MenuItems = React.forwardRef(({ closeMenu, reasons }, ref) => { @@ -128,7 +129,6 @@ const MenuItems = React.forwardRef(({ closeMenu, reasons }, ref) => { {showOther && (