@fluentui/react-motion-components-preview 0.0.0-nightly-20260107-0408.1 → 0.0.0-nightly-20260109-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.
Files changed (57) hide show
  1. package/CHANGELOG.md +6 -6
  2. package/dist/index.d.ts +67 -57
  3. package/lib/atoms/blur-atom.js +5 -5
  4. package/lib/atoms/blur-atom.js.map +1 -1
  5. package/lib/atoms/fade-atom.js +5 -5
  6. package/lib/atoms/fade-atom.js.map +1 -1
  7. package/lib/atoms/rotate-atom.js +5 -5
  8. package/lib/atoms/rotate-atom.js.map +1 -1
  9. package/lib/atoms/scale-atom.js +5 -5
  10. package/lib/atoms/scale-atom.js.map +1 -1
  11. package/lib/atoms/slide-atom.js +7 -7
  12. package/lib/atoms/slide-atom.js.map +1 -1
  13. package/lib/components/Blur/Blur.js +7 -7
  14. package/lib/components/Blur/Blur.js.map +1 -1
  15. package/lib/components/Blur/blur-types.js.map +1 -1
  16. package/lib/components/Collapse/Collapse.js +4 -4
  17. package/lib/components/Collapse/Collapse.js.map +1 -1
  18. package/lib/components/Collapse/collapse-atoms.js +4 -4
  19. package/lib/components/Collapse/collapse-atoms.js.map +1 -1
  20. package/lib/components/Collapse/collapse-types.js.map +1 -1
  21. package/lib/components/Fade/Fade.js +7 -7
  22. package/lib/components/Fade/Fade.js.map +1 -1
  23. package/lib/components/Fade/fade-types.js.map +1 -1
  24. package/lib/components/Rotate/Rotate.js +7 -7
  25. package/lib/components/Rotate/Rotate.js.map +1 -1
  26. package/lib/components/Rotate/rotate-types.js.map +1 -1
  27. package/lib/components/Scale/Scale.js +7 -7
  28. package/lib/components/Scale/Scale.js.map +1 -1
  29. package/lib/components/Scale/scale-types.js.map +1 -1
  30. package/lib/components/Slide/Slide.js +13 -13
  31. package/lib/components/Slide/Slide.js.map +1 -1
  32. package/lib/components/Slide/slide-types.js.map +1 -1
  33. package/lib-commonjs/atoms/blur-atom.js +3 -3
  34. package/lib-commonjs/atoms/blur-atom.js.map +1 -1
  35. package/lib-commonjs/atoms/fade-atom.js +3 -3
  36. package/lib-commonjs/atoms/fade-atom.js.map +1 -1
  37. package/lib-commonjs/atoms/rotate-atom.js +3 -3
  38. package/lib-commonjs/atoms/rotate-atom.js.map +1 -1
  39. package/lib-commonjs/atoms/scale-atom.js +3 -3
  40. package/lib-commonjs/atoms/scale-atom.js.map +1 -1
  41. package/lib-commonjs/atoms/slide-atom.js +3 -3
  42. package/lib-commonjs/atoms/slide-atom.js.map +1 -1
  43. package/lib-commonjs/components/Blur/Blur.js +7 -7
  44. package/lib-commonjs/components/Blur/Blur.js.map +1 -1
  45. package/lib-commonjs/components/Collapse/Collapse.js +4 -4
  46. package/lib-commonjs/components/Collapse/Collapse.js.map +1 -1
  47. package/lib-commonjs/components/Collapse/collapse-atoms.js +4 -4
  48. package/lib-commonjs/components/Collapse/collapse-atoms.js.map +1 -1
  49. package/lib-commonjs/components/Fade/Fade.js +5 -5
  50. package/lib-commonjs/components/Fade/Fade.js.map +1 -1
  51. package/lib-commonjs/components/Rotate/Rotate.js +7 -7
  52. package/lib-commonjs/components/Rotate/Rotate.js.map +1 -1
  53. package/lib-commonjs/components/Scale/Scale.js +7 -7
  54. package/lib-commonjs/components/Scale/Scale.js.map +1 -1
  55. package/lib-commonjs/components/Slide/Slide.js +13 -13
  56. package/lib-commonjs/components/Slide/Slide.js.map +1 -1
  57. 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 Wed, 07 Jan 2026 04:23:02 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 09 Jan 2026 04:21:16 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20260107-0408.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20260107-0408.1)
