Skip to content

Commit 80d7bcd

Browse files
authored
docs: showcase animations doc (#5792)
1 parent 85d3468 commit 80d7bcd

File tree

3 files changed

+73
-27
lines changed

3 files changed

+73
-27
lines changed

packages/ui/src/__stories__/Guides/Animations.mdx

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Meta } from '@storybook/addon-docs/blocks'
22
import Colors from '../components/Colors'
3+
import { ShowcaseAnimations } from "./ShowcaseAnimations/"
34

45
<Meta title="Guides/Animations" />
56

@@ -47,30 +48,30 @@ const MyComponent = () => <div className="fadeIn" style={{ animationDuration: "3
4748

4849

4950
## List
50-
- bounce
51-
- fadeIn
52-
- fadeOut
53-
- flash
54-
- ping
55-
- pulse
56-
- quickScaleDown
57-
- scaleBack
58-
- scaleDown
59-
- scaleForward
60-
- scaleUp
61-
- sketchIn
62-
- sketchOut
63-
- slideDownLarge
64-
- slideFromBottom
65-
- slideFromLeft
66-
- slideFromRight
67-
- slideFromTop
68-
- slideToBottom
69-
- slideToLeft
70-
- slideToRight
71-
- slideToTop
72-
- slideUpLarge
73-
- unfoldIn
74-
- unfoldOut
75-
- zoomIn
76-
- zoomOut
51+
- <ShowcaseAnimations animation="bounce"/>
52+
- <ShowcaseAnimations animation="fadeIn"/>
53+
- <ShowcaseAnimations animation="fadeOut"/>
54+
- <ShowcaseAnimations animation="flash"/>
55+
- <ShowcaseAnimations animation="ping"/>
56+
- <ShowcaseAnimations animation="pulse"/>
57+
- <ShowcaseAnimations animation="quickScaleDown"/>
58+
- <ShowcaseAnimations animation="scaleBack"/>
59+
- <ShowcaseAnimations animation="scaleDown"/>
60+
- <ShowcaseAnimations animation="scaleForward"/>
61+
- <ShowcaseAnimations animation="scaleUp"/>
62+
- <ShowcaseAnimations animation="sketchIn"/>
63+
- <ShowcaseAnimations animation="sketchOut"/>
64+
- <ShowcaseAnimations animation="slideDownLarge"/>
65+
- <ShowcaseAnimations animation="slideFromBottom"/>
66+
- <ShowcaseAnimations animation="slideFromLeft"/>
67+
- <ShowcaseAnimations animation="slideFromRight"/>
68+
- <ShowcaseAnimations animation="slideFromTop"/>
69+
- <ShowcaseAnimations animation="slideToBottom"/>
70+
- <ShowcaseAnimations animation="slideToLeft"/>
71+
- <ShowcaseAnimations animation="slideToRight"/>
72+
- <ShowcaseAnimations animation="slideToTop"/>
73+
- <ShowcaseAnimations animation="slideUpLarge"/>
74+
- <ShowcaseAnimations animation="unfoldIn"/>
75+
- <ShowcaseAnimations animation="unfoldOut"/>
76+
- <ShowcaseAnimations animation="zoomIn"/>
77+
- <ShowcaseAnimations animation="zoomOut"/>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useState } from 'react'
2+
import { Stack } from '../../../components/Stack'
3+
import {
4+
animationShowCaseAnimatedElement,
5+
animationShowCaseContainer,
6+
} from './styles.css'
7+
8+
export const ShowcaseAnimations = ({ animation }: { animation: string }) => {
9+
const [className, setClassName] = useState('')
10+
const animationClassname = `${animation}_uv`
11+
12+
return (
13+
<Stack alignItems="center" direction="row" gap={2}>
14+
{animation} :
15+
<Stack
16+
alignItems="center"
17+
className={animationShowCaseContainer}
18+
direction="row"
19+
gap={2}
20+
justifyContent="center"
21+
onMouseEnter={() => setClassName(animationClassname)}
22+
onMouseLeave={() => setClassName('')}
23+
>
24+
Hover me
25+
<div className={`${className} ${animationShowCaseAnimatedElement}`} />
26+
</Stack>
27+
</Stack>
28+
)
29+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { theme } from '@ultraviolet/themes'
2+
import { style } from '@vanilla-extract/css'
3+
4+
export const animationShowCaseContainer = style({
5+
padding: theme.space[1],
6+
border: `1px solid ${theme.colors.neutral.border}`,
7+
margin: theme.space['0.25'],
8+
})
9+
10+
export const animationShowCaseAnimatedElement = style({
11+
width: theme.sizing[300],
12+
height: theme.sizing[300],
13+
borderRadius: theme.radii.default,
14+
background: theme.colors.primary.background,
15+
border: theme.colors.primary.border,
16+
})

0 commit comments

Comments
 (0)