From e5992f90f452a53a7a853f091d4b094b0483c117 Mon Sep 17 00:00:00 2001 From: Adam Bottega Date: Wed, 15 Jan 2025 14:51:07 +1100 Subject: [PATCH 1/3] Updating ActionsMenu component and fixing Tags UI bug --- .../ActionsMenu/ActionsMenu.animations.js | 121 +++++++++++++ .../ActionsMenu/ActionsMenu.stories.js | 2 +- lib/components/ActionsMenu/index.js | 160 +++++++++++------- lib/components/Tag/Tag.stories.js | 11 +- lib/components/Tag/index.js | 28 +-- 5 files changed, 240 insertions(+), 82 deletions(-) create mode 100644 lib/components/ActionsMenu/ActionsMenu.animations.js 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 && (