7
+ ## [0.0.0-nightly-20260109-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20260109-0406.1)
8
8
 
9
- Wed, 07 Jan 2026 04:23:02 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-20260107-0408.1)
9
+ Fri, 09 Jan 2026 04:21:16 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-20260109-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-20260107-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/75336894f73db3313297e6ed46a89e63a6e001a7) by beachball)
16
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20260107-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/75336894f73db3313297e6ed46a89e63a6e001a7) by beachball)
15
+ - Bump @fluentui/react-motion to v0.0.0-nightly-20260109-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/6b02cd49b3424ef75f31d84a4046598222f63e65) by beachball)
16
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20260109-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/6b02cd49b3424ef75f31d84a4046598222f63e65) 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 fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '10px'.
47
- * @param toRadius - The ending blur radius value with units (e.g., '0px', '5px'). Defaults to '0px'.
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, fromRadius, toRadius, }: BlurAtomParams) => AtomMotion;
51
+ export declare const blurAtom: ({ direction, duration, easing, delay, outRadius, inRadius, }: BlurAtomParams) => AtomMotion;
52
52
 
53
53
  declare interface BlurAtomParams extends BaseAtomParams {
54
- fromRadius?: string;
55
- toRadius?: string;
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
- /** The blur radius with units to animate from. Defaults to '10px'. */
60
- fromRadius?: string;
61
- /** The blur radius with units to animate to. Defaults to '0px'. */
62
- toRadius?: string;
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
- /** The starting size for the expand animation. Defaults to `'0px'`. */
91
- fromSize?: string;
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 fromOpacity - The starting opacity value. Defaults to 0.
118
- * @param toOpacity - The ending opacity value. Defaults to 1.
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, fromOpacity, toOpacity, }: FadeAtomParams) => AtomMotion;
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
- /** The starting opacity value. Defaults to 0. */
127
- fromOpacity?: number;
128
- /** The ending opacity value. Defaults to 1. */
129
- toOpacity?: number;
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
- /** The starting opacity value. Defaults to 0. */
134
- fromOpacity?: number;
135
- /** The ending opacity value. Defaults to 1. */
136
- toOpacity?: number;
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 fromAngle - The starting rotation angle in degrees. Defaults to -90.
182
- * @param toAngle - The ending rotation angle in degrees. Defaults to 0.
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, fromAngle, toAngle, }: RotateAtomParams) => AtomMotion;
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
- fromAngle?: number;
191
- toAngle?: number;
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
- * The starting rotation angle in degrees.
205
+ * Rotation angle for the out state (exited) in degrees.
202
206
  * Defaults to -90.
203
207
  */
204
- fromAngle?: number;
208
+ outAngle?: number;
205
209
  /**
206
- * The ending rotation angle in degrees.
210
+ * Rotation angle for the in state (entered) in degrees.
207
211
  * Defaults to 0.
208
212
  */
209
- toAngle?: number;
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 fromScale - The starting scale value. Defaults to 0.9.
221
- * @param toScale - The ending scale value. Defaults to 1.
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, fromScale, toScale, }: ScaleAtomParams) => AtomMotion;
229
+ export declare const scaleAtom: ({ direction, duration, easing, delay, outScale, inScale, }: ScaleAtomParams) => AtomMotion;
226
230
 
