Skip to content

Commit

Permalink
chore[DST-106]: remove transitions (#3226)
Browse files Browse the repository at this point in the history
remove this
  • Loading branch information
sarahgm authored Jul 25, 2023
1 parent 53c5a10 commit f429948
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 79 deletions.
8 changes: 3 additions & 5 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"@react-aria/accordion": "3.0.0-alpha.19",
"@react-aria/autocomplete": "3.0.0-alpha.18",
"@react-aria/button": "3.8.0",
"@react-aria/calendar": "3.4.0",
"@react-aria/checkbox": "3.9.2",
"@react-aria/combobox": "3.6.2",
"@react-aria/calendar": "3.4.0",
"@react-aria/datepicker": "3.5.0",
"@react-aria/dialog": "3.5.3",
"@react-aria/focus": "3.13.0",
Expand All @@ -57,8 +57,8 @@
"@react-aria/tooltip": "3.6.0",
"@react-aria/utils": "3.18.0",
"@react-aria/visually-hidden": "3.8.2",
"@react-stately/checkbox": "3.4.3",
"@react-stately/calendar": "3.3.0",
"@react-stately/checkbox": "3.4.3",
"@react-stately/collections": "3.9.0",
"@react-stately/combobox": "3.5.2",
"@react-stately/data": "^3.6.0",
Expand All @@ -84,8 +84,7 @@
"@react-types/radio": "3.4.2",
"@react-types/shared": "3.18.1",
"@react-types/tooltip": "3.4.2",
"react-is": "18.2.0",
"react-transition-group": "4.4.5"
"react-is": "18.2.0"
},
"peerDependencies": {
"react": "17.x || 18.x",
Expand All @@ -94,7 +93,6 @@
"devDependencies": {
"@marigold/tsconfig": "workspace:*",
"@types/react": "18.2.14",
"@types/react-transition-group": "4.4.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"tsup": "6.7.0"
Expand Down
39 changes: 8 additions & 31 deletions packages/components/src/Overlay/Overlay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useRef } from 'react';
import { Transition } from 'react-transition-group';

import {
Overlay as ReactAriaOverlay,
Expand All @@ -13,21 +12,6 @@ export interface OverlayProps {
container?: ReactAriaOverlayProps['portalContainer'];
}

const duration = 300;

const defaultStyle = {
transition: `opacity ${duration}ms ease-in-out`,
opacity: 0,
};

const transitionStyles = {
entering: { opacity: 1 },
entered: { opacity: 1 },
exiting: { opacity: 0 },
exited: { opacity: 0 },
unmounted: { opacity: 0 },
};

export const Overlay = ({ children, container, open }: OverlayProps) => {
const nodeRef = useRef(null);
const theme = useTheme();
Expand All @@ -41,21 +25,14 @@ export const Overlay = ({ children, container, open }: OverlayProps) => {

return (
<ReactAriaOverlay portalContainer={container}>
<Transition nodeRef={nodeRef} timeout={duration} in={open} appear>
{state => (
<div
ref={nodeRef}
data-testid="overlay"
data-theme={theme.name}
style={{
...defaultStyle,
...transitionStyles[state],
}}
>
{children}
</div>
)}
</Transition>
<div
ref={nodeRef}
data-testid="overlay"
data-theme={theme.name}
className="opacity-100"
>
{children}
</div>
</ReactAriaOverlay>
);
};
101 changes: 58 additions & 43 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 comments on commit f429948

@vercel
Copy link

@vercel vercel bot commented on f429948 Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marigold-docs – ./

marigold-docs-marigold.vercel.app
marigold-docs-git-main-marigold.vercel.app
marigold-docs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on f429948 Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marigold-storybook – ./

marigold-storybook-marigold.vercel.app
marigold-storybook-git-main-marigold.vercel.app
marigold-latest.vercel.app

Please sign in to comment.