@fluentui/react-motion-components-preview 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +16 -7
  2. package/README.md +90 -2
  3. package/dist/index.d.cts +407 -0
  4. package/dist/index.d.ts +2 -2
  5. package/lib/atoms/blur-atom.js +1 -1
  6. package/lib/atoms/blur-atom.js.map +1 -1
  7. package/lib/atoms/fade-atom.js +1 -1
  8. package/lib/atoms/fade-atom.js.map +1 -1
  9. package/lib/atoms/rotate-atom.js +1 -1
  10. package/lib/atoms/rotate-atom.js.map +1 -1
  11. package/lib/atoms/scale-atom.js +1 -1
  12. package/lib/atoms/scale-atom.js.map +1 -1
  13. package/lib/atoms/slide-atom.js +1 -1
  14. package/lib/atoms/slide-atom.js.map +1 -1
  15. package/lib/choreography/Stagger/Stagger.js +3 -3
  16. package/lib/choreography/Stagger/Stagger.js.map +1 -1
  17. package/lib/choreography/Stagger/index.js +1 -1
  18. package/lib/choreography/Stagger/index.js.map +1 -1
  19. package/lib/choreography/Stagger/stagger-types.js +1 -1
  20. package/lib/choreography/Stagger/stagger-types.js.map +1 -1
  21. package/lib/choreography/Stagger/useStaggerItemsVisibility.js +4 -3
  22. package/lib/choreography/Stagger/useStaggerItemsVisibility.js.map +1 -1
  23. package/lib/choreography/Stagger/utils/constants.js +1 -1
  24. package/lib/choreography/Stagger/utils/getStaggerChildMapping.js +1 -1
  25. package/lib/choreography/Stagger/utils/index.js +4 -4
  26. package/lib/choreography/Stagger/utils/index.js.map +1 -1
  27. package/lib/choreography/Stagger/utils/motionComponentDetection.js +15 -6
  28. package/lib/choreography/Stagger/utils/motionComponentDetection.js.map +1 -1
  29. package/lib/choreography/Stagger/utils/stagger-calculations.js +1 -1
  30. package/lib/choreography/Stagger/utils/stagger-calculations.js.map +1 -1
  31. package/lib/components/Blur/Blur.js +3 -3
  32. package/lib/components/Blur/Blur.js.map +1 -1
  33. package/lib/components/Blur/index.js +1 -1
  34. package/lib/components/Blur/index.js.map +1 -1
  35. package/lib/components/Collapse/Collapse.js +3 -3
  36. package/lib/components/Collapse/Collapse.js.map +1 -1
  37. package/lib/components/Collapse/collapse-atoms.js.map +1 -1
  38. package/lib/components/Collapse/index.js +1 -1
  39. package/lib/components/Collapse/index.js.map +1 -1
  40. package/lib/components/Fade/Fade.js +2 -2
  41. package/lib/components/Fade/Fade.js.map +1 -1
  42. package/lib/components/Fade/index.js +1 -1
  43. package/lib/components/Fade/index.js.map +1 -1
  44. package/lib/components/Rotate/Rotate.js +3 -3
  45. package/lib/components/Rotate/Rotate.js.map +1 -1
  46. package/lib/components/Rotate/index.js +1 -1
  47. package/lib/components/Rotate/index.js.map +1 -1
  48. package/lib/components/Scale/Scale.js +3 -3
  49. package/lib/components/Scale/Scale.js.map +1 -1
  50. package/lib/components/Scale/index.js +1 -1
  51. package/lib/components/Scale/index.js.map +1 -1
  52. package/lib/components/Slide/Slide.js +3 -3
  53. package/lib/components/Slide/Slide.js.map +1 -1
  54. package/lib/components/Slide/index.js +1 -1
  55. package/lib/components/Slide/index.js.map +1 -1
  56. package/lib/index.js +12 -12
  57. package/lib/index.js.map +1 -1
  58. package/lib-commonjs/atoms/blur-atom.cjs.map +1 -0
  59. package/lib-commonjs/atoms/fade-atom.cjs.map +1 -0
  60. package/lib-commonjs/atoms/rotate-atom.cjs.map +1 -0
  61. package/lib-commonjs/atoms/scale-atom.cjs.map +1 -0
  62. package/lib-commonjs/atoms/slide-atom.cjs.map +1 -0
  63. package/lib-commonjs/choreography/Stagger/{Stagger.js → Stagger.cjs} +2 -2
  64. package/lib-commonjs/choreography/Stagger/Stagger.cjs.map +1 -0
  65. package/lib-commonjs/choreography/Stagger/{index.js → index.cjs} +1 -1
  66. package/lib-commonjs/choreography/Stagger/{useStaggerItemsVisibility.js → useStaggerItemsVisibility.cjs} +2 -1
  67. package/lib-commonjs/choreography/Stagger/useStaggerItemsVisibility.cjs.map +1 -0
  68. package/lib-commonjs/choreography/Stagger/utils/{index.js → index.cjs} +4 -4
  69. package/lib-commonjs/choreography/Stagger/utils/{motionComponentDetection.js → motionComponentDetection.cjs} +0 -2
  70. package/lib-commonjs/choreography/Stagger/utils/motionComponentDetection.cjs.map +1 -0
  71. package/lib-commonjs/choreography/Stagger/utils/{stagger-calculations.js → stagger-calculations.cjs} +1 -1
  72. package/lib-commonjs/components/Blur/{Blur.js → Blur.cjs} +2 -2
  73. package/lib-commonjs/components/Blur/Blur.cjs.map +1 -0
  74. package/lib-commonjs/components/Blur/{index.js → index.cjs} +1 -1
  75. package/lib-commonjs/components/Collapse/{Collapse.js → Collapse.cjs} +2 -2
  76. package/lib-commonjs/components/Collapse/Collapse.cjs.map +1 -0
  77. package/lib-commonjs/components/Collapse/collapse-atoms.cjs.map +1 -0
  78. package/lib-commonjs/components/Collapse/{index.js → index.cjs} +1 -1
  79. package/lib-commonjs/components/Fade/{Fade.js → Fade.cjs} +1 -1
  80. package/lib-commonjs/components/Fade/Fade.cjs.map +1 -0
  81. package/lib-commonjs/components/Fade/{index.js → index.cjs} +1 -1
  82. package/lib-commonjs/components/Rotate/{Rotate.js → Rotate.cjs} +2 -2
  83. package/lib-commonjs/components/Rotate/Rotate.cjs.map +1 -0
  84. package/lib-commonjs/components/Rotate/{index.js → index.cjs} +1 -1
  85. package/lib-commonjs/components/Scale/{Scale.js → Scale.cjs} +2 -2
  86. package/lib-commonjs/components/Scale/Scale.cjs.map +1 -0
  87. package/lib-commonjs/components/Scale/{index.js → index.cjs} +1 -1
  88. package/lib-commonjs/components/Slide/{Slide.js → Slide.cjs} +2 -2
  89. package/lib-commonjs/components/Slide/Slide.cjs.map +1 -0
  90. package/lib-commonjs/components/Slide/{index.js → index.cjs} +1 -1
  91. package/lib-commonjs/{index.js → index.cjs} +12 -12
  92. package/lib-commonjs/types.cjs +4 -0
  93. package/lib-commonjs/types.cjs.map +1 -0
  94. package/package.json +15 -9
  95. package/lib-commonjs/atoms/blur-atom.js.map +0 -1
  96. package/lib-commonjs/atoms/fade-atom.js.map +0 -1
  97. package/lib-commonjs/atoms/rotate-atom.js.map +0 -1
  98. package/lib-commonjs/atoms/scale-atom.js.map +0 -1
  99. package/lib-commonjs/atoms/slide-atom.js.map +0 -1
  100. package/lib-commonjs/choreography/Stagger/Stagger.js.map +0 -1
  101. package/lib-commonjs/choreography/Stagger/stagger-types.js +0 -6
  102. package/lib-commonjs/choreography/Stagger/stagger-types.js.map +0 -1
  103. package/lib-commonjs/choreography/Stagger/useStaggerItemsVisibility.js.map +0 -1
  104. package/lib-commonjs/choreography/Stagger/utils/motionComponentDetection.js.map +0 -1
  105. package/lib-commonjs/components/Blur/Blur.js.map +0 -1
  106. package/lib-commonjs/components/Collapse/Collapse.js.map +0 -1
  107. package/lib-commonjs/components/Collapse/collapse-atoms.js.map +0 -1
  108. package/lib-commonjs/components/Fade/Fade.js.map +0 -1
  109. package/lib-commonjs/components/Rotate/Rotate.js.map +0 -1
  110. package/lib-commonjs/components/Scale/Scale.js.map +0 -1
  111. package/lib-commonjs/components/Slide/Slide.js.map +0 -1
  112. /package/lib-commonjs/atoms/{blur-atom.js → blur-atom.cjs} +0 -0
  113. /package/lib-commonjs/atoms/{fade-atom.js → fade-atom.cjs} +0 -0
  114. /package/lib-commonjs/atoms/{rotate-atom.js → rotate-atom.cjs} +0 -0
  115. /package/lib-commonjs/atoms/{scale-atom.js → scale-atom.cjs} +0 -0
  116. /package/lib-commonjs/atoms/{slide-atom.js → slide-atom.cjs} +0 -0
  117. /package/lib-commonjs/choreography/Stagger/{index.js.map → index.cjs.map} +0 -0
  118. /package/lib-commonjs/{components/Blur/blur-types.js → choreography/Stagger/stagger-types.cjs} +0 -0
  119. /package/lib-commonjs/{components/Blur/blur-types.js.map → choreography/Stagger/stagger-types.cjs.map} +0 -0
  120. /package/lib-commonjs/choreography/Stagger/utils/{constants.js → constants.cjs} +0 -0
  121. /package/lib-commonjs/choreography/Stagger/utils/{constants.js.map → constants.cjs.map} +0 -0
  122. /package/lib-commonjs/choreography/Stagger/utils/{getStaggerChildMapping.js → getStaggerChildMapping.cjs} +0 -0
  123. /package/lib-commonjs/choreography/Stagger/utils/{getStaggerChildMapping.js.map → getStaggerChildMapping.cjs.map} +0 -0
  124. /package/lib-commonjs/choreography/Stagger/utils/{index.js.map → index.cjs.map} +0 -0
  125. /package/lib-commonjs/choreography/Stagger/utils/{stagger-calculations.js.map → stagger-calculations.cjs.map} +0 -0
  126. /package/lib-commonjs/components/{Collapse/collapse-types.js → Blur/blur-types.cjs} +0 -0
  127. /package/lib-commonjs/components/{Collapse/collapse-types.js.map → Blur/blur-types.cjs.map} +0 -0
  128. /package/lib-commonjs/components/Blur/{index.js.map → index.cjs.map} +0 -0
  129. /package/lib-commonjs/components/Collapse/{collapse-atoms.js → collapse-atoms.cjs} +0 -0
  130. /package/lib-commonjs/components/Collapse/{collapse-test-utils.js → collapse-test-utils.cjs} +0 -0
  131. /package/lib-commonjs/components/Collapse/{collapse-test-utils.js.map → collapse-test-utils.cjs.map} +0 -0
  132. /package/lib-commonjs/components/{Fade/fade-types.js → Collapse/collapse-types.cjs} +0 -0
  133. /package/lib-commonjs/components/{Fade/fade-types.js.map → Collapse/collapse-types.cjs.map} +0 -0
  134. /package/lib-commonjs/components/Collapse/{index.js.map → index.cjs.map} +0 -0
  135. /package/lib-commonjs/components/{Rotate/rotate-types.js → Fade/fade-types.cjs} +0 -0
  136. /package/lib-commonjs/components/{Rotate/rotate-types.js.map → Fade/fade-types.cjs.map} +0 -0
  137. /package/lib-commonjs/components/Fade/{index.js.map → index.cjs.map} +0 -0
  138. /package/lib-commonjs/components/Rotate/{index.js.map → index.cjs.map} +0 -0
  139. /package/lib-commonjs/components/{Scale/scale-types.js → Rotate/rotate-types.cjs} +0 -0
  140. /package/lib-commonjs/components/{Scale/scale-types.js.map → Rotate/rotate-types.cjs.map} +0 -0
  141. /package/lib-commonjs/components/Scale/{index.js.map → index.cjs.map} +0 -0
  142. /package/lib-commonjs/components/{Slide/slide-types.js → Scale/scale-types.cjs} +0 -0
  143. /package/lib-commonjs/components/{Slide/slide-types.js.map → Scale/scale-types.cjs.map} +0 -0
  144. /package/lib-commonjs/components/Slide/{index.js.map → index.cjs.map} +0 -0
  145. /package/lib-commonjs/{types.js → components/Slide/slide-types.cjs} +0 -0
  146. /package/lib-commonjs/{types.js.map → components/Slide/slide-types.cjs.map} +0 -0
  147. /package/lib-commonjs/{index.js.map → index.cjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,19 +1,28 @@
1
1
  # Change Log - @fluentui/react-motion-components-preview
2
2
 
3
- This log was last generated on Thu, 22 Jan 2026 16:12:40 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Jul 2026 17:34:11 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.72.9-experimental.component-base-hooks.20260122-49fc330360.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
7
+ ## [9.74.3-experimental.esm.20260709-49ee7a20cf.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
8
8
 
9
- Thu, 22 Jan 2026 16:12:40 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.14.1..@fluentui/react-motion-components-preview_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
9
+ Thu, 09 Jul 2026 17:34:11 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.15.5..@fluentui/react-motion-components-preview_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release 9.72.9-experimental.component-base-hooks.20260122-49fc330360 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-motion to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
16
- - Bump @fluentui/react-utilities to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
14
+ - Release 9.74.3-experimental.esm.20260709-49ee7a20cf ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+ - Bump @fluentui/react-motion to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
17
+
18
+ ## [0.15.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.15.0)
19
+
20
+ Thu, 22 Jan 2026 17:06:32 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.14.1..@fluentui/react-motion-components-preview_v0.15.0)
22
+
23
+ ### Minor changes
24
+
25
+ - refactor(motion-components): improve parameter naming from 'from/to' to 'out/in' ([PR #35592](https://github.com/microsoft/fluentui/pull/35592) by robertpenner@microsoft.com)
17
26
 
18
27
  ## [0.14.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.14.0)
19
28
 
package/README.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # @fluentui/react-motion-components-preview
2
2
 
3
- **React Motion Components for [Fluent UI React](https://react.fluentui.dev/)**
3
+ **Pre-built Motion Components for [Fluent UI React](https://react.fluentui.dev/)**
4
4
 
5
- These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
5
+ > ⚠️ **Preview Package**: These components are in beta and APIs may change before stable release.
6
+
7
+ Ready-to-use presence components for common UI animation patterns, built on top of `@fluentui/react-motion`.
8
+
9
+ ## Components
10
+
11
+ | Component | Description |
12
+ | ------------ | ---------------------------------------------------------- |
13
+ | **Fade** | Opacity transitions for tooltips, notifications, overlays |
14
+ | **Scale** | Size animations for popovers, menus, emphasis |
15
+ | **Collapse** | Height/width expansion for accordions, expandable sections |
16
+ | **Slide** | Directional movement for drawers, panels, carousels |
17
+ | **Blur** | Focus/defocus effects for backgrounds, depth |
18
+ | **Rotate** | 3D rotation for card flips, reveals |
19
+ | **Stagger** | Choreography for sequential list animations |
20
+
21
+ Each component (except Blur and Rotate) comes with **Snappy** (150ms) and **Relaxed** (250ms) timing variants.
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ npm install @fluentui/react-motion-components-preview
27
+ # or
28
+ yarn add @fluentui/react-motion-components-preview
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```tsx
34
+ import { Fade, Scale, Slide, Collapse } from '@fluentui/react-motion-components-preview';
35
+
36
+ // Simple fade
37
+ function Tooltip({ visible, children }) {
38
+ return (
39
+ <Fade visible={visible}>
40
+ {children}
41
+ </Fade>
42
+ );
43
+ }
44
+
45
+ // Slide from the right
46
+ function Drawer({ open, children }) {
47
+ return (
48
+ <Slide visible={open} outX="20px">
49
+ {children}
50
+ </Slide>
51
+ );
52
+ }
53
+
54
+ // Use timing variants
55
+ import { FadeSnappy, ScaleRelaxed } from '@fluentui/react-motion-components-preview';
56
+
57
+ <FadeSnappy visible={show}>Quick feedback</FadeSnappy>
58
+ <ScaleRelaxed visible={show}>Smooth entrance</ScaleRelaxed>
59
+ ```
60
+
61
+ ### The `.In` and `.Out` Pattern
62
+
63
+ Every presence component includes one-way sub-components:
64
+
65
+ ```tsx
66
+ // One-way enter animation (plays on mount)
67
+ <Fade.In>
68
+ <div>Fades in once</div>
69
+ </Fade.In>
70
+
71
+ // One-way exit animation (plays on mount)
72
+ <Fade.Out>
73
+ <div>Fades out once</div>
74
+ </Fade.Out>
75
+ ```
76
+
77
+ ## Documentation
78
+
79
+ 📚 **[Full documentation](https://react.fluentui.dev/?path=/docs/motion-components-preview-introduction--docs)**
80
+
81
+ - [Introduction](https://react.fluentui.dev/?path=/docs/motion-components-preview-introduction--docs) — Overview of all components
82
+ - [Fade](https://react.fluentui.dev/?path=/docs/motion-components-preview-fade--docs)
83
+ - [Scale](https://react.fluentui.dev/?path=/docs/motion-components-preview-scale--docs)
84
+ - [Collapse](https://react.fluentui.dev/?path=/docs/motion-components-preview-collapse--docs)
85
+ - [Slide](https://react.fluentui.dev/?path=/docs/motion-components-preview-slide--docs)
86
+ - [Blur](https://react.fluentui.dev/?path=/docs/motion-components-preview-blur--docs)
87
+ - [Rotate](https://react.fluentui.dev/?path=/docs/motion-components-preview-rotate--docs)
88
+ - [Stagger](https://react.fluentui.dev/?path=/docs/motion-choreography-preview-stagger--docs)
89
+ - [Motion Atoms](https://react.fluentui.dev/?path=/docs/motion-components-preview-atoms--docs) — Building blocks for custom components
90
+
91
+ ## Related
92
+
93
+ - **[@fluentui/react-motion](https://www.npmjs.com/package/@fluentui/react-motion)** — Core motion APIs for creating custom animations
@@ -0,0 +1,407 @@
1
+ import type { AtomMotion } from '@fluentui/react-motion';
2
+ import { PresenceComponent } from '@fluentui/react-motion';
3
+ import type { PresenceComponentProps } from '@fluentui/react-motion';
4
+ import type { PresenceDirection } from '@fluentui/react-motion';
5
+ import * as React_2 from 'react';
6
+
7
+ /**
8
+ * Common opacity animation parameter for motion components.
9
+ */
10
+ declare type AnimateOpacity = {
11
+ /** Whether to animate the opacity. Defaults to `true`. */
12
+ animateOpacity?: boolean;
13
+ };
14
+
15
+ declare type Axis3D = 'x' | 'y' | 'z';
16
+
17
+ declare type Axis3D_2 = NonNullable<RotateParams['axis']>;
18
+
19
+ /**
20
+ * Common parameters shared by all atom functions.
21
+ */
22
+ declare type BaseAtomParams = {
23
+ /** The functional direction of the motion: 'enter' or 'exit'. */
24
+ direction: PresenceDirection;
25
+ /** The duration of the motion in milliseconds. */
26
+ duration: number;
27
+ /** The easing curve for the motion. */
28
+ easing?: EffectTiming['easing'];
29
+ /** Time (ms) to delay the animation. */
30
+ delay?: EffectTiming['delay'];
31
+ };
32
+
33
+ /**
34
+ * Base presence parameters combining duration, easing, and delay for motion components.
35
+ */
36
+ declare type BasePresenceParams = PresenceDuration & PresenceEasing & PresenceDelay;
37
+
38
+ /** A React component that applies blur in/out transitions to its children. */
39
+ export declare const Blur: PresenceComponent<BlurParams>;
40
+
41
+ /**
42
+ * Generates a motion atom object for a blur-in or blur-out.
43
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
44
+ * @param duration - The duration of the motion in milliseconds.
45
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
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
+ * @param delay - Time (ms) to delay the animation. Defaults to 0.
49
+ * @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
50
+ */
51
+ export declare const blurAtom: ({ direction, duration, easing, delay, outRadius, inRadius, }: BlurAtomParams) => AtomMotion;
52
+
53
+ declare interface BlurAtomParams extends BaseAtomParams {
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;
58
+ }
59
+
60
+ export declare type BlurParams = BasePresenceParams & AnimateOpacity & {
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;
65
+ };
66
+
67
+ /** A React component that applies collapse/expand transitions to its children. */
68
+ export declare const Collapse: PresenceComponent<CollapseParams>;
69
+
70
+ /** A React component that applies collapse/expand transitions with delayed fade to its children. */
71
+ export declare const CollapseDelayed: PresenceComponent<CollapseParams>;
72
+
73
+ /**
74
+ * Duration properties for granular timing control in Collapse animations.
75
+ */
76
+ export declare type CollapseDurations = {
77
+ /** Time (ms) for the size animation during enter. Defaults to `duration` for unified timing. */
78
+ sizeDuration?: number;
79
+ /** Time (ms) for the opacity animation during enter. Defaults to `sizeDuration` for synchronized timing. */
80
+ opacityDuration?: number;
81
+ /** Time (ms) for the size animation during exit. Defaults to `exitDuration` for unified timing. */
82
+ exitSizeDuration?: number;
83
+ /** Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing. */
84
+ exitOpacityDuration?: number;
85
+ };
86
+
87
+ declare type CollapseOrientation = 'horizontal' | 'vertical';
88
+
89
+ export declare type CollapseParams = BasePresenceParams & AnimateOpacity & CollapseDurations & {
90
+ /** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */
91
+ orientation?: CollapseOrientation;
92
+ /** Size for the out state (collapsed). Defaults to `'0px'`. */
93
+ outSize?: string;
94
+ /**
95
+ * Time (ms) to delay the inner stagger between size and opacity animations.
96
+ * On enter this delays the opacity after size; on exit this delays the size after opacity.
97
+ * Defaults to 0.
98
+ */
99
+ staggerDelay?: number;
100
+ /**
101
+ * Time (ms) to delay the inner stagger during exit. Defaults to the `staggerDelay` param for symmetry.
102
+ */
103
+ exitStaggerDelay?: number;
104
+ };
105
+
106
+ export declare const CollapseRelaxed: PresenceComponent<CollapseParams>;
107
+
108
+ export declare const CollapseSnappy: PresenceComponent<CollapseParams>;
109
+
110
+ /** A React component that applies fade in/out transitions to its children. */
111
+ export declare const Fade: PresenceComponent<FadeParams>;
112
+
113
+ /**
114
+ * Generates a motion atom object for a fade-in or fade-out.
115
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
116
+ * @param duration - The duration of the motion in milliseconds.
117
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
118
+ * @param delay - The delay before the motion starts. Defaults to 0.
119
+ * @param outOpacity - Opacity for the out state (exited). Defaults to 0.
120
+ * @param inOpacity - Opacity for the in state (entered). Defaults to 1.
121
+ * @returns A motion atom object with opacity keyframes and the supplied duration and easing.
122
+ */
123
+ export declare const fadeAtom: ({ direction, duration, easing, delay, outOpacity, inOpacity, }: FadeAtomParams) => AtomMotion;
124
+
125
+ declare interface FadeAtomParams extends BaseAtomParams {
126
+ /** Defines how values are applied before and after execution. Defaults to 'both'. */
127
+ fill?: FillMode;
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;
132
+ }
133
+
134
+ export declare type FadeParams = BasePresenceParams & {
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;
139
+ };
140
+
141
+ export declare const FadeRelaxed: PresenceComponent<FadeParams>;
142
+
143
+ export declare const FadeSnappy: PresenceComponent<FadeParams>;
144
+
145
+ /**
146
+ * Common delay parameters for presence motion components.
147
+ */
148
+ declare type PresenceDelay = {
149
+ /** Time (ms) to delay the enter transition. */
150
+ delay?: EffectTiming['delay'];
151
+ /** Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry. */
152
+ exitDelay?: EffectTiming['delay'];
153
+ };
154
+
155
+ /**
156
+ * Common duration parameters for presence motion components.
157
+ */
158
+ declare type PresenceDuration = {
159
+ /** Time (ms) for the enter transition. */
160
+ duration?: number;
161
+ /** Time (ms) for the exit transition. Defaults to the `duration` param for symmetry. */
162
+ exitDuration?: number;
163
+ };
164
+
165
+ /**
166
+ * Common easing parameters for presence motion components.
167
+ */
168
+ declare type PresenceEasing = {
169
+ /** Easing curve for the enter transition. */
170
+ easing?: string;
171
+ /** Easing curve for the exit transition. Defaults to the `easing` param for symmetry. */
172
+ exitEasing?: string;
173
+ };
174
+
175
+ export declare const Rotate: PresenceComponent<RotateParams>;
176
+
177
+ /**
178
+ * Generates a motion atom object for a rotation around a single axis.
179
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
180
+ * @param duration - The duration of the motion in milliseconds.
181
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
182
+ * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
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.
185
+ * @param delay - Time (ms) to delay the animation. Defaults to 0.
186
+ * @returns A motion atom object with rotate keyframes and the supplied duration and easing.
187
+ */
188
+ export declare const rotateAtom: ({ direction, duration, easing, delay, axis, outAngle, inAngle, }: RotateAtomParams) => AtomMotion;
189
+
190
+ declare interface RotateAtomParams extends BaseAtomParams {
191
+ axis?: Axis3D_2;
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;
196
+ }
197
+
198
+ export declare type RotateParams = BasePresenceParams & AnimateOpacity & {
199
+ /**
200
+ * The axis of rotation: 'x', 'y', or 'z'.
201
+ * Defaults to 'z'.
202
+ */
203
+ axis?: Axis3D;
204
+ /**
205
+ * Rotation angle for the out state (exited) in degrees.
206
+ * Defaults to -90.
207
+ */
208
+ outAngle?: number;
209
+ /**
210
+ * Rotation angle for the in state (entered) in degrees.
211
+ * Defaults to 0.
212
+ */
213
+ inAngle?: number;
214
+ };
215
+
216
+ /** A React component that applies scale in/out transitions to its children. */
217
+ export declare const Scale: PresenceComponent<ScaleParams>;
218
+
219
+ /**
220
+ * Generates a motion atom object for a scale in or scale out.
221
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
222
+ * @param duration - The duration of the motion in milliseconds.
223
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
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.
226
+ * @param delay - Time (ms) to delay the animation. Defaults to 0.
227
+ * @returns A motion atom object with scale keyframes and the supplied duration and easing.
228
+ */
229
+ export declare const scaleAtom: ({ direction, duration, easing, delay, outScale, inScale, }: ScaleAtomParams) => AtomMotion;
230
+
231
+ declare interface ScaleAtomParams extends BaseAtomParams {
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;
236
+ }
237
+
238
+ export declare type ScaleParams = BasePresenceParams & AnimateOpacity & {
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;
243
+ };
244
+
245
+ export declare const ScaleRelaxed: PresenceComponent<ScaleParams>;
246
+
247
+ export declare const ScaleSnappy: PresenceComponent<ScaleParams>;
248
+
249
+ /** A React component that applies slide in/out transitions to its children. */
250
+ export declare const Slide: PresenceComponent<SlideParams>;
251
+
252
+ /**
253
+ * Generates a motion atom object for a slide-in or slide-out.
254
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
255
+ * @param duration - The duration of the motion in milliseconds.
256
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
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'.
261
+ * @param delay - Time (ms) to delay the animation. Defaults to 0.
262
+ * @returns A motion atom object with translate keyframes and the supplied duration and easing.
263
+ */
264
+ export declare const slideAtom: ({ direction, duration, easing, delay, outX, outY, inX, inY, }: SlideAtomParams) => AtomMotion;
265
+
266
+ declare interface SlideAtomParams extends BaseAtomParams {
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;
275
+ }
276
+
277
+ export declare type SlideParams = BasePresenceParams & AnimateOpacity & {
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;
286
+ };
287
+
288
+ export declare const SlideRelaxed: PresenceComponent<SlideParams>;
289
+
290
+ export declare const SlideSnappy: PresenceComponent<SlideParams>;
291
+
292
+ /**
293
+ * Stagger is a component that manages the staggered entrance and exit of its children.
294
+ * Children are animated in sequence with configurable timing between each item.
295
+ * Stagger can be interactively toggled between entrance and exit animations using the `visible` prop.
296
+ *
297
+ * @param children - React elements to animate. Elements are cloned with animation props.
298
+ * @param visible - Controls animation direction. When `true`, the group is animating "enter" (items shown);
299
+ * when `false`, the group is animating "exit" (items hidden). Defaults to `false`.
300
+ * @param itemDelay - Milliseconds between each item's animation start.
301
+ * Defaults to the package's default delay (see `DEFAULT_ITEM_DELAY`).
302
+ * @param itemDuration - Milliseconds each item's animation lasts. Only used with `delayMode="timing"`.
303
+ * Defaults to the package's default item duration (see `DEFAULT_ITEM_DURATION`).
304
+ * @param reversed - Whether to reverse the stagger sequence (last item animates first). Defaults to `false`.
305
+ * @param hideMode - How children's visibility/mounting is managed. Auto-detects if not specified.
306
+ * @param delayMode - How staggering timing is implemented. Auto-detects if not specified.
307
+ * @param onMotionFinish - Callback invoked when the staggered animation sequence completes.
308
+ *
309
+ * **Auto-detection behavior:**
310
+ * - **hideMode**: Presence components use `'visibleProp'`, DOM elements use `'visibilityStyle'`
311
+ * - **delayMode**: Components with delay support use `'delayProp'` (most performant), others use `'timing'`
312
+ *
313
+ * **hideMode options:**
314
+ * - `'visibleProp'`: Children are presence components with `visible` prop (always rendered, visibility controlled via prop)
315
+ * - `'visibilityStyle'`: Children remain in DOM with inline style visibility: hidden/visible (preserves layout space)
316
+ * - `'unmount'`: Children are mounted/unmounted from DOM based on visibility
317
+ *
318
+ * **delayMode options:**
319
+ * - `'timing'`: Manages visibility over time using JavaScript timing
320
+ * - `'delayProp'`: Passes delay props to motion components to use native Web Animations API delays (most performant)
321
+ *
322
+ * **Static variants:**
323
+ * - `<Stagger.In>` - One-way stagger for entrance animations only (auto-detects optimal modes)
324
+ * - `<Stagger.Out>` - One-way stagger for exit animations only (auto-detects optimal modes)
325
+ *
326
+ * @example
327
+ * ```tsx
328
+ * import { Stagger, Fade, Scale, Rotate } from '@fluentui/react-motion-components-preview';
329
+ *
330
+ * // Auto-detects optimal modes for presence components (delayProp + visibleProp)
331
+ * <Stagger visible={isVisible} itemDelay={150}>
332
+ * <Fade><div>Item 2</div></Fade>
333
+ * <Scale><div>Item 1</div></Scale>
334
+ * <Rotate><div>Item 3</div></Rotate>
335
+ * </Stagger>
336
+ *
337
+ * // Auto-detects optimal modes for motion components (delayProp + unmount)
338
+ * <Stagger.In itemDelay={100}>
339
+ * <Scale.In><div>Item 1</div></Scale.In>
340
+ * <Fade.In><div>Item 2</div></Fade.In>
341
+ * </Stagger.In>
342
+ *
343
+ * // Auto-detects timing mode for DOM elements (timing + visibilityStyle)
344
+ * <Stagger visible={isVisible} itemDelay={150} onMotionFinish={handleComplete}>
345
+ * <div>Item 1</div>
346
+ * <div>Item 2</div>
347
+ * <div>Item 3</div>
348
+ * </Stagger>
349
+ *
350
+ * // Override auto-detection when needed
351
+ * <Stagger visible={isVisible} delayMode="timing" hideMode="unmount">
352
+ * <CustomComponent>Item 1</CustomComponent>
353
+ * </Stagger>
354
+ * ```
355
+ */
356
+ export declare const Stagger: React_2.FC<StaggerProps> & {
357
+ In: React_2.FC<Omit<StaggerProps, "visible">>;
358
+ Out: React_2.FC<Omit<StaggerProps, "visible">>;
359
+ };
360
+
361
+ /**
362
+ * Defines how Stagger implements the timing of staggered animations.
363
+ * - 'timing': Manages visibility over time using JavaScript timing (current behavior)
364
+ * - 'delayProp': Passes delay props to motion components to use native Web Animations API delays
365
+ */
366
+ declare type StaggerDelayMode = 'timing' | 'delayProp';
367
+
368
+ /**
369
+ * Defines how Stagger manages its children's visibility/mounting.
370
+ * - 'visibleProp': Children are components with a `visible` prop (e.g. motion components)
371
+ * - 'visibilityStyle': Children remain in DOM with inline style `visibility: hidden | visible`
372
+ * - 'unmount': Children are mounted/unmounted from DOM based on visibility
373
+ */
374
+ declare type StaggerHideMode = 'visibleProp' | 'visibilityStyle' | 'unmount';
375
+
376
+ /**
377
+ * Props for the Stagger component that manages staggered entrance and exit animations.
378
+ */
379
+ export declare interface StaggerProps {
380
+ /** React elements to animate. Elements are cloned with animation props. */
381
+ children: React_2.ReactNode;
382
+ /**
383
+ * Controls children animation direction. When `true`, the group is animating "enter" (items shown).
384
+ * When `false`, the group is animating "exit" (items hidden).
385
+ */
386
+ visible?: PresenceComponentProps['visible'];
387
+ /** Whether to reverse the stagger sequence (last item animates first). Defaults to `false`. */
388
+ reversed?: boolean;
389
+ /**
390
+ * Milliseconds between each child's animation start.
391
+ * Defaults to the package's default delay (see `DEFAULT_ITEM_DELAY`).
392
+ */
393
+ itemDelay?: number;
394
+ /**
395
+ * Milliseconds each child's animation lasts. Only used with `delayMode="timing"`.
396
+ * Defaults to the package's default duration (see `DEFAULT_ITEM_DURATION`).
397
+ */
398
+ itemDuration?: number;
399
+ /** How children's visibility/mounting is managed. Auto-detects if not specified. */
400
+ hideMode?: StaggerHideMode;
401
+ /** How staggering timing is implemented. Defaults to 'timing'. */
402
+ delayMode?: StaggerDelayMode;
403
+ /** Callback invoked when the staggered animation sequence completes. */
404
+ onMotionFinish?: () => void;
405
+ }
406
+
407
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { AtomMotion } from '@fluentui/react-motion';
1
+ import type { AtomMotion } from '@fluentui/react-motion';
2
2
  import { PresenceComponent } from '@fluentui/react-motion';
3
- import { PresenceComponentProps } from '@fluentui/react-motion';
3
+ import type { PresenceComponentProps } from '@fluentui/react-motion';
4
4
  import type { PresenceDirection } from '@fluentui/react-motion';
5
5
  import * as React_2 from 'react';
6
6
 
@@ -1,4 +1,4 @@
1
- import { motionTokens } from '@fluentui/react-motion';
1
+ import { motionTokens } from "@fluentui/react-motion";
2
2
  /**
3
3
  * Generates a motion atom object for a blur-in or blur-out.
4
4
  * @param direction - The functional direction of the motion: 'enter' or '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 /** 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"}
1
+ {"version":3,"sources":["../src/atoms/blur-atom.ts"],"sourcesContent":["import type { AtomMotion } from '@fluentui/react-motion';\nimport { motionTokens } from '@fluentui/react-motion';\nimport type { 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":"AACA,SAASA,YAAY,QAAQ,yBAAyB;AAUtD;;;;;;;;;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"}
@@ -1,4 +1,4 @@
1
- import { motionTokens } from '@fluentui/react-motion';
1
+ import { motionTokens } from "@fluentui/react-motion";
2
2
  /**
3
3
  * Generates a motion atom object for a fade-in or fade-out.
4
4
  * @param direction - The functional direction of the motion: 'enter' or '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 /** 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"}
1
+ {"version":3,"sources":["../src/atoms/fade-atom.ts"],"sourcesContent":["import type { AtomMotion } from '@fluentui/react-motion';\nimport { motionTokens } from '@fluentui/react-motion';\nimport type { 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":"AACA,SAASA,YAAY,QAAQ,yBAAyB;AActD;;;;;;;;;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"}
@@ -1,4 +1,4 @@
1
- import { motionTokens } from '@fluentui/react-motion';
1
+ import { motionTokens } from "@fluentui/react-motion";
2
2
  const createRotateValue = (axis, angle)=>{
3
3
  return `${axis.toLowerCase()} ${angle}deg`;
4
4
  };
@@ -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 /** 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"}
1
+ {"version":3,"sources":["../src/atoms/rotate-atom.ts"],"sourcesContent":["import type { AtomMotion } from '@fluentui/react-motion';\nimport { motionTokens } from '@fluentui/react-motion';\nimport type { RotateParams } from '../components/Rotate/rotate-types';\nimport type { 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":"AACA,SAASA,YAAY,QAAQ,yBAAyB;AActD,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"}
@@ -1,4 +1,4 @@
1
- import { motionTokens } from '@fluentui/react-motion';
1
+ import { motionTokens } from "@fluentui/react-motion";
2
2
  /**
3
3
  * Generates a motion atom object for a scale in or scale out.
4
4
  * @param direction - The functional direction of the motion: 'enter' or '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 /** 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"}
1
+ {"version":3,"sources":["../src/atoms/scale-atom.ts"],"sourcesContent":["import type { AtomMotion } from '@fluentui/react-motion';\nimport { motionTokens } from '@fluentui/react-motion';\nimport type { 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":"AACA,SAASA,YAAY,QAAQ,yBAAyB;AAUtD;;;;;;;;;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"}
@@ -1,4 +1,4 @@
1
- import { motionTokens } from '@fluentui/react-motion';
1
+ import { motionTokens } from "@fluentui/react-motion";
2
2
  /**
3
3
  * Generates a motion atom object for a slide-in or slide-out.
4
4
  * @param direction - The functional direction of the motion: 'enter' or 'exit'.