@pyreon/kinetic-presets 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/lib/index.d.ts +1 -1
- package/package.json +19 -19
- package/src/__tests__/factories.test.ts +99 -99
- package/src/__tests__/presets.test.ts +274 -274
- package/src/__tests__/utils.test.ts +164 -164
- package/src/factories.ts +28 -28
- package/src/index.ts +4 -4
- package/src/presets.ts +386 -386
- package/src/types.ts +1 -1
- package/src/utils.ts +7 -7
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ import { fadeUp, scaleIn, bounceIn } from '@pyreon/kinetic-presets'
|
|
|
39
39
|
|
|
40
40
|
// Map access (useful for dynamic selection)
|
|
41
41
|
import { presets } from '@pyreon/kinetic-presets'
|
|
42
|
-
presets.fadeUp
|
|
42
|
+
presets.fadeUp // same as named fadeUp
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### Fades (14)
|
|
@@ -143,14 +143,20 @@ presets.fadeUp // same as named fadeUp
|
|
|
143
143
|
Configurable factories for creating custom presets:
|
|
144
144
|
|
|
145
145
|
```ts
|
|
146
|
-
import {
|
|
146
|
+
import {
|
|
147
|
+
createFade,
|
|
148
|
+
createSlide,
|
|
149
|
+
createScale,
|
|
150
|
+
createRotate,
|
|
151
|
+
createBlur,
|
|
152
|
+
} from '@pyreon/kinetic-presets'
|
|
147
153
|
```
|
|
148
154
|
|
|
149
155
|
### createFade(options?)
|
|
150
156
|
|
|
151
157
|
```ts
|
|
152
|
-
createFade()
|
|
153
|
-
createFade({ direction: 'up', distance: 24 })
|
|
158
|
+
createFade() // Pure opacity fade
|
|
159
|
+
createFade({ direction: 'up', distance: 24 }) // Fade with movement
|
|
154
160
|
createFade({ duration: 500, easing: 'ease-in-out' })
|
|
155
161
|
```
|
|
156
162
|
|
|
@@ -168,7 +174,7 @@ Options: `direction?` (default `'up'`), `distance?` (default 16), `duration?`, `
|
|
|
168
174
|
|
|
169
175
|
```ts
|
|
170
176
|
createScale({ from: 0.5, duration: 400 })
|
|
171
|
-
createScale({ from: 0.8, easing: 'cubic-bezier(0.34, 1.56, 0.64, 1)' })
|
|
177
|
+
createScale({ from: 0.8, easing: 'cubic-bezier(0.34, 1.56, 0.64, 1)' }) // spring bounce
|
|
172
178
|
```
|
|
173
179
|
|
|
174
180
|
Options: `from?` (default 0.9), `duration?`, `leaveDuration?`, `easing?`, `leaveEasing?`.
|
|
@@ -177,7 +183,7 @@ Options: `from?` (default 0.9), `duration?`, `leaveDuration?`, `easing?`, `leave
|
|
|
177
183
|
|
|
178
184
|
```ts
|
|
179
185
|
createRotate({ degrees: 30, duration: 400 })
|
|
180
|
-
createRotate({ degrees: -90 })
|
|
186
|
+
createRotate({ degrees: -90 }) // counter-clockwise
|
|
181
187
|
```
|
|
182
188
|
|
|
183
189
|
Options: `degrees?` (default 15), `duration?`, `leaveDuration?`, `easing?`, `leaveEasing?`.
|
|
@@ -186,7 +192,7 @@ Options: `degrees?` (default 15), `duration?`, `leaveDuration?`, `easing?`, `lea
|
|
|
186
192
|
|
|
187
193
|
```ts
|
|
188
194
|
createBlur({ amount: 12, duration: 400 })
|
|
189
|
-
createBlur({ amount: 8, scale: 0.95 })
|
|
195
|
+
createBlur({ amount: 8, scale: 0.95 }) // blur with scale
|
|
190
196
|
```
|
|
191
197
|
|
|
192
198
|
Options: `amount?` (px, default 8), `scale?` (optional scale factor), `duration?`, `leaveDuration?`, `easing?`, `leaveEasing?`.
|
package/lib/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type Preset = {
|
|
|
15
15
|
leaveFrom?: string | undefined;
|
|
16
16
|
leaveTo?: string | undefined;
|
|
17
17
|
};
|
|
18
|
-
type Direction =
|
|
18
|
+
type Direction = 'up' | 'down' | 'left' | 'right';
|
|
19
19
|
type FadeOptions = {
|
|
20
20
|
direction?: Direction;
|
|
21
21
|
distance?: number;
|
package/package.json
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/kinetic-presets",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
|
+
"description": "120+ animation presets for Pyreon transitions",
|
|
5
|
+
"license": "MIT",
|
|
4
6
|
"repository": {
|
|
5
7
|
"type": "git",
|
|
6
8
|
"url": "https://github.com/pyreon/pyreon",
|
|
7
9
|
"directory": "packages/ui-system/kinetic-presets"
|
|
8
10
|
},
|
|
9
|
-
"description": "120+ animation presets for Pyreon transitions",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"type": "module",
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"bun": "./src/index.ts",
|
|
16
|
-
"import": "./lib/index.js",
|
|
17
|
-
"types": "./lib/index.d.ts"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"types": "./lib/index.d.ts",
|
|
21
|
-
"main": "./lib/index.js",
|
|
22
11
|
"files": [
|
|
23
12
|
"lib",
|
|
24
13
|
"!lib/**/*.map",
|
|
@@ -27,8 +16,16 @@
|
|
|
27
16
|
"LICENSE",
|
|
28
17
|
"src"
|
|
29
18
|
],
|
|
30
|
-
"
|
|
31
|
-
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"main": "./lib/index.js",
|
|
22
|
+
"types": "./lib/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"bun": "./src/index.ts",
|
|
26
|
+
"import": "./lib/index.js",
|
|
27
|
+
"types": "./lib/index.d.ts"
|
|
28
|
+
}
|
|
32
29
|
},
|
|
33
30
|
"publishConfig": {
|
|
34
31
|
"access": "public"
|
|
@@ -37,14 +34,17 @@
|
|
|
37
34
|
"prepublish": "bun run build",
|
|
38
35
|
"build": "bun run vl_rolldown_build",
|
|
39
36
|
"build:watch": "bun run vl_rolldown_build-watch",
|
|
40
|
-
"lint": "
|
|
37
|
+
"lint": "oxlint .",
|
|
41
38
|
"test": "vitest run",
|
|
42
39
|
"test:coverage": "vitest run --coverage",
|
|
43
40
|
"test:watch": "vitest",
|
|
44
41
|
"typecheck": "tsc --noEmit"
|
|
45
42
|
},
|
|
46
43
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
44
|
+
"@pyreon/typescript": "^0.11.7",
|
|
45
|
+
"@vitus-labs/tools-rolldown": "^1.15.3"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">= 22"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,263 +1,263 @@
|
|
|
1
|
-
import { describe, expect, it } from
|
|
2
|
-
import { createBlur, createFade, createRotate, createScale, createSlide } from
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { createBlur, createFade, createRotate, createScale, createSlide } from '../factories'
|
|
3
3
|
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
4
|
+
describe('createFade', () => {
|
|
5
|
+
it('creates pure opacity fade by default', () => {
|
|
6
6
|
const p = createFade()
|
|
7
7
|
expect(p.enterStyle).toEqual({ opacity: 0 })
|
|
8
8
|
expect(p.enterToStyle).toEqual({ opacity: 1 })
|
|
9
|
-
expect(p.enterTransition).toBe(
|
|
10
|
-
expect(p.leaveTransition).toBe(
|
|
9
|
+
expect(p.enterTransition).toBe('all 300ms ease-out')
|
|
10
|
+
expect(p.leaveTransition).toBe('all 200ms ease-in')
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
it(
|
|
14
|
-
const p = createFade({ direction:
|
|
13
|
+
it('creates directional fade', () => {
|
|
14
|
+
const p = createFade({ direction: 'up', distance: 24 })
|
|
15
15
|
expect(p.enterStyle).toEqual({
|
|
16
16
|
opacity: 0,
|
|
17
|
-
transform:
|
|
17
|
+
transform: 'translateY(24px)',
|
|
18
18
|
})
|
|
19
19
|
expect(p.enterToStyle).toEqual({
|
|
20
20
|
opacity: 1,
|
|
21
|
-
transform:
|
|
21
|
+
transform: 'translateY(0)',
|
|
22
22
|
})
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
it(
|
|
26
|
-
expect(createFade({ direction:
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
it('creates fade with all directions', () => {
|
|
26
|
+
expect(createFade({ direction: 'up' }).enterStyle).toHaveProperty(
|
|
27
|
+
'transform',
|
|
28
|
+
'translateY(16px)',
|
|
29
29
|
)
|
|
30
|
-
expect(createFade({ direction:
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
expect(createFade({ direction: 'down' }).enterStyle).toHaveProperty(
|
|
31
|
+
'transform',
|
|
32
|
+
'translateY(-16px)',
|
|
33
33
|
)
|
|
34
|
-
expect(createFade({ direction:
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
expect(createFade({ direction: 'left' }).enterStyle).toHaveProperty(
|
|
35
|
+
'transform',
|
|
36
|
+
'translateX(16px)',
|
|
37
37
|
)
|
|
38
|
-
expect(createFade({ direction:
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
expect(createFade({ direction: 'right' }).enterStyle).toHaveProperty(
|
|
39
|
+
'transform',
|
|
40
|
+
'translateX(-16px)',
|
|
41
41
|
)
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
it(
|
|
44
|
+
it('custom duration and easing', () => {
|
|
45
45
|
const p = createFade({
|
|
46
46
|
duration: 500,
|
|
47
47
|
leaveDuration: 300,
|
|
48
|
-
easing:
|
|
48
|
+
easing: 'linear',
|
|
49
49
|
})
|
|
50
|
-
expect(p.enterTransition).toBe(
|
|
51
|
-
expect(p.leaveTransition).toBe(
|
|
50
|
+
expect(p.enterTransition).toBe('all 500ms linear')
|
|
51
|
+
expect(p.leaveTransition).toBe('all 300ms ease-in')
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
it(
|
|
55
|
-
const p = createFade({ leaveEasing:
|
|
56
|
-
expect(p.leaveTransition).toBe(
|
|
54
|
+
it('custom leave easing', () => {
|
|
55
|
+
const p = createFade({ leaveEasing: 'linear' })
|
|
56
|
+
expect(p.leaveTransition).toBe('all 200ms linear')
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
-
it(
|
|
59
|
+
it('populates all six preset fields for non-directional', () => {
|
|
60
60
|
const p = createFade()
|
|
61
61
|
expect(p.leaveStyle).toEqual({ opacity: 1 })
|
|
62
62
|
expect(p.leaveToStyle).toEqual({ opacity: 0 })
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
it(
|
|
66
|
-
const p = createFade({ direction:
|
|
67
|
-
expect(p.leaveStyle).toEqual({ opacity: 1, transform:
|
|
68
|
-
expect(p.leaveToStyle).toEqual({ opacity: 0, transform:
|
|
65
|
+
it('populates all six preset fields for directional', () => {
|
|
66
|
+
const p = createFade({ direction: 'up' })
|
|
67
|
+
expect(p.leaveStyle).toEqual({ opacity: 1, transform: 'translateY(0)' })
|
|
68
|
+
expect(p.leaveToStyle).toEqual({ opacity: 0, transform: 'translateY(16px)' })
|
|
69
69
|
})
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
-
describe(
|
|
73
|
-
it(
|
|
72
|
+
describe('createSlide', () => {
|
|
73
|
+
it('defaults to up direction with 16px', () => {
|
|
74
74
|
const p = createSlide()
|
|
75
75
|
expect(p.enterStyle).toEqual({
|
|
76
76
|
opacity: 0,
|
|
77
|
-
transform:
|
|
77
|
+
transform: 'translateY(16px)',
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
it(
|
|
82
|
-
const p = createSlide({ direction:
|
|
81
|
+
it('custom direction and distance', () => {
|
|
82
|
+
const p = createSlide({ direction: 'right', distance: 32 })
|
|
83
83
|
expect(p.enterStyle).toEqual({
|
|
84
84
|
opacity: 0,
|
|
85
|
-
transform:
|
|
85
|
+
transform: 'translateX(-32px)',
|
|
86
86
|
})
|
|
87
87
|
expect(p.enterToStyle).toEqual({
|
|
88
88
|
opacity: 1,
|
|
89
|
-
transform:
|
|
89
|
+
transform: 'translateX(0)',
|
|
90
90
|
})
|
|
91
91
|
})
|
|
92
92
|
|
|
93
|
-
it(
|
|
94
|
-
const p = createSlide({ direction:
|
|
93
|
+
it('is symmetric', () => {
|
|
94
|
+
const p = createSlide({ direction: 'left', distance: 20 })
|
|
95
95
|
expect(p.enterStyle).toEqual(p.leaveToStyle)
|
|
96
96
|
expect(p.enterToStyle).toEqual(p.leaveStyle)
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
it(
|
|
100
|
-
const p = createSlide({ direction:
|
|
99
|
+
it('down direction', () => {
|
|
100
|
+
const p = createSlide({ direction: 'down' })
|
|
101
101
|
expect(p.enterStyle).toEqual({
|
|
102
102
|
opacity: 0,
|
|
103
|
-
transform:
|
|
103
|
+
transform: 'translateY(-16px)',
|
|
104
104
|
})
|
|
105
105
|
})
|
|
106
106
|
|
|
107
|
-
it(
|
|
107
|
+
it('custom duration and easing', () => {
|
|
108
108
|
const p = createSlide({
|
|
109
109
|
duration: 400,
|
|
110
110
|
leaveDuration: 100,
|
|
111
|
-
easing:
|
|
112
|
-
leaveEasing:
|
|
111
|
+
easing: 'linear',
|
|
112
|
+
leaveEasing: 'ease-out',
|
|
113
113
|
})
|
|
114
|
-
expect(p.enterTransition).toBe(
|
|
115
|
-
expect(p.leaveTransition).toBe(
|
|
114
|
+
expect(p.enterTransition).toBe('all 400ms linear')
|
|
115
|
+
expect(p.leaveTransition).toBe('all 100ms ease-out')
|
|
116
116
|
})
|
|
117
117
|
})
|
|
118
118
|
|
|
119
|
-
describe(
|
|
120
|
-
it(
|
|
119
|
+
describe('createScale', () => {
|
|
120
|
+
it('defaults to scale(0.9)', () => {
|
|
121
121
|
const p = createScale()
|
|
122
122
|
expect(p.enterStyle).toEqual({
|
|
123
123
|
opacity: 0,
|
|
124
|
-
transform:
|
|
124
|
+
transform: 'scale(0.9)',
|
|
125
125
|
})
|
|
126
126
|
expect(p.enterToStyle).toEqual({
|
|
127
127
|
opacity: 1,
|
|
128
|
-
transform:
|
|
128
|
+
transform: 'scale(1)',
|
|
129
129
|
})
|
|
130
130
|
})
|
|
131
131
|
|
|
132
|
-
it(
|
|
132
|
+
it('custom from value', () => {
|
|
133
133
|
const p = createScale({ from: 0.5 })
|
|
134
134
|
expect(p.enterStyle).toEqual({
|
|
135
135
|
opacity: 0,
|
|
136
|
-
transform:
|
|
136
|
+
transform: 'scale(0.5)',
|
|
137
137
|
})
|
|
138
138
|
})
|
|
139
139
|
|
|
140
|
-
it(
|
|
140
|
+
it('custom spring easing', () => {
|
|
141
141
|
const p = createScale({
|
|
142
142
|
from: 0.8,
|
|
143
|
-
easing:
|
|
143
|
+
easing: 'cubic-bezier(0.34, 1.56, 0.64, 1)',
|
|
144
144
|
})
|
|
145
|
-
expect(p.enterTransition).toBe(
|
|
145
|
+
expect(p.enterTransition).toBe('all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)')
|
|
146
146
|
})
|
|
147
147
|
|
|
148
|
-
it(
|
|
148
|
+
it('is symmetric', () => {
|
|
149
149
|
const p = createScale({ from: 0.5 })
|
|
150
150
|
expect(p.enterStyle).toEqual(p.leaveToStyle)
|
|
151
151
|
expect(p.enterToStyle).toEqual(p.leaveStyle)
|
|
152
152
|
})
|
|
153
153
|
|
|
154
|
-
it(
|
|
155
|
-
const p = createScale({ leaveEasing:
|
|
156
|
-
expect(p.leaveTransition).toBe(
|
|
154
|
+
it('custom leave easing', () => {
|
|
155
|
+
const p = createScale({ leaveEasing: 'linear' })
|
|
156
|
+
expect(p.leaveTransition).toBe('all 200ms linear')
|
|
157
157
|
})
|
|
158
158
|
})
|
|
159
159
|
|
|
160
|
-
describe(
|
|
161
|
-
it(
|
|
160
|
+
describe('createRotate', () => {
|
|
161
|
+
it('defaults to 15 degrees', () => {
|
|
162
162
|
const p = createRotate()
|
|
163
163
|
expect(p.enterStyle).toEqual({
|
|
164
164
|
opacity: 0,
|
|
165
|
-
transform:
|
|
165
|
+
transform: 'rotate(-15deg)',
|
|
166
166
|
})
|
|
167
167
|
expect(p.leaveToStyle).toEqual({
|
|
168
168
|
opacity: 0,
|
|
169
|
-
transform:
|
|
169
|
+
transform: 'rotate(15deg)',
|
|
170
170
|
})
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
-
it(
|
|
173
|
+
it('custom degrees', () => {
|
|
174
174
|
const p = createRotate({ degrees: 45 })
|
|
175
175
|
expect(p.enterStyle).toEqual({
|
|
176
176
|
opacity: 0,
|
|
177
|
-
transform:
|
|
177
|
+
transform: 'rotate(-45deg)',
|
|
178
178
|
})
|
|
179
179
|
expect(p.leaveToStyle).toEqual({
|
|
180
180
|
opacity: 0,
|
|
181
|
-
transform:
|
|
181
|
+
transform: 'rotate(45deg)',
|
|
182
182
|
})
|
|
183
183
|
})
|
|
184
184
|
|
|
185
|
-
it(
|
|
185
|
+
it('negative degrees for counter-clockwise', () => {
|
|
186
186
|
const p = createRotate({ degrees: -90 })
|
|
187
187
|
expect(p.enterStyle).toEqual({
|
|
188
188
|
opacity: 0,
|
|
189
|
-
transform:
|
|
189
|
+
transform: 'rotate(90deg)',
|
|
190
190
|
})
|
|
191
191
|
})
|
|
192
192
|
|
|
193
|
-
it(
|
|
193
|
+
it('enterToStyle and leaveStyle are identity rotation', () => {
|
|
194
194
|
const p = createRotate()
|
|
195
|
-
expect(p.enterToStyle).toEqual({ opacity: 1, transform:
|
|
196
|
-
expect(p.leaveStyle).toEqual({ opacity: 1, transform:
|
|
195
|
+
expect(p.enterToStyle).toEqual({ opacity: 1, transform: 'rotate(0)' })
|
|
196
|
+
expect(p.leaveStyle).toEqual({ opacity: 1, transform: 'rotate(0)' })
|
|
197
197
|
})
|
|
198
198
|
|
|
199
|
-
it(
|
|
199
|
+
it('custom duration', () => {
|
|
200
200
|
const p = createRotate({ duration: 600, leaveDuration: 400 })
|
|
201
|
-
expect(p.enterTransition).toBe(
|
|
202
|
-
expect(p.leaveTransition).toBe(
|
|
201
|
+
expect(p.enterTransition).toBe('all 600ms ease-out')
|
|
202
|
+
expect(p.leaveTransition).toBe('all 400ms ease-in')
|
|
203
203
|
})
|
|
204
204
|
})
|
|
205
205
|
|
|
206
|
-
describe(
|
|
207
|
-
it(
|
|
206
|
+
describe('createBlur', () => {
|
|
207
|
+
it('defaults to 8px blur', () => {
|
|
208
208
|
const p = createBlur()
|
|
209
209
|
expect(p.enterStyle).toEqual({
|
|
210
210
|
opacity: 0,
|
|
211
|
-
filter:
|
|
211
|
+
filter: 'blur(8px)',
|
|
212
212
|
})
|
|
213
213
|
expect(p.enterToStyle).toEqual({
|
|
214
214
|
opacity: 1,
|
|
215
|
-
filter:
|
|
215
|
+
filter: 'blur(0px)',
|
|
216
216
|
})
|
|
217
217
|
})
|
|
218
218
|
|
|
219
|
-
it(
|
|
219
|
+
it('custom blur amount', () => {
|
|
220
220
|
const p = createBlur({ amount: 16 })
|
|
221
221
|
expect(p.enterStyle).toEqual({
|
|
222
222
|
opacity: 0,
|
|
223
|
-
filter:
|
|
223
|
+
filter: 'blur(16px)',
|
|
224
224
|
})
|
|
225
225
|
})
|
|
226
226
|
|
|
227
|
-
it(
|
|
227
|
+
it('blur with scale', () => {
|
|
228
228
|
const p = createBlur({ amount: 8, scale: 0.9 })
|
|
229
229
|
expect(p.enterStyle).toEqual({
|
|
230
230
|
opacity: 0,
|
|
231
|
-
filter:
|
|
232
|
-
transform:
|
|
231
|
+
filter: 'blur(8px)',
|
|
232
|
+
transform: 'scale(0.9)',
|
|
233
233
|
})
|
|
234
234
|
expect(p.enterToStyle).toEqual({
|
|
235
235
|
opacity: 1,
|
|
236
|
-
filter:
|
|
237
|
-
transform:
|
|
236
|
+
filter: 'blur(0px)',
|
|
237
|
+
transform: 'scale(1)',
|
|
238
238
|
})
|
|
239
239
|
})
|
|
240
240
|
|
|
241
|
-
it(
|
|
241
|
+
it('custom duration', () => {
|
|
242
242
|
const p = createBlur({ duration: 500, leaveDuration: 250 })
|
|
243
|
-
expect(p.enterTransition).toBe(
|
|
244
|
-
expect(p.leaveTransition).toBe(
|
|
243
|
+
expect(p.enterTransition).toBe('all 500ms ease-out')
|
|
244
|
+
expect(p.leaveTransition).toBe('all 250ms ease-in')
|
|
245
245
|
})
|
|
246
246
|
|
|
247
|
-
it(
|
|
247
|
+
it('is symmetric without scale', () => {
|
|
248
248
|
const p = createBlur()
|
|
249
249
|
expect(p.enterStyle).toEqual(p.leaveToStyle)
|
|
250
250
|
expect(p.enterToStyle).toEqual(p.leaveStyle)
|
|
251
251
|
})
|
|
252
252
|
|
|
253
|
-
it(
|
|
253
|
+
it('is symmetric with scale', () => {
|
|
254
254
|
const p = createBlur({ scale: 0.8 })
|
|
255
255
|
expect(p.enterStyle).toEqual(p.leaveToStyle)
|
|
256
256
|
expect(p.enterToStyle).toEqual(p.leaveStyle)
|
|
257
257
|
})
|
|
258
258
|
|
|
259
|
-
it(
|
|
260
|
-
const p = createBlur({ leaveEasing:
|
|
261
|
-
expect(p.leaveTransition).toBe(
|
|
259
|
+
it('custom leave easing', () => {
|
|
260
|
+
const p = createBlur({ leaveEasing: 'linear' })
|
|
261
|
+
expect(p.leaveTransition).toBe('all 200ms linear')
|
|
262
262
|
})
|
|
263
263
|
})
|