-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Collapse): move fade atom to own file
- put in a new atoms folder that is shared amongst motion components - rename from opacityAtom to fadeAtom
- Loading branch information
1 parent
868fbc4
commit d84a7fa
Showing
3 changed files
with
17 additions
and
21 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/react-components/react-motion-components-preview/library/src/atoms/fade-atom.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PresenceDirection, motionTokens } from '@fluentui/react-motion'; | ||
|
||
export const fadeAtom = (direction: PresenceDirection, duration: number, easing: string = motionTokens.curveLinear) => { | ||
const keyframes = [{ opacity: 0 }, { opacity: 1 }]; | ||
if (direction === 'exit') { | ||
keyframes.reverse(); | ||
} | ||
return { | ||
keyframes, | ||
duration, | ||
easing, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters