@fluentui/react-motion-components-preview 0.11.1 → 0.13.0
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/CHANGELOG.md +19 -1
- package/dist/index.d.ts +135 -9
- package/lib/atoms/blur-atom.js +4 -3
- package/lib/atoms/blur-atom.js.map +1 -1
- package/lib/atoms/fade-atom.js +3 -2
- package/lib/atoms/fade-atom.js.map +1 -1
- package/lib/atoms/rotate-atom.js +6 -9
- package/lib/atoms/rotate-atom.js.map +1 -1
- package/lib/atoms/slide-atom.js +6 -4
- package/lib/atoms/slide-atom.js.map +1 -1
- package/lib/components/Blur/Blur.js +6 -3
- package/lib/components/Blur/Blur.js.map +1 -1
- package/lib/components/Blur/blur-types.js.map +1 -1
- package/lib/components/Fade/Fade.js +9 -3
- package/lib/components/Fade/Fade.js.map +1 -1
- package/lib/components/Fade/fade-types.js.map +1 -1
- package/lib/components/Rotate/Rotate.js +8 -8
- package/lib/components/Rotate/Rotate.js.map +1 -1
- package/lib/components/Rotate/rotate-types.js.map +1 -1
- package/lib/components/Scale/Scale.js +6 -3
- package/lib/components/Scale/Scale.js.map +1 -1
- package/lib/components/Scale/scale-types.js.map +1 -1
- package/lib/components/Slide/Slide.js +9 -3
- package/lib/components/Slide/Slide.js.map +1 -1
- package/lib/components/Slide/slide-types.js.map +1 -1
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/atoms/blur-atom.js +2 -2
- package/lib-commonjs/atoms/blur-atom.js.map +1 -1
- package/lib-commonjs/atoms/fade-atom.js +2 -2
- package/lib-commonjs/atoms/fade-atom.js.map +1 -1
- package/lib-commonjs/atoms/rotate-atom.js +4 -7
- package/lib-commonjs/atoms/rotate-atom.js.map +1 -1
- package/lib-commonjs/atoms/slide-atom.js +2 -2
- package/lib-commonjs/atoms/slide-atom.js.map +1 -1
- package/lib-commonjs/components/Blur/Blur.js +6 -3
- package/lib-commonjs/components/Blur/Blur.js.map +1 -1
- package/lib-commonjs/components/Fade/Fade.js +7 -3
- package/lib-commonjs/components/Fade/Fade.js.map +1 -1
- package/lib-commonjs/components/Rotate/Rotate.js +8 -8
- package/lib-commonjs/components/Rotate/Rotate.js.map +1 -1
- package/lib-commonjs/components/Scale/Scale.js +6 -3
- package/lib-commonjs/components/Scale/Scale.js.map +1 -1
- package/lib-commonjs/components/Slide/Slide.js +9 -3
- package/lib-commonjs/components/Slide/Slide.js.map +1 -1
- package/lib-commonjs/index.js +21 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-motion-components-preview
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 06 Nov 2025 14:56:59 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.13.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.13.0)
|
|
8
|
+
|
|
9
|
+
Thu, 06 Nov 2025 14:56:59 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.12.0..@fluentui/react-motion-components-preview_v0.13.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat(motion): export standard motion atoms ([PR #35421](https://github.com/microsoft/fluentui/pull/35421) by robertpenner@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [0.12.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.12.0)
|
|
17
|
+
|
|
18
|
+
Fri, 31 Oct 2025 16:22:05 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.11.0..@fluentui/react-motion-components-preview_v0.12.0)
|
|
20
|
+
|
|
21
|
+
### Minor changes
|
|
22
|
+
|
|
23
|
+
- feat(motion): standardize from/to parameters ([PR #35419](https://github.com/microsoft/fluentui/pull/35419) by robertpenner@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [0.11.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.11.0)
|
|
8
26
|
|
|
9
27
|
Fri, 03 Oct 2025 14:19:04 GMT
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { AtomMotion } from '@fluentui/react-motion';
|
|
1
2
|
import { PresenceComponent } from '@fluentui/react-motion';
|
|
3
|
+
import type { PresenceDirection } from '@fluentui/react-motion';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Common opacity animation parameter for motion components.
|
|
@@ -10,6 +12,22 @@ declare type AnimateOpacity = {
|
|
|
10
12
|
|
|
11
13
|
declare type Axis3D = 'x' | 'y' | 'z';
|
|
12
14
|
|
|
15
|
+
declare type Axis3D_2 = NonNullable<RotateParams['axis']>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Common parameters shared by all atom functions.
|
|
19
|
+
*/
|
|
20
|
+
declare type BaseAtomParams = {
|
|
21
|
+
/** The functional direction of the motion: 'enter' or 'exit'. */
|
|
22
|
+
direction: PresenceDirection;
|
|
23
|
+
/** The duration of the motion in milliseconds. */
|
|
24
|
+
duration: number;
|
|
25
|
+
/** The easing curve for the motion. */
|
|
26
|
+
easing?: EffectTiming['easing'];
|
|
27
|
+
/** Time (ms) to delay the animation. */
|
|
28
|
+
delay?: EffectTiming['delay'];
|
|
29
|
+
};
|
|
30
|
+
|
|
13
31
|
/**
|
|
14
32
|
* Base presence parameters combining duration, easing, and delay for motion components.
|
|
15
33
|
*/
|
|
@@ -18,9 +36,28 @@ declare type BasePresenceParams = PresenceDuration & PresenceEasing & PresenceDe
|
|
|
18
36
|
/** A React component that applies blur in/out transitions to its children. */
|
|
19
37
|
export declare const Blur: PresenceComponent<BlurParams>;
|
|
20
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Generates a motion atom object for a blur-in or blur-out.
|
|
41
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
42
|
+
* @param duration - The duration of the motion in milliseconds.
|
|
43
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
44
|
+
* @param fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '10px'.
|
|
45
|
+
* @param toRadius - The ending blur radius value with units (e.g., '0px', '5px'). Defaults to '0px'.
|
|
46
|
+
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
47
|
+
* @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
|
|
48
|
+
*/
|
|
49
|
+
export declare const blurAtom: ({ direction, duration, easing, delay, fromRadius, toRadius, }: BlurAtomParams) => AtomMotion;
|
|
50
|
+
|
|
51
|
+
declare interface BlurAtomParams extends BaseAtomParams {
|
|
52
|
+
fromRadius?: string;
|
|
53
|
+
toRadius?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
21
56
|
export declare type BlurParams = BasePresenceParams & AnimateOpacity & {
|
|
22
|
-
/** The radius
|
|
57
|
+
/** The blur radius with units to animate from. Defaults to '10px'. */
|
|
23
58
|
fromRadius?: string;
|
|
59
|
+
/** The blur radius with units to animate to. Defaults to '0px'. */
|
|
60
|
+
toRadius?: string;
|
|
24
61
|
};
|
|
25
62
|
|
|
26
63
|
/** A React component that applies collapse/expand transitions to its children. */
|
|
@@ -67,13 +104,39 @@ export declare const CollapseRelaxed: PresenceComponent<CollapseParams>;
|
|
|
67
104
|
export declare const CollapseSnappy: PresenceComponent<CollapseParams>;
|
|
68
105
|
|
|
69
106
|
/** A React component that applies fade in/out transitions to its children. */
|
|
70
|
-
export declare const Fade: PresenceComponent<
|
|
107
|
+
export declare const Fade: PresenceComponent<FadeParams>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Generates a motion atom object for a fade-in or fade-out.
|
|
111
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
112
|
+
* @param duration - The duration of the motion in milliseconds.
|
|
113
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
114
|
+
* @param delay - The delay before the motion starts. Defaults to 0.
|
|
115
|
+
* @param fromOpacity - The starting opacity value. Defaults to 0.
|
|
116
|
+
* @param toOpacity - The ending opacity value. Defaults to 1.
|
|
117
|
+
* @returns A motion atom object with opacity keyframes and the supplied duration and easing.
|
|
118
|
+
*/
|
|
119
|
+
export declare const fadeAtom: ({ direction, duration, easing, delay, fromOpacity, toOpacity, }: FadeAtomParams) => AtomMotion;
|
|
71
120
|
|
|
72
|
-
|
|
121
|
+
declare interface FadeAtomParams extends BaseAtomParams {
|
|
122
|
+
/** Defines how values are applied before and after execution. Defaults to 'both'. */
|
|
123
|
+
fill?: FillMode;
|
|
124
|
+
/** The starting opacity value. Defaults to 0. */
|
|
125
|
+
fromOpacity?: number;
|
|
126
|
+
/** The ending opacity value. Defaults to 1. */
|
|
127
|
+
toOpacity?: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export declare type FadeParams = BasePresenceParams & {
|
|
131
|
+
/** The starting opacity value. Defaults to 0. */
|
|
132
|
+
fromOpacity?: number;
|
|
133
|
+
/** The ending opacity value. Defaults to 1. */
|
|
134
|
+
toOpacity?: number;
|
|
135
|
+
};
|
|
73
136
|
|
|
74
|
-
export declare const FadeRelaxed: PresenceComponent<
|
|
137
|
+
export declare const FadeRelaxed: PresenceComponent<FadeParams>;
|
|
75
138
|
|
|
76
|
-
export declare const FadeSnappy: PresenceComponent<
|
|
139
|
+
export declare const FadeSnappy: PresenceComponent<FadeParams>;
|
|
77
140
|
|
|
78
141
|
/**
|
|
79
142
|
* Common delay parameters for presence motion components.
|
|
@@ -107,30 +170,68 @@ declare type PresenceEasing = {
|
|
|
107
170
|
|
|
108
171
|
export declare const Rotate: PresenceComponent<RotateParams>;
|
|
109
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Generates a motion atom object for a rotation around a single axis.
|
|
175
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
176
|
+
* @param duration - The duration of the motion in milliseconds.
|
|
177
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
178
|
+
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
|
|
179
|
+
* @param fromAngle - The starting rotation angle in degrees. Defaults to -90.
|
|
180
|
+
* @param toAngle - The ending rotation angle in degrees. Defaults to 0.
|
|
181
|
+
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
182
|
+
* @returns A motion atom object with rotate keyframes and the supplied duration and easing.
|
|
183
|
+
*/
|
|
184
|
+
export declare const rotateAtom: ({ direction, duration, easing, delay, axis, fromAngle, toAngle, }: RotateAtomParams) => AtomMotion;
|
|
185
|
+
|
|
186
|
+
declare interface RotateAtomParams extends BaseAtomParams {
|
|
187
|
+
axis?: Axis3D_2;
|
|
188
|
+
fromAngle?: number;
|
|
189
|
+
toAngle?: number;
|
|
190
|
+
}
|
|
191
|
+
|
|
110
192
|
export declare type RotateParams = BasePresenceParams & AnimateOpacity & {
|
|
111
193
|
/**
|
|
112
194
|
* The axis of rotation: 'x', 'y', or 'z'.
|
|
113
|
-
* Defaults to '
|
|
195
|
+
* Defaults to 'z'.
|
|
114
196
|
*/
|
|
115
197
|
axis?: Axis3D;
|
|
116
198
|
/**
|
|
117
199
|
* The starting rotation angle in degrees.
|
|
118
200
|
* Defaults to -90.
|
|
119
201
|
*/
|
|
120
|
-
|
|
202
|
+
fromAngle?: number;
|
|
121
203
|
/**
|
|
122
204
|
* The ending rotation angle in degrees.
|
|
123
|
-
* Defaults to
|
|
205
|
+
* Defaults to 0.
|
|
124
206
|
*/
|
|
125
|
-
|
|
207
|
+
toAngle?: number;
|
|
126
208
|
};
|
|
127
209
|
|
|
128
210
|
/** A React component that applies scale in/out transitions to its children. */
|
|
129
211
|
export declare const Scale: PresenceComponent<ScaleParams>;
|
|
130
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Generates a motion atom object for a scale in or scale out.
|
|
215
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
216
|
+
* @param duration - The duration of the motion in milliseconds.
|
|
217
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
218
|
+
* @param fromScale - The starting scale value. Defaults to 0.9.
|
|
219
|
+
* @param toScale - The ending scale value. Defaults to 1.
|
|
220
|
+
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
221
|
+
* @returns A motion atom object with scale keyframes and the supplied duration and easing.
|
|
222
|
+
*/
|
|
223
|
+
export declare const scaleAtom: ({ direction, duration, easing, delay, fromScale, toScale, }: ScaleAtomParams) => AtomMotion;
|
|
224
|
+
|
|
225
|
+
declare interface ScaleAtomParams extends BaseAtomParams {
|
|
226
|
+
fromScale?: number;
|
|
227
|
+
toScale?: number;
|
|
228
|
+
}
|
|
229
|
+
|
|
131
230
|
export declare type ScaleParams = BasePresenceParams & AnimateOpacity & {
|
|
132
231
|
/** The scale value to animate from. Defaults to `0.9`. */
|
|
133
232
|
fromScale?: number;
|
|
233
|
+
/** The scale value to animate to. Defaults to `1`. */
|
|
234
|
+
toScale?: number;
|
|
134
235
|
};
|
|
135
236
|
|
|
136
237
|
export declare const ScaleRelaxed: PresenceComponent<ScaleParams>;
|
|
@@ -140,11 +241,36 @@ export declare const ScaleSnappy: PresenceComponent<ScaleParams>;
|
|
|
140
241
|
/** A React component that applies slide in/out transitions to its children. */
|
|
141
242
|
export declare const Slide: PresenceComponent<SlideParams>;
|
|
142
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Generates a motion atom object for a slide-in or slide-out.
|
|
246
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
247
|
+
* @param duration - The duration of the motion in milliseconds.
|
|
248
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
249
|
+
* @param fromX - The starting X translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
250
|
+
* @param fromY - The starting Y translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
251
|
+
* @param toX - The ending X translate value with units (e.g.'5px', '10%'). Defaults to '0px'.
|
|
252
|
+
* @param toY - The ending Y translate value with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
253
|
+
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
254
|
+
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
|
255
|
+
*/
|
|
256
|
+
export declare const slideAtom: ({ direction, duration, easing, delay, fromX, fromY, toX, toY, }: SlideAtomParams) => AtomMotion;
|
|
257
|
+
|
|
258
|
+
declare interface SlideAtomParams extends BaseAtomParams {
|
|
259
|
+
fromX?: string;
|
|
260
|
+
fromY?: string;
|
|
261
|
+
toX?: string;
|
|
262
|
+
toY?: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
143
265
|
export declare type SlideParams = BasePresenceParams & AnimateOpacity & {
|
|
144
266
|
/** The X translate value with units to animate from. Defaults to `'0px'`. */
|
|
145
267
|
fromX?: string;
|
|
146
268
|
/** The Y translate value with units to animate from. Defaults to `'20px'`. */
|
|
147
269
|
fromY?: string;
|
|
270
|
+
/** The X translate value with units to animate to. Defaults to `'0px'`. */
|
|
271
|
+
toX?: string;
|
|
272
|
+
/** The Y translate value with units to animate to. Defaults to `'0px'`. */
|
|
273
|
+
toY?: string;
|
|
148
274
|
};
|
|
149
275
|
|
|
150
276
|
export declare const SlideRelaxed: PresenceComponent<SlideParams>;
|
package/lib/atoms/blur-atom.js
CHANGED
|
@@ -4,16 +4,17 @@ import { motionTokens } from '@fluentui/react-motion';
|
|
|
4
4
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
5
5
|
* @param duration - The duration of the motion in milliseconds.
|
|
6
6
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
7
|
-
* @param fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '
|
|
7
|
+
* @param fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '10px'.
|
|
8
|
+
* @param toRadius - The ending blur radius value with units (e.g., '0px', '5px'). Defaults to '0px'.
|
|
8
9
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
9
10
|
* @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
|
|
10
|
-
*/ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromRadius = '10px' })=>{
|
|
11
|
+
*/ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromRadius = '10px', toRadius = '0px' })=>{
|
|
11
12
|
const keyframes = [
|
|
12
13
|
{
|
|
13
14
|
filter: `blur(${fromRadius})`
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
|
-
filter:
|
|
17
|
+
filter: `blur(${toRadius})`
|
|
17
18
|
}
|
|
18
19
|
];
|
|
19
20
|
if (direction === 'exit') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/blur-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface BlurAtomParams extends BaseAtomParams {\n fromRadius?: string;\n}\n\n/**\n * Generates a motion atom object for a blur-in or blur-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '
|
|
1
|
+
{"version":3,"sources":["../src/atoms/blur-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface BlurAtomParams extends BaseAtomParams {\n fromRadius?: string;\n toRadius?: string;\n}\n\n/**\n * Generates a motion atom object for a blur-in or blur-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '10px'.\n * @param toRadius - The ending blur radius value with units (e.g., '0px', '5px'). Defaults to '0px'.\n * @param delay - Time (ms) to delay the animation. Defaults to 0.\n * @returns A motion atom object with filter blur keyframes and the supplied duration and easing.\n */\nexport const blurAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n fromRadius = '10px',\n toRadius = '0px',\n}: BlurAtomParams): AtomMotion => {\n const keyframes = [{ filter: `blur(${fromRadius})` }, { filter: `blur(${toRadius})` }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n delay,\n };\n};\n"],"names":["motionTokens","blurAtom","direction","duration","easing","curveLinear","delay","fromRadius","toRadius","keyframes","filter","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAQlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,WAAW,CAAC,EACvBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,aAAa,MAAM,EACnBC,WAAW,KAAK,EACD;IACf,MAAMC,YAAY;QAAC;YAAEC,QAAQ,CAAC,KAAK,EAAEH,WAAW,CAAC,CAAC;QAAC;QAAG;YAAEG,QAAQ,CAAC,KAAK,EAAEF,SAAS,CAAC,CAAC;QAAC;KAAE;IACtF,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
|
package/lib/atoms/fade-atom.js
CHANGED
|
@@ -6,14 +6,15 @@ import { motionTokens } from '@fluentui/react-motion';
|
|
|
6
6
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
7
7
|
* @param delay - The delay before the motion starts. Defaults to 0.
|
|
8
8
|
* @param fromOpacity - The starting opacity value. Defaults to 0.
|
|
9
|
+
* @param toOpacity - The ending opacity value. Defaults to 1.
|
|
9
10
|
* @returns A motion atom object with opacity keyframes and the supplied duration and easing.
|
|
10
|
-
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromOpacity = 0 })=>{
|
|
11
|
+
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromOpacity = 0, toOpacity = 1 })=>{
|
|
11
12
|
const keyframes = [
|
|
12
13
|
{
|
|
13
14
|
opacity: fromOpacity
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
|
-
opacity:
|
|
17
|
+
opacity: toOpacity
|
|
17
18
|
}
|
|
18
19
|
];
|
|
19
20
|
if (direction === 'exit') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/fade-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface FadeAtomParams extends BaseAtomParams {\n /** Defines how values are applied before and after execution. Defaults to 'both'. */\n fill?: FillMode;\n\n /** The starting opacity value. Defaults to 0. */\n fromOpacity?: number;\n}\n\n/**\n * Generates a motion atom object for a fade-in or fade-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param delay - The delay before the motion starts. Defaults to 0.\n * @param fromOpacity - The starting opacity value. Defaults to 0.\n * @returns A motion atom object with opacity keyframes and the supplied duration and easing.\n */\nexport const fadeAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n fromOpacity = 0,\n}: FadeAtomParams): AtomMotion => {\n const keyframes = [{ opacity: fromOpacity }, { opacity:
|
|
1
|
+
{"version":3,"sources":["../src/atoms/fade-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface FadeAtomParams extends BaseAtomParams {\n /** Defines how values are applied before and after execution. Defaults to 'both'. */\n fill?: FillMode;\n\n /** The starting opacity value. Defaults to 0. */\n fromOpacity?: number;\n\n /** The ending opacity value. Defaults to 1. */\n toOpacity?: number;\n}\n\n/**\n * Generates a motion atom object for a fade-in or fade-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param delay - The delay before the motion starts. Defaults to 0.\n * @param fromOpacity - The starting opacity value. Defaults to 0.\n * @param toOpacity - The ending opacity value. Defaults to 1.\n * @returns A motion atom object with opacity keyframes and the supplied duration and easing.\n */\nexport const fadeAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n fromOpacity = 0,\n toOpacity = 1,\n}: FadeAtomParams): AtomMotion => {\n const keyframes = [{ opacity: fromOpacity }, { opacity: toOpacity }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n delay,\n // Applying opacity backwards and forwards in time is important\n // to avoid a bug where a delayed animation is not hidden when it should be.\n fill: 'both',\n };\n};\n"],"names":["motionTokens","fadeAtom","direction","duration","easing","curveLinear","delay","fromOpacity","toOpacity","keyframes","opacity","reverse","fill"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAclE;;;;;;;;;CASC,GACD,OAAO,MAAMC,WAAW,CAAC,EACvBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,cAAc,CAAC,EACfC,YAAY,CAAC,EACE;IACf,MAAMC,YAAY;QAAC;YAAEC,SAASH;QAAY;QAAG;YAAEG,SAASF;QAAU;KAAE;IACpE,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;QACAE;QACA,+DAA+D;QAC/D,4EAA4E;QAC5EM,MAAM;IACR;AACF,EAAE"}
|
package/lib/atoms/rotate-atom.js
CHANGED
|
@@ -8,17 +8,11 @@ const createRotateValue = (axis, angle)=>{
|
|
|
8
8
|
* @param duration - The duration of the motion in milliseconds.
|
|
9
9
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
10
10
|
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
11
|
+
* @param fromAngle - The starting rotation angle in degrees. Defaults to -90.
|
|
12
|
+
* @param toAngle - The ending rotation angle in degrees. Defaults to 0.
|
|
13
13
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
14
14
|
* @returns A motion atom object with rotate keyframes and the supplied duration and easing.
|
|
15
|
-
*/ export const rotateAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, axis = '
|
|
16
|
-
let fromAngle = angle;
|
|
17
|
-
let toAngle = 0;
|
|
18
|
-
if (direction === 'exit') {
|
|
19
|
-
fromAngle = 0;
|
|
20
|
-
toAngle = exitAngle;
|
|
21
|
-
}
|
|
15
|
+
*/ export const rotateAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, axis = 'z', fromAngle = -90, toAngle = 0 })=>{
|
|
22
16
|
const keyframes = [
|
|
23
17
|
{
|
|
24
18
|
rotate: createRotateValue(axis, fromAngle)
|
|
@@ -27,6 +21,9 @@ const createRotateValue = (axis, angle)=>{
|
|
|
27
21
|
rotate: createRotateValue(axis, toAngle)
|
|
28
22
|
}
|
|
29
23
|
];
|
|
24
|
+
if (direction === 'exit') {
|
|
25
|
+
keyframes.reverse();
|
|
26
|
+
}
|
|
30
27
|
return {
|
|
31
28
|
keyframes,
|
|
32
29
|
duration,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/rotate-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport type { RotateParams } from '../components/Rotate/rotate-types';\nimport { BaseAtomParams } from '../types';\n\ntype Axis3D = NonNullable<RotateParams['axis']>;\n\ninterface RotateAtomParams extends BaseAtomParams {\n axis?: Axis3D;\n
|
|
1
|
+
{"version":3,"sources":["../src/atoms/rotate-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport type { RotateParams } from '../components/Rotate/rotate-types';\nimport { BaseAtomParams } from '../types';\n\ntype Axis3D = NonNullable<RotateParams['axis']>;\n\ninterface RotateAtomParams extends BaseAtomParams {\n axis?: Axis3D;\n fromAngle?: number;\n toAngle?: number;\n}\n\nconst createRotateValue = (axis: Axis3D, angle: number): string => {\n return `${axis.toLowerCase()} ${angle}deg`;\n};\n\n/**\n * Generates a motion atom object for a rotation around a single axis.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.\n * @param fromAngle - The starting rotation angle in degrees. Defaults to -90.\n * @param toAngle - The ending rotation angle in degrees. Defaults to 0.\n * @param delay - Time (ms) to delay the animation. Defaults to 0.\n * @returns A motion atom object with rotate keyframes and the supplied duration and easing.\n */\nexport const rotateAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n axis = 'z',\n fromAngle = -90,\n toAngle = 0,\n}: RotateAtomParams): AtomMotion => {\n const keyframes = [{ rotate: createRotateValue(axis, fromAngle) }, { rotate: createRotateValue(axis, toAngle) }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n\n return {\n keyframes,\n duration,\n easing,\n delay,\n };\n};\n"],"names":["motionTokens","createRotateValue","axis","angle","toLowerCase","rotateAtom","direction","duration","easing","curveLinear","delay","fromAngle","toAngle","keyframes","rotate","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAYlE,MAAMC,oBAAoB,CAACC,MAAcC;IACvC,OAAO,GAAGD,KAAKE,WAAW,GAAG,CAAC,EAAED,MAAM,GAAG,CAAC;AAC5C;AAEA;;;;;;;;;;CAUC,GACD,OAAO,MAAME,aAAa,CAAC,EACzBC,SAAS,EACTC,QAAQ,EACRC,SAASR,aAAaS,WAAW,EACjCC,QAAQ,CAAC,EACTR,OAAO,GAAG,EACVS,YAAY,CAAC,EAAE,EACfC,UAAU,CAAC,EACM;IACjB,MAAMC,YAAY;QAAC;YAAEC,QAAQb,kBAAkBC,MAAMS;QAAW;QAAG;YAAEG,QAAQb,kBAAkBC,MAAMU;QAAS;KAAE;IAChH,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IAEA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
|
package/lib/atoms/slide-atom.js
CHANGED
|
@@ -4,17 +4,19 @@ import { motionTokens } from '@fluentui/react-motion';
|
|
|
4
4
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
5
5
|
* @param duration - The duration of the motion in milliseconds.
|
|
6
6
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
7
|
-
* @param fromX - The starting X translate value with units (e.g., '
|
|
8
|
-
* @param fromY - The starting Y translate value with units (e.g., '
|
|
7
|
+
* @param fromX - The starting X translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
8
|
+
* @param fromY - The starting Y translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
9
|
+
* @param toX - The ending X translate value with units (e.g.'5px', '10%'). Defaults to '0px'.
|
|
10
|
+
* @param toY - The ending Y translate value with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
9
11
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
10
12
|
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
|
11
|
-
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromX = '0px', fromY = '
|
|
13
|
+
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, fromX = '0px', fromY = '0px', toX = '0px', toY = '0px' })=>{
|
|
12
14
|
const keyframes = [
|
|
13
15
|
{
|
|
14
16
|
translate: `${fromX} ${fromY}`
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
|
-
translate:
|
|
19
|
+
translate: `${toX} ${toY}`
|
|
18
20
|
}
|
|
19
21
|
];
|
|
20
22
|
if (direction === 'exit') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/slide-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface SlideAtomParams extends BaseAtomParams {\n fromX?: string;\n fromY?: string;\n}\n\n/**\n * Generates a motion atom object for a slide-in or slide-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromX - The starting X translate value with units (e.g., '
|
|
1
|
+
{"version":3,"sources":["../src/atoms/slide-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface SlideAtomParams extends BaseAtomParams {\n fromX?: string;\n fromY?: string;\n toX?: string;\n toY?: string;\n}\n\n/**\n * Generates a motion atom object for a slide-in or slide-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromX - The starting X translate value with units (e.g., '50px', '100%'). Defaults to '0px'.\n * @param fromY - The starting Y translate value with units (e.g., '50px', '100%'). Defaults to '0px'.\n * @param toX - The ending X translate value with units (e.g.'5px', '10%'). Defaults to '0px'.\n * @param toY - The ending Y translate value with units (e.g., '5px', '10%'). Defaults to '0px'.\n * @param delay - Time (ms) to delay the animation. Defaults to 0.\n * @returns A motion atom object with translate keyframes and the supplied duration and easing.\n */\nexport const slideAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n fromX = '0px',\n fromY = '0px',\n toX = '0px',\n toY = '0px',\n}: SlideAtomParams): AtomMotion => {\n const keyframes = [{ translate: `${fromX} ${fromY}` }, { translate: `${toX} ${toY}` }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n delay,\n };\n};\n"],"names":["motionTokens","slideAtom","direction","duration","easing","curveLinear","delay","fromX","fromY","toX","toY","keyframes","translate","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAUlE;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,MAAM,KAAK,EACXC,MAAM,KAAK,EACK;IAChB,MAAMC,YAAY;QAAC;YAAEC,WAAW,GAAGL,MAAM,CAAC,EAAEC,OAAO;QAAC;QAAG;YAAEI,WAAW,GAAGH,IAAI,CAAC,EAAEC,KAAK;QAAC;KAAE;IACtF,IAAIR,cAAc,QAAQ;QACxBS,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAR;QACAC;QACAE;IACF;AACF,EAAE"}
|
|
@@ -11,15 +11,17 @@ import { blurAtom } from '../../atoms/blur-atom';
|
|
|
11
11
|
* @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.
|
|
12
12
|
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
|
|
13
13
|
* @param fromRadius - The blur radius with units to animate from. Defaults to `'10px'`.
|
|
14
|
+
* @param toRadius - The blur radius with units to animate to. Defaults to `'0px'`.
|
|
14
15
|
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
|
15
|
-
*/ const blurPresenceFn = ({ duration = motionTokens.durationSlow, easing = motionTokens.curveDecelerateMin, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMin, exitDelay = delay, fromRadius = '10px', animateOpacity = true })=>{
|
|
16
|
+
*/ const blurPresenceFn = ({ duration = motionTokens.durationSlow, easing = motionTokens.curveDecelerateMin, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMin, exitDelay = delay, fromRadius = '10px', toRadius = '0px', animateOpacity = true })=>{
|
|
16
17
|
const enterAtoms = [
|
|
17
18
|
blurAtom({
|
|
18
19
|
direction: 'enter',
|
|
19
20
|
duration,
|
|
20
21
|
easing,
|
|
21
22
|
delay,
|
|
22
|
-
fromRadius
|
|
23
|
+
fromRadius,
|
|
24
|
+
toRadius
|
|
23
25
|
})
|
|
24
26
|
];
|
|
25
27
|
const exitAtoms = [
|
|
@@ -28,7 +30,8 @@ import { blurAtom } from '../../atoms/blur-atom';
|
|
|
28
30
|
duration: exitDuration,
|
|
29
31
|
easing: exitEasing,
|
|
30
32
|
delay: exitDelay,
|
|
31
|
-
fromRadius
|
|
33
|
+
fromRadius,
|
|
34
|
+
toRadius
|
|
32
35
|
})
|
|
33
36
|
];
|
|
34
37
|
// Only add fade atoms if animateOpacity is true.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Blur/Blur.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { blurAtom } from '../../atoms/blur-atom';\nimport { BlurParams } from './blur-types';\n\n/**\n * Define a presence motion for blur in/out\n *\n * @param duration - Time (ms) for the enter transition (blur-in). Defaults to the `durationSlow` value (300 ms).\n * @param easing - Easing curve for the enter transition (blur-in). Defaults to the `curveDecelerateMin` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param fromRadius - The blur radius with units to animate from. Defaults to `'10px'`.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst blurPresenceFn: PresenceMotionFn<BlurParams> = ({\n duration = motionTokens.durationSlow,\n easing = motionTokens.curveDecelerateMin,\n delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMin,\n exitDelay = delay,\n fromRadius = '10px',\n animateOpacity = true,\n}) => {\n const enterAtoms = [blurAtom({ direction: 'enter', duration, easing, delay, fromRadius })];\n const exitAtoms = [\n blurAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n fromRadius,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n/** A React component that applies blur in/out transitions to its children. */\nexport const Blur = createPresenceComponent(blurPresenceFn);\n"],"names":["motionTokens","createPresenceComponent","fadeAtom","blurAtom","blurPresenceFn","duration","durationSlow","easing","curveDecelerateMin","delay","exitDuration","exitEasing","curveAccelerateMin","exitDelay","fromRadius","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Blur"],"mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAA0B,yBAAyB;AACjG,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,QAAQ,QAAQ,wBAAwB;AAGjD
|
|
1
|
+
{"version":3,"sources":["../src/components/Blur/Blur.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { blurAtom } from '../../atoms/blur-atom';\nimport { BlurParams } from './blur-types';\n\n/**\n * Define a presence motion for blur in/out\n *\n * @param duration - Time (ms) for the enter transition (blur-in). Defaults to the `durationSlow` value (300 ms).\n * @param easing - Easing curve for the enter transition (blur-in). Defaults to the `curveDecelerateMin` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param fromRadius - The blur radius with units to animate from. Defaults to `'10px'`.\n * @param toRadius - The blur radius with units to animate to. Defaults to `'0px'`.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst blurPresenceFn: PresenceMotionFn<BlurParams> = ({\n duration = motionTokens.durationSlow,\n easing = motionTokens.curveDecelerateMin,\n delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMin,\n exitDelay = delay,\n fromRadius = '10px',\n toRadius = '0px',\n animateOpacity = true,\n}) => {\n const enterAtoms = [blurAtom({ direction: 'enter', duration, easing, delay, fromRadius, toRadius })];\n const exitAtoms = [\n blurAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n fromRadius,\n toRadius,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n/** A React component that applies blur in/out transitions to its children. */\nexport const Blur = createPresenceComponent(blurPresenceFn);\n"],"names":["motionTokens","createPresenceComponent","fadeAtom","blurAtom","blurPresenceFn","duration","durationSlow","easing","curveDecelerateMin","delay","exitDuration","exitEasing","curveAccelerateMin","exitDelay","fromRadius","toRadius","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Blur"],"mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAA0B,yBAAyB;AACjG,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,QAAQ,QAAQ,wBAAwB;AAGjD;;;;;;;;;;;;CAYC,GACD,MAAMC,iBAA+C,CAAC,EACpDC,WAAWL,aAAaM,YAAY,EACpCC,SAASP,aAAaQ,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeL,QAAQ,EACvBM,aAAaX,aAAaY,kBAAkB,EAC5CC,YAAYJ,KAAK,EACjBK,aAAa,MAAM,EACnBC,WAAW,KAAK,EAChBC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACd,SAAS;YAAEe,WAAW;YAASb;YAAUE;YAAQE;YAAOK;YAAYC;QAAS;KAAG;IACpG,MAAMI,YAAY;QAChBhB,SAAS;YACPe,WAAW;YACXb,UAAUK;YACVH,QAAQI;YACRF,OAAOI;YACPC;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWG,IAAI,CAAClB,SAAS;YAAEgB,WAAW;YAASb;YAAUE;YAAQE;QAAM;QACvEU,UAAUC,IAAI,CAAClB,SAAS;YAAEgB,WAAW;YAAQb,UAAUK;YAAcH,QAAQI;YAAYF,OAAOI;QAAU;IAC5G;IAEA,OAAO;QACLQ,OAAOJ;QACPK,MAAMH;IACR;AACF;AAEA,4EAA4E,GAC5E,OAAO,MAAMI,OAAOtB,wBAAwBG,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Blur/blur-types.ts"],"sourcesContent":["import type { BasePresenceParams, AnimateOpacity } from '../../types';\n\nexport type BlurParams = BasePresenceParams &\n AnimateOpacity & {\n /** The radius
|
|
1
|
+
{"version":3,"sources":["../src/components/Blur/blur-types.ts"],"sourcesContent":["import type { BasePresenceParams, AnimateOpacity } from '../../types';\n\nexport type BlurParams = BasePresenceParams &\n AnimateOpacity & {\n /** The blur radius with units to animate from. Defaults to '10px'. */\n fromRadius?: string;\n\n /** The blur radius with units to animate to. Defaults to '0px'. */\n toRadius?: string;\n };\n"],"names":[],"mappings":"AAEA,WAOI"}
|
|
@@ -9,19 +9,25 @@ import { fadeAtom } from '../../atoms/fade-atom';
|
|
|
9
9
|
* @param exitDuration - Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry.
|
|
10
10
|
* @param exitEasing - Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry.
|
|
11
11
|
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
|
|
12
|
-
|
|
12
|
+
* @param fromOpacity - The starting opacity value. Defaults to 0.
|
|
13
|
+
* @param toOpacity - The ending opacity value. Defaults to 1.
|
|
14
|
+
*/ export const fadePresenceFn = ({ duration = motionTokens.durationNormal, easing = motionTokens.curveEasyEase, delay = 0, exitDuration = duration, exitEasing = easing, exitDelay = delay, fromOpacity = 0, toOpacity = 1 })=>{
|
|
13
15
|
return {
|
|
14
16
|
enter: fadeAtom({
|
|
15
17
|
direction: 'enter',
|
|
16
18
|
duration,
|
|
17
19
|
easing,
|
|
18
|
-
delay
|
|
20
|
+
delay,
|
|
21
|
+
fromOpacity,
|
|
22
|
+
toOpacity
|
|
19
23
|
}),
|
|
20
24
|
exit: fadeAtom({
|
|
21
25
|
direction: 'exit',
|
|
22
26
|
duration: exitDuration,
|
|
23
27
|
easing: exitEasing,
|
|
24
|
-
delay: exitDelay
|
|
28
|
+
delay: exitDelay,
|
|
29
|
+
fromOpacity,
|
|
30
|
+
toOpacity
|
|
25
31
|
})
|
|
26
32
|
};
|
|
27
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Fade/Fade.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { FadeParams } from './fade-types';\n\n/**\n * Define a presence motion for fade in/out\n *\n * @param duration - Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms).\n * @param easing - Easing curve for the enter transition (fade-in). Defaults to the `curveEasyEase` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n */\nexport const fadePresenceFn: PresenceMotionFn<FadeParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveEasyEase,\n delay = 0,\n exitDuration = duration,\n exitEasing = easing,\n exitDelay = delay,\n}) => {\n return {\n enter: fadeAtom({ direction: 'enter', duration, easing, delay }),\n exit: fadeAtom({
|
|
1
|
+
{"version":3,"sources":["../src/components/Fade/Fade.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { FadeParams } from './fade-types';\n\n/**\n * Define a presence motion for fade in/out\n *\n * @param duration - Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms).\n * @param easing - Easing curve for the enter transition (fade-in). Defaults to the `curveEasyEase` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param fromOpacity - The starting opacity value. Defaults to 0.\n * @param toOpacity - The ending opacity value. Defaults to 1.\n */\nexport const fadePresenceFn: PresenceMotionFn<FadeParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveEasyEase,\n delay = 0,\n exitDuration = duration,\n exitEasing = easing,\n exitDelay = delay,\n fromOpacity = 0,\n toOpacity = 1,\n}) => {\n return {\n enter: fadeAtom({ direction: 'enter', duration, easing, delay, fromOpacity, toOpacity }),\n exit: fadeAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n fromOpacity,\n toOpacity,\n }),\n };\n};\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(fadePresenceFn);\n\nexport const FadeSnappy = createPresenceComponentVariant(Fade, { duration: motionTokens.durationFast });\n\nexport const FadeRelaxed = createPresenceComponentVariant(Fade, { duration: motionTokens.durationGentle });\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","fadeAtom","fadePresenceFn","duration","durationNormal","easing","curveEasyEase","delay","exitDuration","exitEasing","exitDelay","fromOpacity","toOpacity","enter","direction","exit","Fade","FadeSnappy","durationFast","FadeRelaxed","durationGentle"],"mappings":"AAAA,SACEA,YAAY,EACZC,uBAAuB,EAEvBC,8BAA8B,QACzB,yBAAyB;AAChC,SAASC,QAAQ,QAAQ,wBAAwB;AAGjD;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,iBAA+C,CAAC,EAC3DC,WAAWL,aAAaM,cAAc,EACtCC,SAASP,aAAaQ,aAAa,EACnCC,QAAQ,CAAC,EACTC,eAAeL,QAAQ,EACvBM,aAAaJ,MAAM,EACnBK,YAAYH,KAAK,EACjBI,cAAc,CAAC,EACfC,YAAY,CAAC,EACd;IACC,OAAO;QACLC,OAAOZ,SAAS;YAAEa,WAAW;YAASX;YAAUE;YAAQE;YAAOI;YAAaC;QAAU;QACtFG,MAAMd,SAAS;YACba,WAAW;YACXX,UAAUK;YACVH,QAAQI;YACRF,OAAOG;YACPC;YACAC;QACF;IACF;AACF,EAAE;AAEF,4EAA4E,GAC5E,OAAO,MAAMI,OAAOjB,wBAAwBG,gBAAgB;AAE5D,OAAO,MAAMe,aAAajB,+BAA+BgB,MAAM;IAAEb,UAAUL,aAAaoB,YAAY;AAAC,GAAG;AAExG,OAAO,MAAMC,cAAcnB,+BAA+BgB,MAAM;IAAEb,UAAUL,aAAasB,cAAc;AAAC,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Fade/fade-types.ts"],"sourcesContent":["import type { BasePresenceParams } from '../../types';\n\nexport type FadeParams = BasePresenceParams;\n"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"sources":["../src/components/Fade/fade-types.ts"],"sourcesContent":["import type { BasePresenceParams } from '../../types';\n\nexport type FadeParams = BasePresenceParams & {\n /** The starting opacity value. Defaults to 0. */\n fromOpacity?: number;\n\n /** The ending opacity value. Defaults to 1. */\n toOpacity?: number;\n};\n"],"names":[],"mappings":"AAEA,WAME"}
|
|
@@ -10,11 +10,11 @@ import { rotateAtom } from '../../atoms/rotate-atom';
|
|
|
10
10
|
* @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.
|
|
11
11
|
* @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.
|
|
12
12
|
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
|
|
13
|
-
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to '
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
13
|
+
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'z'.
|
|
14
|
+
* @param fromAngle - The starting rotation angle in degrees. Defaults to -90.
|
|
15
|
+
* @param toAngle - The ending rotation angle in degrees. Defaults to 0.
|
|
16
16
|
* @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.
|
|
17
|
-
*/ const rotatePresenceFn = ({ duration = motionTokens.durationGentle, easing = motionTokens.curveDecelerateMax, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMax, exitDelay = delay, axis = '
|
|
17
|
+
*/ const rotatePresenceFn = ({ duration = motionTokens.durationGentle, easing = motionTokens.curveDecelerateMax, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMax, exitDelay = delay, axis = 'z', fromAngle = -90, toAngle = 0, animateOpacity = true })=>{
|
|
18
18
|
const enterAtoms = [
|
|
19
19
|
rotateAtom({
|
|
20
20
|
direction: 'enter',
|
|
@@ -22,8 +22,8 @@ import { rotateAtom } from '../../atoms/rotate-atom';
|
|
|
22
22
|
easing,
|
|
23
23
|
delay,
|
|
24
24
|
axis,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
fromAngle,
|
|
26
|
+
toAngle
|
|
27
27
|
})
|
|
28
28
|
];
|
|
29
29
|
const exitAtoms = [
|
|
@@ -33,8 +33,8 @@ import { rotateAtom } from '../../atoms/rotate-atom';
|
|
|
33
33
|
easing: exitEasing,
|
|
34
34
|
delay: exitDelay,
|
|
35
35
|
axis,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
fromAngle,
|
|
37
|
+
toAngle
|
|
38
38
|
})
|
|
39
39
|
];
|
|
40
40
|
if (animateOpacity) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Rotate/Rotate.ts"],"sourcesContent":["import { AtomMotion, createPresenceComponent, motionTokens, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport { RotateParams } from './rotate-types';\n\n/**\n * Define a presence motion for rotate in/out\n *\n * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.\n * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to '
|
|
1
|
+
{"version":3,"sources":["../src/components/Rotate/Rotate.ts"],"sourcesContent":["import { AtomMotion, createPresenceComponent, motionTokens, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport { RotateParams } from './rotate-types';\n\n/**\n * Define a presence motion for rotate in/out\n *\n * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.\n * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'z'.\n * @param fromAngle - The starting rotation angle in degrees. Defaults to -90.\n * @param toAngle - The ending rotation angle in degrees. Defaults to 0.\n * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.\n */\nconst rotatePresenceFn: PresenceMotionFn<RotateParams> = ({\n duration = motionTokens.durationGentle,\n easing = motionTokens.curveDecelerateMax,\n delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMax,\n exitDelay = delay,\n axis = 'z',\n fromAngle = -90,\n toAngle = 0,\n animateOpacity = true,\n}: RotateParams) => {\n const enterAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'enter',\n duration,\n easing,\n delay,\n axis,\n fromAngle,\n toAngle,\n }),\n ];\n\n const exitAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n axis,\n fromAngle,\n toAngle,\n }),\n ];\n\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n// Create a presence motion component to rotate an element around a single axis (x, y, or z).\nexport const Rotate = createPresenceComponent(rotatePresenceFn);\n"],"names":["createPresenceComponent","motionTokens","fadeAtom","rotateAtom","rotatePresenceFn","duration","durationGentle","easing","curveDecelerateMax","delay","exitDuration","exitEasing","curveAccelerateMax","exitDelay","axis","fromAngle","toAngle","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Rotate"],"mappings":"AAAA,SAAqBA,uBAAuB,EAAEC,YAAY,QAA0B,yBAAyB;AAC7G,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,UAAU,QAAQ,0BAA0B;AAGrD;;;;;;;;;;;;;CAaC,GACD,MAAMC,mBAAmD,CAAC,EACxDC,WAAWJ,aAAaK,cAAc,EACtCC,SAASN,aAAaO,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeL,QAAQ,EACvBM,aAAaV,aAAaW,kBAAkB,EAC5CC,YAAYJ,KAAK,EACjBK,OAAO,GAAG,EACVC,YAAY,CAAC,EAAE,EACfC,UAAU,CAAC,EACXC,iBAAiB,IAAI,EACR;IACb,MAAMC,aAA2B;QAC/Bf,WAAW;YACTgB,WAAW;YACXd;YACAE;YACAE;YACAK;YACAC;YACAC;QACF;KACD;IAED,MAAMI,YAA0B;QAC9BjB,WAAW;YACTgB,WAAW;YACXd,UAAUK;YACVH,QAAQI;YACRF,OAAOI;YACPC;YACAC;YACAC;QACF;KACD;IAED,IAAIC,gBAAgB;QAClBC,WAAWG,IAAI,CAACnB,SAAS;YAAEiB,WAAW;YAASd;YAAUE;YAAQE;QAAM;QACvEW,UAAUC,IAAI,CAACnB,SAAS;YAAEiB,WAAW;YAAQd,UAAUK;YAAcH,QAAQI;YAAYF,OAAOI;QAAU;IAC5G;IAEA,OAAO;QACLS,OAAOJ;QACPK,MAAMH;IACR;AACF;AAEA,6FAA6F;AAC7F,OAAO,MAAMI,SAASxB,wBAAwBI,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Rotate/rotate-types.ts"],"sourcesContent":["import type { BasePresenceParams, AnimateOpacity } from '../../types';\n\ntype Axis3D = 'x' | 'y' | 'z';\n\nexport type RotateParams = BasePresenceParams &\n AnimateOpacity & {\n /**\n * The axis of rotation: 'x', 'y', or 'z'.\n * Defaults to '
|
|
1
|
+
{"version":3,"sources":["../src/components/Rotate/rotate-types.ts"],"sourcesContent":["import type { BasePresenceParams, AnimateOpacity } from '../../types';\n\ntype Axis3D = 'x' | 'y' | 'z';\n\nexport type RotateParams = BasePresenceParams &\n AnimateOpacity & {\n /**\n * The axis of rotation: 'x', 'y', or 'z'.\n * Defaults to 'z'.\n */\n axis?: Axis3D;\n\n /**\n * The starting rotation angle in degrees.\n * Defaults to -90.\n */\n fromAngle?: number;\n\n /**\n * The ending rotation angle in degrees.\n * Defaults to 0.\n */\n toAngle?: number;\n };\n"],"names":[],"mappings":"AAIA,WAmBI"}
|
|
@@ -11,15 +11,17 @@ import { scaleAtom } from '../../atoms/scale-atom';
|
|
|
11
11
|
* @param exitEasing - Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value.
|
|
12
12
|
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
|
|
13
13
|
* @param fromScale - The scale value to animate from. Defaults to `0.9`.
|
|
14
|
+
* @param toScale - The scale value to animate to. Defaults to `1`.
|
|
14
15
|
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
|
15
|
-
*/ const scalePresenceFn = ({ duration = motionTokens.durationGentle, easing = motionTokens.curveDecelerateMax, delay = 0, exitDuration = motionTokens.durationNormal, exitEasing = motionTokens.curveAccelerateMax, exitDelay = delay, fromScale = 0.9, animateOpacity = true })=>{
|
|
16
|
+
*/ const scalePresenceFn = ({ duration = motionTokens.durationGentle, easing = motionTokens.curveDecelerateMax, delay = 0, exitDuration = motionTokens.durationNormal, exitEasing = motionTokens.curveAccelerateMax, exitDelay = delay, fromScale = 0.9, toScale = 1, animateOpacity = true })=>{
|
|
16
17
|
const enterAtoms = [
|
|
17
18
|
scaleAtom({
|
|
18
19
|
direction: 'enter',
|
|
19
20
|
duration,
|
|
20
21
|
easing,
|
|
21
22
|
delay,
|
|
22
|
-
fromScale
|
|
23
|
+
fromScale,
|
|
24
|
+
toScale
|
|
23
25
|
})
|
|
24
26
|
];
|
|
25
27
|
const exitAtoms = [
|
|
@@ -28,7 +30,8 @@ import { scaleAtom } from '../../atoms/scale-atom';
|
|
|
28
30
|
duration: exitDuration,
|
|
29
31
|
easing: exitEasing,
|
|
30
32
|
delay: exitDelay,
|
|
31
|
-
fromScale
|
|
33
|
+
fromScale,
|
|
34
|
+
toScale
|
|
32
35
|
})
|
|
33
36
|
];
|
|
34
37
|
// Only add fade atoms if animateOpacity is true.
|