diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e7c09ef45..865253282d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+### BREAKING CHANGES
+- rename `Transition` component to `Animation`, and `animationName` property to `name` @mnajdova ([#505](https://github.com/stardust-ui/react/pull/505))
+
+### Documentation
+- add `Animations` guide as part of the `Theming` docs page @mnajdova ([#505](https://github.com/stardust-ui/react/pull/505))
+
## [v0.12.1](https://github.com/stardust-ui/react/tree/v0.12.1) (2018-11-26)
[Compare changes](https://github.com/stardust-ui/react/compare/v0.12.0...v0.12.1)
diff --git a/docs/src/examples/components/Animation/Types/AnimationExample.tsx b/docs/src/examples/components/Animation/Types/AnimationExample.tsx
new file mode 100644
index 0000000000..1401bcbaf6
--- /dev/null
+++ b/docs/src/examples/components/Animation/Types/AnimationExample.tsx
@@ -0,0 +1,25 @@
+import * as React from 'react'
+import { Animation, Icon, Provider } from '@stardust-ui/react'
+
+const spinner = {
+ keyframe: {
+ from: {
+ transform: 'rotate(0deg)',
+ },
+ to: {
+ transform: 'rotate(360deg)',
+ },
+ },
+ duration: '5s',
+ iterationCount: 'infinite',
+}
+
+const AnimationExample = () => (
+
+ You define animations in Stardust in a very similar way to CSS, by providing keyframes and + animation properties. +
+ +
+ You can define the animations
in a part of your render tree using the{' '}
+
+ This is done with the Provider's theme
prop. The animations are then applied
+ based on their name by using the animation
property available on all Stardust component. Here's
+ how we can use them in our components.
+
+ You can also override some of the defined animation
properties, by providing
+ additional properties to the Animation
component, or the animation
{' '}
+ prop.
+
+ Keyframes are static - Keyframes cannot be overridden using the properties.
+ If you want to add new keyframes or change some existing, please use the Provider
{' '}
+ for this. The API for
+ using the animations doesn't provide any way for changing the keyframes.
+
+
+
+ The difference between using the Animation component versus the animation property is that,
+ the Animation component can be safely used for applying animations on{' '}
+ all components (Stardust, custom and third party components). For the Stardust
+ components, we recommend using the animation property as there will be no wrapper element
+ added just for the purpose of defining the animation. For more details, please see the
+ examples in the animation
property in any of the Stardust components.
+
{ @@ -11,7 +11,7 @@ export interface StyledComponentProps
{ export interface AnimatedComponentProps { /** Generic animation property that can be used for applying different theme animations. */ - animation?: Animation + animation?: AnimationProp } export interface UIComponentProps
extends StyledComponentProps
, AnimatedComponentProps {
diff --git a/src/lib/createAnimationStyles.tsx b/src/lib/createAnimationStyles.tsx
index 96ed98bdfa..d0dca5e19f 100644
--- a/src/lib/createAnimationStyles.tsx
+++ b/src/lib/createAnimationStyles.tsx
@@ -1,7 +1,7 @@
-import { ThemePrepared, Animation } from '../themes/types'
+import { ThemePrepared, AnimationProp } from '../themes/types'
import { callable } from './index'
-const createAnimationStyles = (animation: Animation, theme: ThemePrepared) => {
+const createAnimationStyles = (animation: AnimationProp, theme: ThemePrepared) => {
let animationCSSProp = {}
const { animations = {} } = theme
diff --git a/src/themes/teams/componentStyles.ts b/src/themes/teams/componentStyles.ts
index b02e53b138..ff31420305 100644
--- a/src/themes/teams/componentStyles.ts
+++ b/src/themes/teams/componentStyles.ts
@@ -52,4 +52,4 @@ export { default as Status } from './components/Status/statusStyles'
export { default as Text } from './components/Text/textStyles'
-export { default as Transition } from './components/Transition/transitionStyles'
+export { default as Animation } from './components/Animation/animationStyles'
diff --git a/src/themes/teams/componentVariables.ts b/src/themes/teams/componentVariables.ts
index 06f8187743..eeb611e45a 100644
--- a/src/themes/teams/componentVariables.ts
+++ b/src/themes/teams/componentVariables.ts
@@ -47,4 +47,4 @@ export { default as Status } from './components/Status/statusVariables'
export { default as Text } from './components/Text/textVariables'
-export { default as Transition } from './components/Transition/transitionVariables'
+export { default as Animation } from './components/Animation/animationVariables'
diff --git a/src/themes/teams/components/Transition/transitionStyles.ts b/src/themes/teams/components/Animation/animationStyles.ts
similarity index 100%
rename from src/themes/teams/components/Transition/transitionStyles.ts
rename to src/themes/teams/components/Animation/animationStyles.ts
diff --git a/src/themes/teams/components/Transition/transitionVariables.ts b/src/themes/teams/components/Animation/animationVariables.ts
similarity index 100%
rename from src/themes/teams/components/Transition/transitionVariables.ts
rename to src/themes/teams/components/Animation/animationVariables.ts
diff --git a/src/themes/teams/index.ts b/src/themes/teams/index.ts
index e349095a6d..24d24a1bca 100644
--- a/src/themes/teams/index.ts
+++ b/src/themes/teams/index.ts
@@ -34,29 +34,6 @@ Object.keys(fontIcons).forEach(iconName => {
icons[iconName] = declareFontBased(fontIcons[iconName])
})
-const animations = {
- spinner: {
- keyframe: {
- from: {
- transform: 'rotate(0deg)',
- },
- to: {
- transform: 'rotate(360deg)',
- },
- },
- duration: '5s',
- iterationCount: 'infinite',
- },
- colorChanger: {
- keyframe: {
- from: { color: 'red' },
- to: { color: 'blue' },
- },
- duration: '3s',
- iterationCount: 'infinite',
- },
-}
-
export default {
siteVariables,
componentVariables,
@@ -64,5 +41,4 @@ export default {
fontFaces,
staticStyles,
icons,
- animations,
} as ThemeInput
diff --git a/src/themes/types.ts b/src/themes/types.ts
index d88c8f6806..e2cb1f04e7 100644
--- a/src/themes/types.ts
+++ b/src/themes/types.ts
@@ -115,7 +115,7 @@ export interface ComponentSlotStylesPrepared