@fluentui/react-motion-components-preview 0.0.0-nightly-20260106-0406.1 → 0.0.0-nightly-20260108-0406.1
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 +6 -6
- package/dist/index.d.ts +67 -57
- package/lib/atoms/blur-atom.js +5 -5
- package/lib/atoms/blur-atom.js.map +1 -1
- package/lib/atoms/fade-atom.js +5 -5
- package/lib/atoms/fade-atom.js.map +1 -1
- package/lib/atoms/rotate-atom.js +5 -5
- package/lib/atoms/rotate-atom.js.map +1 -1
- package/lib/atoms/scale-atom.js +5 -5
- package/lib/atoms/scale-atom.js.map +1 -1
- package/lib/atoms/slide-atom.js +7 -7
- package/lib/atoms/slide-atom.js.map +1 -1
- package/lib/components/Blur/Blur.js +7 -7
- package/lib/components/Blur/Blur.js.map +1 -1
- package/lib/components/Blur/blur-types.js.map +1 -1
- package/lib/components/Collapse/Collapse.js +4 -4
- package/lib/components/Collapse/Collapse.js.map +1 -1
- package/lib/components/Collapse/collapse-atoms.js +4 -4
- package/lib/components/Collapse/collapse-atoms.js.map +1 -1
- package/lib/components/Collapse/collapse-types.js.map +1 -1
- package/lib/components/Fade/Fade.js +7 -7
- 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 +7 -7
- 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 +7 -7
- 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 +13 -13
- package/lib/components/Slide/Slide.js.map +1 -1
- package/lib/components/Slide/slide-types.js.map +1 -1
- package/lib-commonjs/atoms/blur-atom.js +3 -3
- package/lib-commonjs/atoms/blur-atom.js.map +1 -1
- package/lib-commonjs/atoms/fade-atom.js +3 -3
- package/lib-commonjs/atoms/fade-atom.js.map +1 -1
- package/lib-commonjs/atoms/rotate-atom.js +3 -3
- package/lib-commonjs/atoms/rotate-atom.js.map +1 -1
- package/lib-commonjs/atoms/scale-atom.js +3 -3
- package/lib-commonjs/atoms/scale-atom.js.map +1 -1
- package/lib-commonjs/atoms/slide-atom.js +3 -3
- package/lib-commonjs/atoms/slide-atom.js.map +1 -1
- package/lib-commonjs/components/Blur/Blur.js +7 -7
- package/lib-commonjs/components/Blur/Blur.js.map +1 -1
- package/lib-commonjs/components/Collapse/Collapse.js +4 -4
- package/lib-commonjs/components/Collapse/Collapse.js.map +1 -1
- package/lib-commonjs/components/Collapse/collapse-atoms.js +4 -4
- package/lib-commonjs/components/Collapse/collapse-atoms.js.map +1 -1
- package/lib-commonjs/components/Fade/Fade.js +5 -5
- package/lib-commonjs/components/Fade/Fade.js.map +1 -1
- package/lib-commonjs/components/Rotate/Rotate.js +7 -7
- package/lib-commonjs/components/Rotate/Rotate.js.map +1 -1
- package/lib-commonjs/components/Scale/Scale.js +7 -7
- package/lib-commonjs/components/Scale/Scale.js.map +1 -1
- package/lib-commonjs/components/Slide/Slide.js +13 -13
- package/lib-commonjs/components/Slide/Slide.js.map +1 -1
- package/package.json +3 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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, 08 Jan 2026 04:21:48 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20260108-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20260108-0406.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.14.1..@fluentui/react-motion-components-preview_v0.0.0-nightly-
|
|
9
|
+
Thu, 08 Jan 2026 04:21:48 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.14.1..@fluentui/react-motion-components-preview_v0.0.0-nightly-20260108-0406.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/react-motion to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/react-motion to v0.0.0-nightly-20260108-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/699a5d7ffebdd85d3b9a321e43788800f3056ded) by beachball)
|
|
16
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20260108-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/699a5d7ffebdd85d3b9a321e43788800f3056ded) by beachball)
|
|
17
17
|
|
|
18
18
|
## [0.14.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.14.0)
|
|
19
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -43,23 +43,25 @@ export declare const Blur: PresenceComponent<BlurParams>;
|
|
|
43
43
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
44
44
|
* @param duration - The duration of the motion in milliseconds.
|
|
45
45
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
46
|
+
* @param outRadius - Blur radius for the out state (exited) with units (e.g., '20px', '1rem'). Defaults to '10px'.
|
|
47
|
+
* @param inRadius - Blur radius for the in state (entered) with units (e.g., '0px', '5px'). Defaults to '0px'.
|
|
48
48
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
49
49
|
* @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
|
|
50
50
|
*/
|
|
51
|
-
export declare const blurAtom: ({ direction, duration, easing, delay,
|
|
51
|
+
export declare const blurAtom: ({ direction, duration, easing, delay, outRadius, inRadius, }: BlurAtomParams) => AtomMotion;
|
|
52
52
|
|
|
53
53
|
declare interface BlurAtomParams extends BaseAtomParams {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
/** Blur radius for the out state (exited). Defaults to '10px'. */
|
|
55
|
+
outRadius?: string;
|
|
56
|
+
/** Blur radius for the in state (entered). Defaults to '0px'. */
|
|
57
|
+
inRadius?: string;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
export declare type BlurParams = BasePresenceParams & AnimateOpacity & {
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
|
|
61
|
+
/** Blur radius for the out state (exited). Defaults to '10px'. */
|
|
62
|
+
outRadius?: string;
|
|
63
|
+
/** Blur radius for the in state (entered). Defaults to '0px'. */
|
|
64
|
+
inRadius?: string;
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
/** A React component that applies collapse/expand transitions to its children. */
|
|
@@ -87,8 +89,8 @@ declare type CollapseOrientation = 'horizontal' | 'vertical';
|
|
|
87
89
|
export declare type CollapseParams = BasePresenceParams & AnimateOpacity & CollapseDurations & {
|
|
88
90
|
/** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */
|
|
89
91
|
orientation?: CollapseOrientation;
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
+
/** Size for the out state (collapsed). Defaults to `'0px'`. */
|
|
93
|
+
outSize?: string;
|
|
92
94
|
/**
|
|
93
95
|
* Time (ms) to delay the inner stagger between size and opacity animations.
|
|
94
96
|
* On enter this delays the opacity after size; on exit this delays the size after opacity.
|
|
@@ -114,26 +116,26 @@ export declare const Fade: PresenceComponent<FadeParams>;
|
|
|
114
116
|
* @param duration - The duration of the motion in milliseconds.
|
|
115
117
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
116
118
|
* @param delay - The delay before the motion starts. Defaults to 0.
|
|
117
|
-
* @param
|
|
118
|
-
* @param
|
|
119
|
+
* @param outOpacity - Opacity for the out state (exited). Defaults to 0.
|
|
120
|
+
* @param inOpacity - Opacity for the in state (entered). Defaults to 1.
|
|
119
121
|
* @returns A motion atom object with opacity keyframes and the supplied duration and easing.
|
|
120
122
|
*/
|
|
121
|
-
export declare const fadeAtom: ({ direction, duration, easing, delay,
|
|
123
|
+
export declare const fadeAtom: ({ direction, duration, easing, delay, outOpacity, inOpacity, }: FadeAtomParams) => AtomMotion;
|
|
122
124
|
|
|
123
125
|
declare interface FadeAtomParams extends BaseAtomParams {
|
|
124
126
|
/** Defines how values are applied before and after execution. Defaults to 'both'. */
|
|
125
127
|
fill?: FillMode;
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
|
|
128
|
+
/** Opacity for the out state (exited). Defaults to 0. */
|
|
129
|
+
outOpacity?: number;
|
|
130
|
+
/** Opacity for the in state (entered). Defaults to 1. */
|
|
131
|
+
inOpacity?: number;
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
export declare type FadeParams = BasePresenceParams & {
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
|
|
135
|
+
/** Opacity for the out state (exited). Defaults to 0. */
|
|
136
|
+
outOpacity?: number;
|
|
137
|
+
/** Opacity for the in state (entered). Defaults to 1. */
|
|
138
|
+
inOpacity?: number;
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
export declare const FadeRelaxed: PresenceComponent<FadeParams>;
|
|
@@ -178,17 +180,19 @@ export declare const Rotate: PresenceComponent<RotateParams>;
|
|
|
178
180
|
* @param duration - The duration of the motion in milliseconds.
|
|
179
181
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
180
182
|
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
+
* @param outAngle - Rotation angle for the out state (exited) in degrees. Defaults to -90.
|
|
184
|
+
* @param inAngle - Rotation angle for the in state (entered) in degrees. Defaults to 0.
|
|
183
185
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
184
186
|
* @returns A motion atom object with rotate keyframes and the supplied duration and easing.
|
|
185
187
|
*/
|
|
186
|
-
export declare const rotateAtom: ({ direction, duration, easing, delay, axis,
|
|
188
|
+
export declare const rotateAtom: ({ direction, duration, easing, delay, axis, outAngle, inAngle, }: RotateAtomParams) => AtomMotion;
|
|
187
189
|
|
|
188
190
|
declare interface RotateAtomParams extends BaseAtomParams {
|
|
189
191
|
axis?: Axis3D_2;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
/** Rotation angle for the out state (exited) in degrees. Defaults to -90. */
|
|
193
|
+
outAngle?: number;
|
|
194
|
+
/** Rotation angle for the in state (entered) in degrees. Defaults to 0. */
|
|
195
|
+
inAngle?: number;
|
|
192
196
|
}
|
|
193
197
|
|
|
194
198
|
export declare type RotateParams = BasePresenceParams & AnimateOpacity & {
|
|
@@ -198,15 +202,15 @@ export declare type RotateParams = BasePresenceParams & AnimateOpacity & {
|
|
|
198
202
|
*/
|
|
199
203
|
axis?: Axis3D;
|
|
200
204
|
/**
|
|
201
|
-
*
|
|
205
|
+
* Rotation angle for the out state (exited) in degrees.
|
|
202
206
|
* Defaults to -90.
|
|
203
207
|
*/
|
|
204
|
-
|
|
208
|
+
outAngle?: number;
|
|
205
209
|
/**
|
|
206
|
-
*
|
|
210
|
+
* Rotation angle for the in state (entered) in degrees.
|
|
207
211
|
* Defaults to 0.
|
|
208
212
|
*/
|
|
209
|
-
|
|
213
|
+
inAngle?: number;
|
|
210
214
|
};
|
|
211
215
|
|
|
212
216
|
/** A React component that applies scale in/out transitions to its children. */
|
|
@@ -217,23 +221,25 @@ export declare const Scale: PresenceComponent<ScaleParams>;
|
|
|
217
221
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
218
222
|
* @param duration - The duration of the motion in milliseconds.
|
|
219
223
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
220
|
-
* @param
|
|
221
|
-
* @param
|
|
224
|
+
* @param outScale - Scale for the out state (exited). Defaults to 0.9.
|
|
225
|
+
* @param inScale - Scale for the in state (entered). Defaults to 1.
|
|
222
226
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
223
227
|
* @returns A motion atom object with scale keyframes and the supplied duration and easing.
|
|
224
228
|
*/
|
|
225
|
-
export declare const scaleAtom: ({ direction, duration, easing, delay,
|
|
229
|
+
export declare const scaleAtom: ({ direction, duration, easing, delay, outScale, inScale, }: ScaleAtomParams) => AtomMotion;
|
|
226
230
|
|
|
227
231
|
declare interface ScaleAtomParams extends BaseAtomParams {
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
/** Scale for the out state (exited). Defaults to 0.9. */
|
|
233
|
+
outScale?: number;
|
|
234
|
+
/** Scale for the in state (entered). Defaults to 1. */
|
|
235
|
+
inScale?: number;
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
export declare type ScaleParams = BasePresenceParams & AnimateOpacity & {
|
|
233
|
-
/**
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
|
|
239
|
+
/** Scale for the out state (exited). Defaults to `0.9`. */
|
|
240
|
+
outScale?: number;
|
|
241
|
+
/** Scale for the in state (entered). Defaults to `1`. */
|
|
242
|
+
inScale?: number;
|
|
237
243
|
};
|
|
238
244
|
|
|
239
245
|
export declare const ScaleRelaxed: PresenceComponent<ScaleParams>;
|
|
@@ -248,31 +254,35 @@ export declare const Slide: PresenceComponent<SlideParams>;
|
|
|
248
254
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
|
249
255
|
* @param duration - The duration of the motion in milliseconds.
|
|
250
256
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
|
251
|
-
* @param
|
|
252
|
-
* @param
|
|
253
|
-
* @param
|
|
254
|
-
* @param
|
|
257
|
+
* @param outX - X translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
258
|
+
* @param outY - Y translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
259
|
+
* @param inX - X translate for the in state (entered) with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
260
|
+
* @param inY - Y translate for the in state (entered) with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
255
261
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
256
262
|
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
|
257
263
|
*/
|
|
258
|
-
export declare const slideAtom: ({ direction, duration, easing, delay,
|
|
264
|
+
export declare const slideAtom: ({ direction, duration, easing, delay, outX, outY, inX, inY, }: SlideAtomParams) => AtomMotion;
|
|
259
265
|
|
|
260
266
|
declare interface SlideAtomParams extends BaseAtomParams {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
267
|
+
/** X translate for the out state (exited). Defaults to '0px'. */
|
|
268
|
+
outX?: string;
|
|
269
|
+
/** Y translate for the out state (exited). Defaults to '0px'. */
|
|
270
|
+
outY?: string;
|
|
271
|
+
/** X translate for the in state (entered). Defaults to '0px'. */
|
|
272
|
+
inX?: string;
|
|
273
|
+
/** Y translate for the in state (entered). Defaults to '0px'. */
|
|
274
|
+
inY?: string;
|
|
265
275
|
}
|
|
266
276
|
|
|
267
277
|
export declare type SlideParams = BasePresenceParams & AnimateOpacity & {
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
|
|
278
|
+
/** X translate for the out state (exited). Defaults to `'0px'`. */
|
|
279
|
+
outX?: string;
|
|
280
|
+
/** Y translate for the out state (exited). Defaults to `'0px'`. */
|
|
281
|
+
outY?: string;
|
|
282
|
+
/** X translate for the in state (entered). Defaults to `'0px'`. */
|
|
283
|
+
inX?: string;
|
|
284
|
+
/** Y translate for the in state (entered). Defaults to `'0px'`. */
|
|
285
|
+
inY?: string;
|
|
276
286
|
};
|
|
277
287
|
|
|
278
288
|
export declare const SlideRelaxed: PresenceComponent<SlideParams>;
|
package/lib/atoms/blur-atom.js
CHANGED
|
@@ -4,17 +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
|
|
8
|
-
* @param
|
|
7
|
+
* @param outRadius - Blur radius for the out state (exited) with units (e.g., '20px', '1rem'). Defaults to '10px'.
|
|
8
|
+
* @param inRadius - Blur radius for the in state (entered) with units (e.g., '0px', '5px'). Defaults to '0px'.
|
|
9
9
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
10
10
|
* @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
|
|
11
|
-
*/ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0,
|
|
11
|
+
*/ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outRadius = '10px', inRadius = '0px' })=>{
|
|
12
12
|
const keyframes = [
|
|
13
13
|
{
|
|
14
|
-
filter: `blur(${
|
|
14
|
+
filter: `blur(${outRadius})`
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
filter: `blur(${
|
|
17
|
+
filter: `blur(${inRadius})`
|
|
18
18
|
}
|
|
19
19
|
];
|
|
20
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
|
|
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 /** Blur radius for the out state (exited). Defaults to '10px'. */\n outRadius?: string;\n /** Blur radius for the in state (entered). Defaults to '0px'. */\n inRadius?: 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 outRadius - Blur radius for the out state (exited) with units (e.g., '20px', '1rem'). Defaults to '10px'.\n * @param inRadius - Blur radius for the in state (entered) 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 outRadius = '10px',\n inRadius = '0px',\n}: BlurAtomParams): AtomMotion => {\n const keyframes = [{ filter: `blur(${outRadius})` }, { filter: `blur(${inRadius})` }];\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","outRadius","inRadius","keyframes","filter","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAUlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,WAAW,CAAC,EACvBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,YAAY,MAAM,EAClBC,WAAW,KAAK,EACD;IACf,MAAMC,YAAY;QAAC;YAAEC,QAAQ,CAAC,KAAK,EAAEH,UAAU,CAAC,CAAC;QAAC;QAAG;YAAEG,QAAQ,CAAC,KAAK,EAAEF,SAAS,CAAC,CAAC;QAAC;KAAE;IACrF,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
|
package/lib/atoms/fade-atom.js
CHANGED
|
@@ -5,16 +5,16 @@ import { motionTokens } from '@fluentui/react-motion';
|
|
|
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
7
|
* @param delay - The delay before the motion starts. Defaults to 0.
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
8
|
+
* @param outOpacity - Opacity for the out state (exited). Defaults to 0.
|
|
9
|
+
* @param inOpacity - Opacity for the in state (entered). Defaults to 1.
|
|
10
10
|
* @returns A motion atom object with opacity keyframes and the supplied duration and easing.
|
|
11
|
-
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0,
|
|
11
|
+
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outOpacity = 0, inOpacity = 1 })=>{
|
|
12
12
|
const keyframes = [
|
|
13
13
|
{
|
|
14
|
-
opacity:
|
|
14
|
+
opacity: outOpacity
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
opacity:
|
|
17
|
+
opacity: inOpacity
|
|
18
18
|
}
|
|
19
19
|
];
|
|
20
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 /**
|
|
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 /** Opacity for the out state (exited). Defaults to 0. */\n outOpacity?: number;\n\n /** Opacity for the in state (entered). Defaults to 1. */\n inOpacity?: 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 outOpacity - Opacity for the out state (exited). Defaults to 0.\n * @param inOpacity - Opacity for the in state (entered). 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 outOpacity = 0,\n inOpacity = 1,\n}: FadeAtomParams): AtomMotion => {\n const keyframes = [{ opacity: outOpacity }, { opacity: inOpacity }];\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","outOpacity","inOpacity","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,aAAa,CAAC,EACdC,YAAY,CAAC,EACE;IACf,MAAMC,YAAY;QAAC;YAAEC,SAASH;QAAW;QAAG;YAAEG,SAASF;QAAU;KAAE;IACnE,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,17 @@ 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 outAngle - Rotation angle for the out state (exited) in degrees. Defaults to -90.
|
|
12
|
+
* @param inAngle - Rotation angle for the in state (entered) 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 = 'z',
|
|
15
|
+
*/ export const rotateAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, axis = 'z', outAngle = -90, inAngle = 0 })=>{
|
|
16
16
|
const keyframes = [
|
|
17
17
|
{
|
|
18
|
-
rotate: createRotateValue(axis,
|
|
18
|
+
rotate: createRotateValue(axis, outAngle)
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
rotate: createRotateValue(axis,
|
|
21
|
+
rotate: createRotateValue(axis, inAngle)
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
if (direction === 'exit') {
|
|
@@ -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 /** Rotation angle for the out state (exited) in degrees. Defaults to -90. */\n outAngle?: number;\n /** Rotation angle for the in state (entered) in degrees. Defaults to 0. */\n inAngle?: 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 outAngle - Rotation angle for the out state (exited) in degrees. Defaults to -90.\n * @param inAngle - Rotation angle for the in state (entered) 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 outAngle = -90,\n inAngle = 0,\n}: RotateAtomParams): AtomMotion => {\n const keyframes = [{ rotate: createRotateValue(axis, outAngle) }, { rotate: createRotateValue(axis, inAngle) }];\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","outAngle","inAngle","keyframes","rotate","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAclE,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,WAAW,CAAC,EAAE,EACdC,UAAU,CAAC,EACM;IACjB,MAAMC,YAAY;QAAC;YAAEC,QAAQb,kBAAkBC,MAAMS;QAAU;QAAG;YAAEG,QAAQb,kBAAkBC,MAAMU;QAAS;KAAE;IAC/G,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IAEA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
|
package/lib/atoms/scale-atom.js
CHANGED
|
@@ -4,17 +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
|
|
8
|
-
* @param
|
|
7
|
+
* @param outScale - Scale for the out state (exited). Defaults to 0.9.
|
|
8
|
+
* @param inScale - Scale for the in state (entered). Defaults to 1.
|
|
9
9
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
10
10
|
* @returns A motion atom object with scale keyframes and the supplied duration and easing.
|
|
11
|
-
*/ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0,
|
|
11
|
+
*/ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outScale = 0.9, inScale = 1 })=>{
|
|
12
12
|
const keyframes = [
|
|
13
13
|
{
|
|
14
|
-
scale:
|
|
14
|
+
scale: outScale
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
scale:
|
|
17
|
+
scale: inScale
|
|
18
18
|
}
|
|
19
19
|
];
|
|
20
20
|
if (direction === 'exit') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/scale-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface ScaleAtomParams extends BaseAtomParams {\n
|
|
1
|
+
{"version":3,"sources":["../src/atoms/scale-atom.ts"],"sourcesContent":["import { AtomMotion, motionTokens } from '@fluentui/react-motion';\nimport { BaseAtomParams } from '../types';\n\ninterface ScaleAtomParams extends BaseAtomParams {\n /** Scale for the out state (exited). Defaults to 0.9. */\n outScale?: number;\n /** Scale for the in state (entered). Defaults to 1. */\n inScale?: number;\n}\n\n/**\n * Generates a motion atom object for a scale in or scale 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 outScale - Scale for the out state (exited). Defaults to 0.9.\n * @param inScale - Scale for the in state (entered). Defaults to 1.\n * @param delay - Time (ms) to delay the animation. Defaults to 0.\n * @returns A motion atom object with scale keyframes and the supplied duration and easing.\n */\nexport const scaleAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n delay = 0,\n outScale = 0.9,\n inScale = 1,\n}: ScaleAtomParams): AtomMotion => {\n const keyframes = [{ scale: outScale }, { scale: inScale }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n delay,\n };\n};\n"],"names":["motionTokens","scaleAtom","direction","duration","easing","curveLinear","delay","outScale","inScale","keyframes","scale","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAUlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,WAAW,GAAG,EACdC,UAAU,CAAC,EACK;IAChB,MAAMC,YAAY;QAAC;YAAEC,OAAOH;QAAS;QAAG;YAAEG,OAAOF;QAAQ;KAAE;IAC3D,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
|
package/lib/atoms/slide-atom.js
CHANGED
|
@@ -4,19 +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
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
7
|
+
* @param outX - X translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
8
|
+
* @param outY - Y translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.
|
|
9
|
+
* @param inX - X translate for the in state (entered) with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
10
|
+
* @param inY - Y translate for the in state (entered) with units (e.g., '5px', '10%'). Defaults to '0px'.
|
|
11
11
|
* @param delay - Time (ms) to delay the animation. Defaults to 0.
|
|
12
12
|
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
|
13
|
-
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0,
|
|
13
|
+
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outX = '0px', outY = '0px', inX = '0px', inY = '0px' })=>{
|
|
14
14
|
const keyframes = [
|
|
15
15
|
{
|
|
16
|
-
translate: `${
|
|
16
|
+
translate: `${outX} ${outY}`
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
translate: `${
|
|
19
|
+
translate: `${inX} ${inY}`
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
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
|
|
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 /** X translate for the out state (exited). Defaults to '0px'. */\n outX?: string;\n /** Y translate for the out state (exited). Defaults to '0px'. */\n outY?: string;\n /** X translate for the in state (entered). Defaults to '0px'. */\n inX?: string;\n /** Y translate for the in state (entered). Defaults to '0px'. */\n inY?: 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 outX - X translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.\n * @param outY - Y translate for the out state (exited) with units (e.g., '50px', '100%'). Defaults to '0px'.\n * @param inX - X translate for the in state (entered) with units (e.g., '5px', '10%'). Defaults to '0px'.\n * @param inY - Y translate for the in state (entered) 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 outX = '0px',\n outY = '0px',\n inX = '0px',\n inY = '0px',\n}: SlideAtomParams): AtomMotion => {\n const keyframes = [{ translate: `${outX} ${outY}` }, { translate: `${inX} ${inY}` }];\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","outX","outY","inX","inY","keyframes","translate","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAclE;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,OAAO,KAAK,EACZC,OAAO,KAAK,EACZC,MAAM,KAAK,EACXC,MAAM,KAAK,EACK;IAChB,MAAMC,YAAY;QAAC;YAAEC,WAAW,GAAGL,KAAK,CAAC,EAAEC,MAAM;QAAC;QAAG;YAAEI,WAAW,GAAGH,IAAI,CAAC,EAAEC,KAAK;QAAC;KAAE;IACpF,IAAIR,cAAc,QAAQ;QACxBS,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAR;QACAC;QACAE;IACF;AACF,EAAE"}
|
|
@@ -10,18 +10,18 @@ import { blurAtom } from '../../atoms/blur-atom';
|
|
|
10
10
|
* @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the `duration` param for symmetry.
|
|
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
|
-
* @param
|
|
14
|
-
* @param
|
|
13
|
+
* @param outRadius - Blur radius for the out state (exited). Defaults to `'10px'`.
|
|
14
|
+
* @param inRadius - Blur radius for the in state (entered). Defaults to `'0px'`.
|
|
15
15
|
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
|
16
|
-
*/ const blurPresenceFn = ({ duration = motionTokens.durationSlow, easing = motionTokens.curveDecelerateMin, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMin, exitDelay = delay,
|
|
16
|
+
*/ const blurPresenceFn = ({ duration = motionTokens.durationSlow, easing = motionTokens.curveDecelerateMin, delay = 0, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMin, exitDelay = delay, outRadius = '10px', inRadius = '0px', animateOpacity = true })=>{
|
|
17
17
|
const enterAtoms = [
|
|
18
18
|
blurAtom({
|
|
19
19
|
direction: 'enter',
|
|
20
20
|
duration,
|
|
21
21
|
easing,
|
|
22
22
|
delay,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
outRadius,
|
|
24
|
+
inRadius
|
|
25
25
|
})
|
|
26
26
|
];
|
|
27
27
|
const exitAtoms = [
|
|
@@ -30,8 +30,8 @@ import { blurAtom } from '../../atoms/blur-atom';
|
|
|
30
30
|
duration: exitDuration,
|
|
31
31
|
easing: exitEasing,
|
|
32
32
|
delay: exitDelay,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
outRadius,
|
|
34
|
+
inRadius
|
|
35
35
|
})
|
|
36
36
|
];
|
|
37
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
|
|
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 outRadius - Blur radius for the out state (exited). Defaults to `'10px'`.\n * @param inRadius - Blur radius for the in state (entered). 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 outRadius = '10px',\n inRadius = '0px',\n animateOpacity = true,\n}) => {\n const enterAtoms = [blurAtom({ direction: 'enter', duration, easing, delay, outRadius, inRadius })];\n const exitAtoms = [\n blurAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n outRadius,\n inRadius,\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","outRadius","inRadius","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,YAAY,MAAM,EAClBC,WAAW,KAAK,EAChBC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACd,SAAS;YAAEe,WAAW;YAASb;YAAUE;YAAQE;YAAOK;YAAWC;QAAS;KAAG;IACnG,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 /**
|
|
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 /** Blur radius for the out state (exited). Defaults to '10px'. */\n outRadius?: string;\n\n /** Blur radius for the in state (entered). Defaults to '0px'. */\n inRadius?: string;\n };\n"],"names":[],"mappings":"AAEA,WAOI"}
|
|
@@ -19,12 +19,12 @@ import { fadeAtom } from '../../atoms/fade-atom';
|
|
|
19
19
|
* @param exitOpacityDuration - Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing
|
|
20
20
|
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
|
|
21
21
|
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
|
|
22
|
-
* @param
|
|
22
|
+
* @param outSize - Size for the out state (collapsed). Defaults to `'0px'`
|
|
23
23
|
*/ const collapsePresenceFn = ({ element, // Primary duration controls (simple API)
|
|
24
24
|
duration = motionTokens.durationNormal, exitDuration = duration, // Granular duration controls with smart defaults (advanced API)
|
|
25
25
|
sizeDuration = duration, opacityDuration = sizeDuration, exitSizeDuration = exitDuration, exitOpacityDuration = exitSizeDuration, // Other timing controls
|
|
26
26
|
easing = motionTokens.curveEasyEaseMax, delay = 0, exitEasing = easing, exitDelay = delay, staggerDelay = 0, exitStaggerDelay = staggerDelay, // Animation controls
|
|
27
|
-
animateOpacity = true, orientation = 'vertical',
|
|
27
|
+
animateOpacity = true, orientation = 'vertical', outSize = '0px' })=>{
|
|
28
28
|
// ----- ENTER -----
|
|
29
29
|
// The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.
|
|
30
30
|
// For enter: size expands first, then opacity fades in after staggerDelay
|
|
@@ -35,7 +35,7 @@ animateOpacity = true, orientation = 'vertical', fromSize = '0px' })=>{
|
|
|
35
35
|
duration: sizeDuration,
|
|
36
36
|
easing,
|
|
37
37
|
element,
|
|
38
|
-
|
|
38
|
+
outSize,
|
|
39
39
|
delay
|
|
40
40
|
}),
|
|
41
41
|
whitespaceAtom({
|
|
@@ -74,7 +74,7 @@ animateOpacity = true, orientation = 'vertical', fromSize = '0px' })=>{
|
|
|
74
74
|
easing: exitEasing,
|
|
75
75
|
element,
|
|
76
76
|
delay: exitDelay + exitStaggerDelay,
|
|
77
|
-
|
|
77
|
+
outSize
|
|
78
78
|
}), whitespaceAtom({
|
|
79
79
|
direction: 'exit',
|
|
80
80
|
orientation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/Collapse.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n AtomMotion,\n} from '@fluentui/react-motion';\nimport type { CollapseParams } from './collapse-types';\nimport { sizeEnterAtom, sizeExitAtom, whitespaceAtom } from './collapse-atoms';\nimport { fadeAtom } from '../../atoms/fade-atom';\n\n/**\n * Define a presence motion for collapse/expand\n *\n * @param element - The element to apply the collapse motion to\n * @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)\n * @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value\n * @param delay - Time (ms) to delay the entire enter transition. Defaults to 0\n * @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry\n * @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry\n * @param exitDelay - Time (ms) to delay the entire exit transition. Defaults to the `delay` param for symmetry\n * @param staggerDelay - Time (ms) offset between the size and opacity animations. Defaults to 0\n * @param exitStaggerDelay - Time (ms) offset between the size and opacity animations on exit. Defaults to the `staggerDelay` param for symmetry\n * @param sizeDuration - Time (ms) for the size animation during enter. Defaults to `duration` for unified timing\n * @param opacityDuration - Time (ms) for the opacity animation during enter. Defaults to `sizeDuration` for synchronized timing\n * @param exitSizeDuration - Time (ms) for the size animation during exit. Defaults to `exitDuration` for unified timing\n * @param exitOpacityDuration - Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`\n * @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height\n * @param
|
|
1
|
+
{"version":3,"sources":["../src/components/Collapse/Collapse.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n AtomMotion,\n} from '@fluentui/react-motion';\nimport type { CollapseParams } from './collapse-types';\nimport { sizeEnterAtom, sizeExitAtom, whitespaceAtom } from './collapse-atoms';\nimport { fadeAtom } from '../../atoms/fade-atom';\n\n/**\n * Define a presence motion for collapse/expand\n *\n * @param element - The element to apply the collapse motion to\n * @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)\n * @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value\n * @param delay - Time (ms) to delay the entire enter transition. Defaults to 0\n * @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry\n * @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry\n * @param exitDelay - Time (ms) to delay the entire exit transition. Defaults to the `delay` param for symmetry\n * @param staggerDelay - Time (ms) offset between the size and opacity animations. Defaults to 0\n * @param exitStaggerDelay - Time (ms) offset between the size and opacity animations on exit. Defaults to the `staggerDelay` param for symmetry\n * @param sizeDuration - Time (ms) for the size animation during enter. Defaults to `duration` for unified timing\n * @param opacityDuration - Time (ms) for the opacity animation during enter. Defaults to `sizeDuration` for synchronized timing\n * @param exitSizeDuration - Time (ms) for the size animation during exit. Defaults to `exitDuration` for unified timing\n * @param exitOpacityDuration - Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`\n * @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height\n * @param outSize - Size for the out state (collapsed). Defaults to `'0px'`\n */\nconst collapsePresenceFn: PresenceMotionFn<CollapseParams> = ({\n element,\n // Primary duration controls (simple API)\n duration = motionTokens.durationNormal,\n exitDuration = duration,\n\n // Granular duration controls with smart defaults (advanced API)\n sizeDuration = duration,\n opacityDuration = sizeDuration,\n exitSizeDuration = exitDuration,\n exitOpacityDuration = exitSizeDuration,\n\n // Other timing controls\n easing = motionTokens.curveEasyEaseMax,\n delay = 0,\n exitEasing = easing,\n exitDelay = delay,\n staggerDelay = 0,\n exitStaggerDelay = staggerDelay,\n\n // Animation controls\n animateOpacity = true,\n orientation = 'vertical',\n outSize = '0px',\n}) => {\n // ----- ENTER -----\n // The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.\n // For enter: size expands first, then opacity fades in after staggerDelay\n const enterAtoms: AtomMotion[] = [\n // Apply global delay to size atom - size expansion starts first\n sizeEnterAtom({ orientation, duration: sizeDuration, easing, element, outSize, delay }),\n whitespaceAtom({ direction: 'enter', orientation, duration: sizeDuration, easing, delay }),\n ];\n // Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration: opacityDuration, easing, delay: delay + staggerDelay }));\n }\n\n // ----- EXIT -----\n // The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.\n // For exit: opacity fades out first, then size collapses after exitStaggerDelay\n const exitAtoms: AtomMotion[] = [];\n // Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n exitAtoms.push(\n fadeAtom({ direction: 'exit', duration: exitOpacityDuration, easing: exitEasing, delay: exitDelay }),\n );\n }\n\n exitAtoms.push(\n sizeExitAtom({\n orientation,\n duration: exitSizeDuration,\n easing: exitEasing,\n element,\n delay: exitDelay + exitStaggerDelay,\n outSize,\n }),\n whitespaceAtom({\n direction: 'exit',\n orientation,\n duration: exitSizeDuration,\n easing: exitEasing,\n delay: exitDelay + exitStaggerDelay, // Size/whitespace collapse after opacity finishes fading out\n }),\n );\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n/** A React component that applies collapse/expand transitions to its children. */\nexport const Collapse = createPresenceComponent(collapsePresenceFn);\n\nexport const CollapseSnappy = createPresenceComponentVariant(Collapse, {\n duration: motionTokens.durationFast,\n});\n\nexport const CollapseRelaxed = createPresenceComponentVariant(Collapse, {\n duration: motionTokens.durationSlower,\n});\n\n/** A React component that applies collapse/expand transitions with delayed fade to its children. */\nexport const CollapseDelayed = createPresenceComponentVariant(Collapse, {\n // Enter timing per motion design spec\n sizeDuration: motionTokens.durationNormal, // 200ms\n opacityDuration: motionTokens.durationSlower, // 400ms\n staggerDelay: motionTokens.durationNormal, // 200ms\n\n // Exit timing per motion design spec\n exitSizeDuration: motionTokens.durationNormal, // 200ms\n exitOpacityDuration: motionTokens.durationSlower, // 400ms\n exitStaggerDelay: motionTokens.durationSlower, // 400ms\n\n // Easing per motion design spec\n easing: motionTokens.curveEasyEase,\n exitEasing: motionTokens.curveEasyEase,\n});\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","sizeEnterAtom","sizeExitAtom","whitespaceAtom","fadeAtom","collapsePresenceFn","element","duration","durationNormal","exitDuration","sizeDuration","opacityDuration","exitSizeDuration","exitOpacityDuration","easing","curveEasyEaseMax","delay","exitEasing","exitDelay","staggerDelay","exitStaggerDelay","animateOpacity","orientation","outSize","enterAtoms","direction","push","exitAtoms","enter","exit","Collapse","CollapseSnappy","durationFast","CollapseRelaxed","durationSlower","CollapseDelayed","curveEasyEase"],"mappings":"AAAA,SACEA,YAAY,EACZC,uBAAuB,EAEvBC,8BAA8B,QAEzB,yBAAyB;AAEhC,SAASC,aAAa,EAAEC,YAAY,EAAEC,cAAc,QAAQ,mBAAmB;AAC/E,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD;;;;;;;;;;;;;;;;;;;CAmBC,GACD,MAAMC,qBAAuD,CAAC,EAC5DC,OAAO,EACP,yCAAyC;AACzCC,WAAWT,aAAaU,cAAc,EACtCC,eAAeF,QAAQ,EAEvB,gEAAgE;AAChEG,eAAeH,QAAQ,EACvBI,kBAAkBD,YAAY,EAC9BE,mBAAmBH,YAAY,EAC/BI,sBAAsBD,gBAAgB,EAEtC,wBAAwB;AACxBE,SAAShB,aAAaiB,gBAAgB,EACtCC,QAAQ,CAAC,EACTC,aAAaH,MAAM,EACnBI,YAAYF,KAAK,EACjBG,eAAe,CAAC,EAChBC,mBAAmBD,YAAY,EAE/B,qBAAqB;AACrBE,iBAAiB,IAAI,EACrBC,cAAc,UAAU,EACxBC,UAAU,KAAK,EAChB;IACC,oBAAoB;IACpB,0FAA0F;IAC1F,0EAA0E;IAC1E,MAAMC,aAA2B;QAC/B,gEAAgE;QAChEvB,cAAc;YAAEqB;YAAaf,UAAUG;YAAcI;YAAQR;YAASiB;YAASP;QAAM;QACrFb,eAAe;YAAEsB,WAAW;YAASH;YAAaf,UAAUG;YAAcI;YAAQE;QAAM;KACzF;IACD,+EAA+E;IAC/E,IAAIK,gBAAgB;QAClBG,WAAWE,IAAI,CAACtB,SAAS;YAAEqB,WAAW;YAASlB,UAAUI;YAAiBG;YAAQE,OAAOA,QAAQG;QAAa;IAChH;IAEA,mBAAmB;IACnB,yFAAyF;IACzF,gFAAgF;IAChF,MAAMQ,YAA0B,EAAE;IAClC,gFAAgF;IAChF,IAAIN,gBAAgB;QAClBM,UAAUD,IAAI,CACZtB,SAAS;YAAEqB,WAAW;YAAQlB,UAAUM;YAAqBC,QAAQG;YAAYD,OAAOE;QAAU;IAEtG;IAEAS,UAAUD,IAAI,CACZxB,aAAa;QACXoB;QACAf,UAAUK;QACVE,QAAQG;QACRX;QACAU,OAAOE,YAAYE;QACnBG;IACF,IACApB,eAAe;QACbsB,WAAW;QACXH;QACAf,UAAUK;QACVE,QAAQG;QACRD,OAAOE,YAAYE;IACrB;IAGF,OAAO;QACLQ,OAAOJ;QACPK,MAAMF;IACR;AACF;AAEA,gFAAgF,GAChF,OAAO,MAAMG,WAAW/B,wBAAwBM,oBAAoB;AAEpE,OAAO,MAAM0B,iBAAiB/B,+BAA+B8B,UAAU;IACrEvB,UAAUT,aAAakC,YAAY;AACrC,GAAG;AAEH,OAAO,MAAMC,kBAAkBjC,+BAA+B8B,UAAU;IACtEvB,UAAUT,aAAaoC,cAAc;AACvC,GAAG;AAEH,kGAAkG,GAClG,OAAO,MAAMC,kBAAkBnC,+BAA+B8B,UAAU;IACtE,sCAAsC;IACtCpB,cAAcZ,aAAaU,cAAc;IACzCG,iBAAiBb,aAAaoC,cAAc;IAC5Cf,cAAcrB,aAAaU,cAAc;IAEzC,qCAAqC;IACrCI,kBAAkBd,aAAaU,cAAc;IAC7CK,qBAAqBf,aAAaoC,cAAc;IAChDd,kBAAkBtB,aAAaoC,cAAc;IAE7C,gCAAgC;IAChCpB,QAAQhB,aAAasC,aAAa;IAClCnB,YAAYnB,aAAasC,aAAa;AACxC,GAAG"}
|