227
231
  declare interface ScaleAtomParams extends BaseAtomParams {
228
- fromScale?: number;
229
- toScale?: number;
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
- /** The scale value to animate from. Defaults to `0.9`. */
234
- fromScale?: number;
235
- /** The scale value to animate to. Defaults to `1`. */
236
- toScale?: number;
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 fromX - The starting X translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
252
- * @param fromY - The starting Y translate value with units (e.g., '50px', '100%'). Defaults to '0px'.
253
- * @param toX - The ending X translate value with units (e.g.'5px', '10%'). Defaults to '0px'.
254
- * @param toY - The ending Y translate value with units (e.g., '5px', '10%'). Defaults to '0px'.
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, fromX, fromY, toX, toY, }: SlideAtomParams) => AtomMotion;
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
- fromX?: string;
262
- fromY?: string;
263
- toX?: string;
264
- toY?: string;
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
- /** The X translate value with units to animate from. Defaults to `'0px'`. */
269
- fromX?: string;
270
- /** The Y translate value with units to animate from. Defaults to `'20px'`. */
271
- fromY?: string;
272
- /** The X translate value with units to animate to. Defaults to `'0px'`. */
273
- toX?: string;
274
- /** The Y translate value with units to animate to. Defaults to `'0px'`. */
275
- toY?: string;
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>;
@@ -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 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'.
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, fromRadius = '10px', toRadius = '0px' })=>{
11
+ */ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outRadius = '10px', inRadius = '0px' })=>{
12
12
  const keyframes = [
13
13
  {
14
- filter: `blur(${fromRadius})`
14
+ filter: `blur(${outRadius})`
15
15
  },
16
16
  {
17
- filter: `blur(${toRadius})`
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 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"}
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"}
@@ -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 fromOpacity - The starting opacity value. Defaults to 0.
9
- * @param toOpacity - The ending opacity value. Defaults to 1.
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, fromOpacity = 0, toOpacity = 1 })=>{
11
+ */ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outOpacity = 0, inOpacity = 1 })=>{
12
12
  const keyframes = [
13
13
  {
14
- opacity: fromOpacity
14
+ opacity: outOpacity
15
15
  },
16
16
  {
17
- opacity: toOpacity
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 /** 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"}
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"}
@@ -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 fromAngle - The starting rotation angle in degrees. Defaults to -90.
12
- * @param toAngle - The ending rotation angle in degrees. Defaults to 0.
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', fromAngle = -90, toAngle = 0 })=>{
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, fromAngle)
18
+ rotate: createRotateValue(axis, outAngle)
19
19
  },
20
20
  {
21
- rotate: createRotateValue(axis, toAngle)
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 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"}
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"}
@@ -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 fromScale - The starting scale value. Defaults to 0.9.
8
- * @param toScale - The ending scale value. Defaults to 1.
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, fromScale = 0.9, toScale = 1 })=>{
11
+ */ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear, delay = 0, outScale = 0.9, inScale = 1 })=>{
12
12
  const keyframes = [
13
13
  {
14
- scale: fromScale
14
+ scale: outScale
15
15
  },
16
16
  {
17
- scale: toScale
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 fromScale?: number;\n toScale?: 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 fromScale - The starting scale value. Defaults to 0.9.\n * @param toScale - The ending scale value. 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 fromScale = 0.9,\n toScale = 1,\n}: ScaleAtomParams): AtomMotion => {\n const keyframes = [{ scale: fromScale }, { scale: toScale }];\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","fromScale","toScale","keyframes","scale","reverse"],"mappings":"AAAA,SAAqBA,YAAY,QAAQ,yBAAyB;AAQlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,CAAC,EACTC,YAAY,GAAG,EACfC,UAAU,CAAC,EACK;IAChB,MAAMC,YAAY;QAAC;YAAEC,OAAOH;QAAU;QAAG;YAAEG,OAAOF;QAAQ;KAAE;IAC5D,IAAIN,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;QACAE;IACF;AACF,EAAE"}
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"}
@@ -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 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'.
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, fromX = '0px', fromY = '0px', toX = '0px', toY = '0px' })=>{
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: `${fromX} ${fromY}`
16
+ translate: `${outX} ${outY}`
17
17
  },
18
18
  {
19
- translate: `${toX} ${toY}`
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 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"}
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 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'`.
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, fromRadius = '10px', toRadius = '0px', animateOpacity = true })=>{
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
- fromRadius,
24
- toRadius
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
- fromRadius,
34
- toRadius
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 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
+ {"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 /** 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"}
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 fromSize - The starting size for the expand animation. Defaults to `'0px'`
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', fromSize = '0px' })=>{
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
- fromSize,
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
- fromSize
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 fromSize - The starting size for the expand animation. 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 fromSize = '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, fromSize, 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 fromSize,\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","fromSize","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,WAAW,KAAK,EACjB;IACC,oBAAoB;IACpB,0FAA0F;IAC1F,0EAA0E;IAC1E,MAAMC,aAA2B;QAC/B,gEAAgE;QAChEvB,cAAc;YAAEqB;YAAaf,UAAUG;YAAcI;YAAQR;YAASiB;YAAUP;QAAM;QACtFb,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"}
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"}