Motion
A set of utilities to apply motion in your application.
Installation
yarn add @atlaskit/motion
A set of utilities to apply motion in your application.
A set of utilities to apply motion in your application.
yarn add @atlaskit/motion
3ab7d7da348ab
-
Adds side-effect config to support Compiled css extraction in third-party apps43b81fd5ead81
-
Remove react-router-dom from devDependencies as it is incompatible with React 18, and was only
used in an example.#127511
db30e29344013
-
Widening range of react
and react-dom
peer dependencies from ^16.8.0 || ^17.0.0 || ~18.2.0
to the wider range of ^16.8.0 || ^17.0.0 || ^18.0.0` (where applicable).
This change has been done to enable usage of `react@18.3as well as to have a consistent peer
dependency range for
reactand
react-domfor
/platform` packages.
861f8cfbff102
-
Refactor internals to better support React 18 strict mode.cd506a937e44f
-
Internal change to how typography is applied. There should be no visual change.ff0815316ab38
-
Removes usage of custom theme button in places where its API is not being used and the default
button is able to be used instead. This should give a slight performance (runtime) improvement.169747d542a4f
-
Support exiting animation in strict mode.c733254a2dd6e
-
Explicitly set jsxRuntime to classic via pragma comments in order to avoid issues where jsxRuntime
is implicitly set to automatic.c826eb17b113e
-
Remove examples of the logos that have been deprecated by the '@atlaskit/logo' package.21b4a15e7182
-
Add support for React 18 in non-strict mode.35fd5ed8e1d7
-
Upgrading internal dependency bind-event-listener
to @^3.0.0
8d4e99057fe0
-
Upgrade Typescript from 4.9.5
to 5.4.2
971e55b3699
- Prefix
unused opts variable with '_' to fix typechecking under local consumptionb3ba6514308
-
Introduce reduceMotionAsPerUserPreference
in favour of prefersReducedMotion
as the latter does
not work correctly with Compiled.1f371d41ccb
- Motion
is now enrolled into the product push model for Jira.fd6bb9c9184
- Delete
version.jsone7ea6832ad2
- Bans the
use of React.FC/React.FunctionComponent type in ADS components as part of the React 18 migration
work. The change is internal only and should not introduce any changes for the component
consumers.9d00501a414
- Ensure
legacy types are published for TS 4.5-4.841fae2c6f68
- Upgrade
Typescript from 4.5.5
to 4.9.5
56507598609
- Skip
minor dependency bump8081a4b12d3
- Fixed a
type error for the ResizingHeight
component caused by not rendering valid JSX7f5f23dcb68
-
Introduce shape tokens to some packages.a86726f0b16
- Updates
@emotion/core
to @emotion/react
; v10 to v11. There is no expected behavior change.9de88fa1e1e
- Internal
changes to include spacing tokens in component implementations.8cc2f888c83
- Upgrade
Typescript from 4.3.5
to 4.5.5
8d4228767b0
- Upgrade
Typescript from 4.2.4
to 4.3.5
.01a461fe433
- Internal
code change turning on new linting rules.a1c9465b456
- -
FadeIn
now supports different exit directions using the exitDirection
propFadeIn
now supports different distance options for animations, using the distance
prop8a5bdb3c844
-
Upgrading internal dependency (bind-event-listener) for improved internal typese4b612d1c48
- Internal
migration to bind-event-listener for safer DOM Event cleanup#21335
8630371ec57
-
Note: It is a re-release of the wrongly patched
version 1.0.4
that should have been a
minor
release.
Add a useIsReducedMotion() hook that returns the user's current motion preference.
Other internal changes:
WRONG RELEASE TYPE - DON'T USE
cb2392f6d33
- Upgrade
to TypeScript 4.2.4cd34d8ca8ea
- Internal
wiring up to the tokens techstack, no code changes.378d1cef00f
- Bump
@atlaskit/theme
to version ^11.3.0
.08b6e9821d0
-
ExitingPersistence is now memoised to prevent a re-render that terminates the exit animation when
its children have not changed.4925538af72
- This
1.0.0
release denotes that the package API is now stable and is no longer in developer preview.
There are NO API CHANGES in this release.12f99a7b1ab
- Export
useExitingPersistence from @atlaskit/motion, and fix types for children of ExitingPersistence.#9641
9d9f1490c22
-
@atlaskit/motion now supports multi entry-points. Users can now import only the parts of this
module they need, reducing the size of your final bundle.
Entry-points include:
@atlaskit/motion/curves
@atlaskit/motion/durations
@atlaskit/motion/accessibility
@atlaskit/motion/exiting-persistence
@atlaskit/motion/fade-in
@atlaskit/motion/slide-in
@atlaskit/motion/zoom-in
@atlaskit/motion/shrink-out
@atlaskit/motion/staggered-entrance
d3265f19be
- Transpile
packages using babel rather than tsc5f58283e1f
- Export
types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules
compiler option. This requires version 3.8 of Typescript, read more about how we handle Typescript
versions here: https://atlaskit.atlassian.com/get-started Also add typescript
to
devDependencies
to denote version that the package was built with.02df8cde1d
- Readme now
points to the correct docs URL.81c95008a4
- Remove
transform if FadeIn movement is not provided#3885
6c525a8229
- Upgraded
to TypeScript 3.9.6 and tslib to 2.0.0
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade to prevent duplicates of tslib being bundled.
60dd4ecc69
- Changed
export all to export individual components in indexdb053b24d8
- Update all
the theme imports to be tree-shakable87f4720f27
- Officially
dropping IE11 support, from this version onwards there are no warranties of the package working in
IE11. For more information see:
https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534#2763
dd275c9b81
- Added the
option to animate opacity within SlideIn
.
You can now add the property animateOpacity
which if true, animates the opacity from 0 -> 1 on
enter and 1 -> 0 on exit.
1e4930567c
- There
should be no noticeable changes to consumers of motion
, but we now remove the animation styles
once an animation is complete, or if the elements are not meant to animate on initial mount. This
prevents a class of bugs where we were seeing unintended animations.54a9514fcf
- Build and
supporting files will no longer be published to npm[patch]e5eb921e97:
Change imports to comply with Atlassian conventions- Updated dependencies 3940bd71f1:
Updated dependencies 6b8e60827e:
[patch]5633f516a4:
Fixes timeout and raf hooks not having a stable reference.- Updated dependencies 168b5f90e5:
Updated dependencies 0c270847cb:
[patch]6548261c9a:
Remove namespace imports from React, ReactDom, and PropTypes- Updated dependencies 6548261c9a:
[patch]166d7b1626:
Fixes motion blowing up when rendered on the server. - @atlaskit/logo@12.3.1
[minor]1d72045e6b:
SlideIn
is now more customizable and has new props:
from
prop has been renamed to enterFrom
exitTo
prop which specifies which direction the
component will animate towards when exiting. The from
prop has also been renamed to
enterFrom
. If no exitTo
prop is set, the exiting motion will default to being the reverse of
the entrance motion. i.e. if enterFrom={"right"}
then the element will slide in from the right
and then exit towards the right as well.animationTimingFunction
to override animation curve to use
when entrancing v.s. when exiting.[patch]6fecf8ec66:
FadeIn component has had its css keyframes adjusted to affect how much it animates up.- [patch]f214e55182:
Added a SlideIn component. Useful for when things slide in from outside of the viewport. It comes with a pairing exiting motion.- [patch]98342c8dca:
Added a ShinkOut component. Useful for removing an element from the DOM by shrinking it to zero width. Does not have a pairing entering motion.- [patch]0aebb4f6ff:
Added a ZoomIn component. Useful for highlighting specific actions, buttons, etc, when entering the DOM. Comes with a pairing exiting motion.- [patch]8161987117:
Allow consumers to toggle secondary entrance motion on FadeIn- [patch]38cde500c7:
Added a ResizingHeight component. This is the component equivalent of the useResizingHeight hook.- Updated dependencies 82747f2922:
Updated dependencies 4a223473c5:
[patch]24865cfaff:
New <ExitingPersistence />
component
You can now persist exiting elements using ExitingPersistence
. Doing so will allow them to
animate away while exiting.
There are three ways you can utilise this component:
Conditionally rendering a single component
import { FadeIn, ExitingPersistence } from '@atlaskit/motion';
({ entered }) => (
<div>
<ExitingPersistence>
{entered && (
<FadeIn>{props => <div {...props}>hello world</div>}</FadeIn>
)}
</ExitingPersistence>
</div>
);
Conditionally rendering multiple components
import { FadeIn, ExitingPersistence } from '@atlaskit/motion';
() => (
<ExitingPersistence>
{one && <FadeIn>{props => <div {...props}>hello world</div>}</FadeIn>}
{two && <FadeIn>{props => <div {...props}>hello world</div>}</FadeIn>}
</ExitingPersistence>
);
Conditionally rendering elements in an array
Make sure to have unique keys for every element!
import { FadeIn, ExitingPersistence } from '@atlaskit/motion';
() => (
<ExitingPersistence>
{elements.map(element => (
// Key is very important here!
<FadeIn key={element.key}>
{props => <div {...props}>hello world</div>}
</FadeIn>
))}
</ExitingPersistence>
);
Updated <StaggeredEntrance />
component
StaggeredEntrance
no longer has the limitation of requiring motions to be the direct descendant.
Simply ensure your motion elements are somewhere in the child tree and they will have their
entrance motion staggered.
import { FadeIn, StaggeredEntrance } from '@atlaskit/motion';
() => (
<StaggeredEntrance>
<div>
{items.map(logo => (
<div key={logo.key}>
<FadeIn>{props => <div {...props} />}</FadeIn>
</div>
))}
</div>
</StaggeredEntrance>
);
[minor]5c3fc52da7:
The internal Motion
component is now called KeyframesMotion
.-
[minor]1dd6a6d6ac:
ExitingPersistence
now has an appear
prop. Previously entering motions would always appear
when mounting - now you have to opt into the behaviour.
-<ExitingPersistence>
+<ExitingPersistence appear>
...
</ExitingPersistence>
[patch]f175c8088f:
Fixes non-exiting elements from re-rendering unnecessarily.
[patch]f9c291923c:
Corrects the type exports for typography, colors, elevation and layers. If you were doing any dynamic code it may break you. Refer to the upgrade guide for help upgrading.- Updated dependencies 3c0f6feee5:
Updated dependencies f9c291923c:
[patch]94abe7f41a:
New useResizingHeight()
hook
This is a small yet powerful hook which you can consume to enable an element to resize its
height
when it changes after a state transition. It uses CSS under-the-hood to maximize
performance.
import { useResizingHeight } from '@atlaskit/motion';
({ text }) => <div {...useResizingHeight()}>{text}</div>;
[patch]d8a99823e2:
Adds FadeIn and StaggeredEntrance components and reduced motion utilities.
[patch]cdcb428642:
Initial release of @atlaskit/motion