@fluentui/react-motion-components-preview 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,18 @@
1
1
  # Change Log - @fluentui/react-motion-components-preview
2
2
 
3
- This log was last generated on Mon, 28 Jul 2025 18:48:19 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 21 Aug 2025 12:20:17 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.9.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.9.0)
8
+
9
+ Thu, 21 Aug 2025 12:20:17 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.8.1..@fluentui/react-motion-components-preview_v0.9.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat(motion): add Rotate presence motion component ([PR #34928](https://github.com/microsoft/fluentui/pull/34928) by robertpenner@microsoft.com)
15
+
7
16
  ## [0.8.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.8.0)
8
17
 
9
18
  Mon, 28 Jul 2025 18:48:19 GMT
package/dist/index.d.ts CHANGED
@@ -8,10 +8,12 @@ declare type AnimateOpacity = {
8
8
  animateOpacity?: boolean;
9
9
  };
10
10
 
11
+ declare type Axis3D = 'x' | 'y' | 'z';
12
+
11
13
  /** A React component that applies blur in/out transitions to its children. */
12
14
  export declare const Blur: PresenceComponent<BlurParams>;
13
15
 
14
- declare type BlurParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
16
+ export declare type BlurParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
15
17
  /** The radius of pixels to blend into the blur. A length string, defaulting to '20px'. */
16
18
  fromRadius?: string;
17
19
  };
@@ -80,6 +82,26 @@ declare type PresenceEasing = {
80
82
  exitEasing?: string;
81
83
  };
82
84
 
85
+ export declare const Rotate: PresenceComponent<RotateParams>;
86
+
87
+ export declare type RotateParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
88
+ /**
89
+ * The axis of rotation: 'x', 'y', or 'z'.
90
+ * Defaults to 'y'.
91
+ */
92
+ axis?: Axis3D;
93
+ /**
94
+ * The starting rotation angle in degrees.
95
+ * Defaults to -90.
96
+ */
97
+ angle?: number;
98
+ /**
99
+ * The ending rotation angle in degrees.
100
+ * Defaults to the negation of `angle`.
101
+ */
102
+ exitAngle?: number;
103
+ };
104
+
83
105
  /** A React component that applies scale in/out transitions to its children. */
84
106
  export declare const Scale: PresenceComponent<ScaleParams>;
85
107
 
@@ -0,0 +1,34 @@
1
+ import { motionTokens } from '@fluentui/react-motion';
2
+ const createRotateValue = (axis, angle)=>{
3
+ return `${axis.toLowerCase()} ${angle}deg`;
4
+ };
5
+ /**
6
+ * Generates a motion atom object for a rotation around a single axis.
7
+ * @param direction - The functional direction of the motion: 'enter' or 'exit'.
8
+ * @param duration - The duration of the motion in milliseconds.
9
+ * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
10
+ * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
11
+ * @param angle - The starting rotation angle in degrees. Defaults to -90.
12
+ * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.
13
+ * @returns A motion atom object with rotate keyframes and the supplied duration and easing.
14
+ */ export const rotateAtom = ({ direction, duration, easing = motionTokens.curveLinear, axis = 'y', angle = -90, exitAngle = -angle })=>{
15
+ let fromAngle = angle;
16
+ let toAngle = 0;
17
+ if (direction === 'exit') {
18
+ fromAngle = 0;
19
+ toAngle = exitAngle;
20
+ }
21
+ const keyframes = [
22
+ {
23
+ rotate: createRotateValue(axis, fromAngle)
24
+ },
25
+ {
26
+ rotate: createRotateValue(axis, toAngle)
27
+ }
28
+ ];
29
+ return {
30
+ keyframes,
31
+ duration,
32
+ easing
33
+ };
34
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/rotate-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\nimport type { RotateParams } from '../components/Rotate/rotate-types';\n\ntype Axis3D = NonNullable<RotateParams['axis']>;\n\ninterface RotateAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n axis?: Axis3D;\n angle?: number;\n exitAngle?: 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 angle - The starting rotation angle in degrees. Defaults to -90.\n * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.\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 axis = 'y',\n angle = -90,\n exitAngle = -angle,\n}: RotateAtomParams): AtomMotion => {\n let fromAngle = angle;\n let toAngle = 0;\n\n if (direction === 'exit') {\n fromAngle = 0;\n toAngle = exitAngle;\n }\n const keyframes = [{ rotate: createRotateValue(axis, fromAngle) }, { rotate: createRotateValue(axis, toAngle) }];\n\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","createRotateValue","axis","angle","toLowerCase","rotateAtom","direction","duration","easing","curveLinear","exitAngle","fromAngle","toAngle","keyframes","rotate"],"mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AAcrF,MAAMC,oBAAoB,CAACC,MAAcC;IACvC,OAAO,GAAGD,KAAKE,WAAW,GAAG,CAAC,EAAED,MAAM,GAAG,CAAC;AAC5C;AAEA;;;;;;;;;CASC,GACD,OAAO,MAAME,aAAa,CAAC,EACzBC,SAAS,EACTC,QAAQ,EACRC,SAASR,aAAaS,WAAW,EACjCP,OAAO,GAAG,EACVC,QAAQ,CAAC,EAAE,EACXO,YAAY,CAACP,KAAK,EACD;IACjB,IAAIQ,YAAYR;IAChB,IAAIS,UAAU;IAEd,IAAIN,cAAc,QAAQ;QACxBK,YAAY;QACZC,UAAUF;IACZ;IACA,MAAMG,YAAY;QAAC;YAAEC,QAAQb,kBAAkBC,MAAMS;QAAW;QAAG;YAAEG,QAAQb,kBAAkBC,MAAMU;QAAS;KAAE;IAEhH,OAAO;QACLC;QACAN;QACAC;IACF;AACF,EAAE"}
@@ -0,0 +1,54 @@
1
+ import { createPresenceComponent, motionTokens } from '@fluentui/react-motion';
2
+ import { fadeAtom } from '../../atoms/fade-atom';
3
+ import { rotateAtom } from '../../atoms/rotate-atom';
4
+ /**
5
+ * Define a presence motion for rotate in/out
6
+ *
7
+ * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.
8
+ * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.
9
+ * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.
10
+ * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.
11
+ * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
12
+ * @param angle - The starting rotation angle in degrees. Defaults to -90.
13
+ * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.
14
+ * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.
15
+ */ const rotatePresenceFn = ({ axis = 'y', angle = -90, exitAngle = -angle, duration = motionTokens.durationGentle, exitDuration = duration, easing = motionTokens.curveDecelerateMax, exitEasing = motionTokens.curveAccelerateMax, animateOpacity = true })=>{
16
+ const enterAtoms = [
17
+ rotateAtom({
18
+ direction: 'enter',
19
+ duration,
20
+ easing,
21
+ axis,
22
+ angle,
23
+ exitAngle
24
+ })
25
+ ];
26
+ const exitAtoms = [
27
+ rotateAtom({
28
+ direction: 'exit',
29
+ duration: exitDuration,
30
+ easing: exitEasing,
31
+ axis,
32
+ angle,
33
+ exitAngle
34
+ })
35
+ ];
36
+ if (animateOpacity) {
37
+ enterAtoms.push(fadeAtom({
38
+ direction: 'enter',
39
+ duration,
40
+ easing
41
+ }));
42
+ exitAtoms.push(fadeAtom({
43
+ direction: 'exit',
44
+ duration: exitDuration,
45
+ easing: exitEasing
46
+ }));
47
+ }
48
+ return {
49
+ enter: enterAtoms,
50
+ exit: exitAtoms
51
+ };
52
+ };
53
+ // Create a presence motion component to rotate an element around a single axis (x, y, or z).
54
+ export const Rotate = createPresenceComponent(rotatePresenceFn);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Rotate/Rotate.ts"],"sourcesContent":["import { AtomMotion, createPresenceComponent, motionTokens, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport { RotateParams } from './rotate-types';\n\n/**\n * Define a presence motion for rotate in/out\n *\n * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.\n * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.\n * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.\n * @param angle - The starting rotation angle in degrees. Defaults to -90.\n * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.\n * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.\n */\nconst rotatePresenceFn: PresenceMotionFn<RotateParams> = ({\n axis = 'y',\n angle = -90,\n exitAngle = -angle,\n duration = motionTokens.durationGentle,\n exitDuration = duration,\n easing = motionTokens.curveDecelerateMax,\n exitEasing = motionTokens.curveAccelerateMax,\n animateOpacity = true,\n}: RotateParams) => {\n const enterAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'enter',\n duration,\n easing,\n axis,\n angle,\n exitAngle,\n }),\n ];\n\n const exitAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n axis,\n angle,\n exitAngle,\n }),\n ];\n\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n// Create a presence motion component to rotate an element around a single axis (x, y, or z).\nexport const Rotate = createPresenceComponent(rotatePresenceFn);\n"],"names":["createPresenceComponent","motionTokens","fadeAtom","rotateAtom","rotatePresenceFn","axis","angle","exitAngle","duration","durationGentle","exitDuration","easing","curveDecelerateMax","exitEasing","curveAccelerateMax","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Rotate"],"mappings":"AAAA,SAAqBA,uBAAuB,EAAEC,YAAY,QAA0B,yBAAyB;AAC7G,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,UAAU,QAAQ,0BAA0B;AAGrD;;;;;;;;;;;CAWC,GACD,MAAMC,mBAAmD,CAAC,EACxDC,OAAO,GAAG,EACVC,QAAQ,CAAC,EAAE,EACXC,YAAY,CAACD,KAAK,EAClBE,WAAWP,aAAaQ,cAAc,EACtCC,eAAeF,QAAQ,EACvBG,SAASV,aAAaW,kBAAkB,EACxCC,aAAaZ,aAAaa,kBAAkB,EAC5CC,iBAAiB,IAAI,EACR;IACb,MAAMC,aAA2B;QAC/Bb,WAAW;YACTc,WAAW;YACXT;YACAG;YACAN;YACAC;YACAC;QACF;KACD;IAED,MAAMW,YAA0B;QAC9Bf,WAAW;YACTc,WAAW;YACXT,UAAUE;YACVC,QAAQE;YACRR;YACAC;YACAC;QACF;KACD;IAED,IAAIQ,gBAAgB;QAClBC,WAAWG,IAAI,CAACjB,SAAS;YAAEe,WAAW;YAAST;YAAUG;QAAO;QAChEO,UAAUC,IAAI,CAACjB,SAAS;YAAEe,WAAW;YAAQT,UAAUE;YAAcC,QAAQE;QAAW;IAC1F;IAEA,OAAO;QACLO,OAAOJ;QACPK,MAAMH;IACR;AACF;AAEA,6FAA6F;AAC7F,OAAO,MAAMI,SAAStB,wBAAwBI,kBAAkB"}
@@ -0,0 +1 @@
1
+ export { Rotate } from './Rotate';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Rotate/index.ts"],"sourcesContent":["export { Rotate } from './Rotate';\nexport type { RotateParams } from './rotate-types';\n"],"names":["Rotate"],"mappings":"AAAA,SAASA,MAAM,QAAQ,WAAW"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Rotate/rotate-types.ts"],"sourcesContent":["import type { PresenceDuration, PresenceEasing, AnimateOpacity } from '../../types';\n\ntype Axis3D = 'x' | 'y' | 'z';\n\nexport type RotateParams = PresenceDuration &\n PresenceEasing &\n AnimateOpacity & {\n /**\n * The axis of rotation: 'x', 'y', or 'z'.\n * Defaults to 'y'.\n */\n axis?: Axis3D;\n\n /**\n * The starting rotation angle in degrees.\n * Defaults to -90.\n */\n angle?: number;\n\n /**\n * The ending rotation angle in degrees.\n * Defaults to the negation of `angle`.\n */\n exitAngle?: number;\n };\n"],"names":[],"mappings":"AAIA,WAoBI"}
package/lib/index.js CHANGED
@@ -3,3 +3,4 @@ export { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';
3
3
  export { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';
4
4
  export { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';
5
5
  export { Blur } from './components/Blur';
6
+ export { Rotate } from './components/Rotate';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseRelaxed, CollapseDelayed } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\nexport { Blur } from './components/Blur';\n"],"names":["Collapse","CollapseSnappy","CollapseRelaxed","CollapseDelayed","Fade","FadeSnappy","FadeRelaxed","Scale","ScaleSnappy","ScaleRelaxed","Slide","SlideSnappy","SlideRelaxed","Blur"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,eAAe,EAAEC,eAAe,QAAQ,wBAAwB;AACnG,SAASC,IAAI,EAAEC,UAAU,EAAEC,WAAW,QAAQ,oBAAoB;AAClE,SAASC,KAAK,EAAEC,WAAW,EAAEC,YAAY,QAAQ,qBAAqB;AACtE,SAASC,KAAK,EAAEC,WAAW,EAAEC,YAAY,QAAQ,qBAAqB;AACtE,SAASC,IAAI,QAAQ,oBAAoB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseRelaxed, CollapseDelayed } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\nexport { Blur, type BlurParams } from './components/Blur';\nexport { Rotate, type RotateParams } from './components/Rotate';\n"],"names":["Collapse","CollapseSnappy","CollapseRelaxed","CollapseDelayed","Fade","FadeSnappy","FadeRelaxed","Scale","ScaleSnappy","ScaleRelaxed","Slide","SlideSnappy","SlideRelaxed","Blur","Rotate"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,eAAe,EAAEC,eAAe,QAAQ,wBAAwB;AACnG,SAASC,IAAI,EAAEC,UAAU,EAAEC,WAAW,QAAQ,oBAAoB;AAClE,SAASC,KAAK,EAAEC,WAAW,EAAEC,YAAY,QAAQ,qBAAqB;AACtE,SAASC,KAAK,EAAEC,WAAW,EAAEC,YAAY,QAAQ,qBAAqB;AACtE,SAASC,IAAI,QAAyB,oBAAoB;AAC1D,SAASC,MAAM,QAA2B,sBAAsB"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "rotateAtom", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return rotateAtom;
9
+ }
10
+ });
11
+ const _reactmotion = require("@fluentui/react-motion");
12
+ const createRotateValue = (axis, angle)=>{
13
+ return `${axis.toLowerCase()} ${angle}deg`;
14
+ };
15
+ const rotateAtom = ({ direction, duration, easing = _reactmotion.motionTokens.curveLinear, axis = 'y', angle = -90, exitAngle = -angle })=>{
16
+ let fromAngle = angle;
17
+ let toAngle = 0;
18
+ if (direction === 'exit') {
19
+ fromAngle = 0;
20
+ toAngle = exitAngle;
21
+ }
22
+ const keyframes = [
23
+ {
24
+ rotate: createRotateValue(axis, fromAngle)
25
+ },
26
+ {
27
+ rotate: createRotateValue(axis, toAngle)
28
+ }
29
+ ];
30
+ return {
31
+ keyframes,
32
+ duration,
33
+ easing
34
+ };
35
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/rotate-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\nimport type { RotateParams } from '../components/Rotate/rotate-types';\n\ntype Axis3D = NonNullable<RotateParams['axis']>;\n\ninterface RotateAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n axis?: Axis3D;\n angle?: number;\n exitAngle?: 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 angle - The starting rotation angle in degrees. Defaults to -90.\n * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.\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 axis = 'y',\n angle = -90,\n exitAngle = -angle,\n}: RotateAtomParams): AtomMotion => {\n let fromAngle = angle;\n let toAngle = 0;\n\n if (direction === 'exit') {\n fromAngle = 0;\n toAngle = exitAngle;\n }\n const keyframes = [{ rotate: createRotateValue(axis, fromAngle) }, { rotate: createRotateValue(axis, toAngle) }];\n\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["rotateAtom","createRotateValue","axis","angle","toLowerCase","direction","duration","easing","motionTokens","curveLinear","exitAngle","fromAngle","toAngle","keyframes","rotate"],"mappings":";;;;+BA4BaA;;;eAAAA;;;6BA5B+C;AAc5D,MAAMC,oBAAoB,CAACC,MAAcC;IACvC,OAAO,GAAGD,KAAKE,WAAW,GAAG,CAAC,EAAED,MAAM,GAAG,CAAC;AAC5C;AAYO,MAAMH,aAAa,CAAC,EACzBK,SAAS,EACTC,QAAQ,EACRC,SAASC,yBAAY,CAACC,WAAW,EACjCP,OAAO,GAAG,EACVC,QAAQ,CAAC,EAAE,EACXO,YAAY,CAACP,KAAK,EACD;IACjB,IAAIQ,YAAYR;IAChB,IAAIS,UAAU;IAEd,IAAIP,cAAc,QAAQ;QACxBM,YAAY;QACZC,UAAUF;IACZ;IACA,MAAMG,YAAY;QAAC;YAAEC,QAAQb,kBAAkBC,MAAMS;QAAW;QAAG;YAAEG,QAAQb,kBAAkBC,MAAMU;QAAS;KAAE;IAEhH,OAAO;QACLC;QACAP;QACAC;IACF;AACF"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Rotate", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return Rotate;
9
+ }
10
+ });
11
+ const _reactmotion = require("@fluentui/react-motion");
12
+ const _fadeatom = require("../../atoms/fade-atom");
13
+ const _rotateatom = require("../../atoms/rotate-atom");
14
+ /**
15
+ * Define a presence motion for rotate in/out
16
+ *
17
+ * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.
18
+ * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.
19
+ * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.
20
+ * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.
21
+ * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.
22
+ * @param angle - The starting rotation angle in degrees. Defaults to -90.
23
+ * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.
24
+ * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.
25
+ */ const rotatePresenceFn = ({ axis = 'y', angle = -90, exitAngle = -angle, duration = _reactmotion.motionTokens.durationGentle, exitDuration = duration, easing = _reactmotion.motionTokens.curveDecelerateMax, exitEasing = _reactmotion.motionTokens.curveAccelerateMax, animateOpacity = true })=>{
26
+ const enterAtoms = [
27
+ (0, _rotateatom.rotateAtom)({
28
+ direction: 'enter',
29
+ duration,
30
+ easing,
31
+ axis,
32
+ angle,
33
+ exitAngle
34
+ })
35
+ ];
36
+ const exitAtoms = [
37
+ (0, _rotateatom.rotateAtom)({
38
+ direction: 'exit',
39
+ duration: exitDuration,
40
+ easing: exitEasing,
41
+ axis,
42
+ angle,
43
+ exitAngle
44
+ })
45
+ ];
46
+ if (animateOpacity) {
47
+ enterAtoms.push((0, _fadeatom.fadeAtom)({
48
+ direction: 'enter',
49
+ duration,
50
+ easing
51
+ }));
52
+ exitAtoms.push((0, _fadeatom.fadeAtom)({
53
+ direction: 'exit',
54
+ duration: exitDuration,
55
+ easing: exitEasing
56
+ }));
57
+ }
58
+ return {
59
+ enter: enterAtoms,
60
+ exit: exitAtoms
61
+ };
62
+ };
63
+ const Rotate = (0, _reactmotion.createPresenceComponent)(rotatePresenceFn);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Rotate/Rotate.ts"],"sourcesContent":["import { AtomMotion, createPresenceComponent, motionTokens, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport { RotateParams } from './rotate-types';\n\n/**\n * Define a presence motion for rotate in/out\n *\n * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.\n * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.\n * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'y'.\n * @param angle - The starting rotation angle in degrees. Defaults to -90.\n * @param exitAngle - The ending rotation angle in degrees. Defaults to the negation of `angle`.\n * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.\n */\nconst rotatePresenceFn: PresenceMotionFn<RotateParams> = ({\n axis = 'y',\n angle = -90,\n exitAngle = -angle,\n duration = motionTokens.durationGentle,\n exitDuration = duration,\n easing = motionTokens.curveDecelerateMax,\n exitEasing = motionTokens.curveAccelerateMax,\n animateOpacity = true,\n}: RotateParams) => {\n const enterAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'enter',\n duration,\n easing,\n axis,\n angle,\n exitAngle,\n }),\n ];\n\n const exitAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n axis,\n angle,\n exitAngle,\n }),\n ];\n\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n// Create a presence motion component to rotate an element around a single axis (x, y, or z).\nexport const Rotate = createPresenceComponent(rotatePresenceFn);\n"],"names":["Rotate","rotatePresenceFn","axis","angle","exitAngle","duration","motionTokens","durationGentle","exitDuration","easing","curveDecelerateMax","exitEasing","curveAccelerateMax","animateOpacity","enterAtoms","rotateAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent"],"mappings":";;;;+BA6DaA;;;eAAAA;;;6BA7DuE;0BAC3D;4BACE;AAG3B;;;;;;;;;;;CAWC,GACD,MAAMC,mBAAmD,CAAC,EACxDC,OAAO,GAAG,EACVC,QAAQ,CAAC,EAAE,EACXC,YAAY,CAACD,KAAK,EAClBE,WAAWC,yBAAY,CAACC,cAAc,EACtCC,eAAeH,QAAQ,EACvBI,SAASH,yBAAY,CAACI,kBAAkB,EACxCC,aAAaL,yBAAY,CAACM,kBAAkB,EAC5CC,iBAAiB,IAAI,EACR;IACb,MAAMC,aAA2B;QAC/BC,IAAAA,sBAAU,EAAC;YACTC,WAAW;YACXX;YACAI;YACAP;YACAC;YACAC;QACF;KACD;IAED,MAAMa,YAA0B;QAC9BF,IAAAA,sBAAU,EAAC;YACTC,WAAW;YACXX,UAAUG;YACVC,QAAQE;YACRT;YACAC;YACAC;QACF;KACD;IAED,IAAIS,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASX;YAAUI;QAAO;QAChEQ,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQX,UAAUG;YAAcC,QAAQE;QAAW;IAC1F;IAEA,OAAO;QACLS,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMjB,SAASsB,IAAAA,oCAAuB,EAACrB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Rotate", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _Rotate.Rotate;
9
+ }
10
+ });
11
+ const _Rotate = require("./Rotate");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Rotate/index.ts"],"sourcesContent":["export { Rotate } from './Rotate';\nexport type { RotateParams } from './rotate-types';\n"],"names":["Rotate"],"mappings":";;;;+BAASA;;;eAAAA,cAAM;;;wBAAQ"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -33,6 +33,9 @@ _export(exports, {
33
33
  FadeSnappy: function() {
34
34
  return _Fade.FadeSnappy;
35
35
  },
36
+ Rotate: function() {
37
+ return _Rotate.Rotate;
38
+ },
36
39
  Scale: function() {
37
40
  return _Scale.Scale;
38
41
  },
@@ -57,3 +60,4 @@ const _Fade = require("./components/Fade");
57
60
  const _Scale = require("./components/Scale");
58
61
  const _Slide = require("./components/Slide");
59
62
  const _Blur = require("./components/Blur");
63
+ const _Rotate = require("./components/Rotate");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseRelaxed, CollapseDelayed } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\nexport { Blur } from './components/Blur';\n"],"names":["Blur","Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","Fade","FadeRelaxed","FadeSnappy","Scale","ScaleRelaxed","ScaleSnappy","Slide","SlideRelaxed","SlideSnappy"],"mappings":";;;;;;;;;;;IAISA,IAAI;eAAJA,UAAI;;IAJJC,QAAQ;eAARA,kBAAQ;;IAAmCC,eAAe;eAAfA,yBAAe;;IAAhCC,eAAe;eAAfA,yBAAe;;IAA/BC,cAAc;eAAdA,wBAAc;;IACxBC,IAAI;eAAJA,UAAI;;IAAcC,WAAW;eAAXA,iBAAW;;IAAvBC,UAAU;eAAVA,gBAAU;;IAChBC,KAAK;eAALA,YAAK;;IAAeC,YAAY;eAAZA,mBAAY;;IAAzBC,WAAW;eAAXA,kBAAW;;IAClBC,KAAK;eAALA,YAAK;;IAAeC,YAAY;eAAZA,mBAAY;;IAAzBC,WAAW;eAAXA,kBAAW;;;0BAHgD;sBAC7B;uBACG;uBACA;sBAC5B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseRelaxed, CollapseDelayed } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\nexport { Blur, type BlurParams } from './components/Blur';\nexport { Rotate, type RotateParams } from './components/Rotate';\n"],"names":["Blur","Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","Fade","FadeRelaxed","FadeSnappy","Rotate","Scale","ScaleRelaxed","ScaleSnappy","Slide","SlideRelaxed","SlideSnappy"],"mappings":";;;;;;;;;;;IAISA,IAAI;eAAJA,UAAI;;IAJJC,QAAQ;eAARA,kBAAQ;;IAAmCC,eAAe;eAAfA,yBAAe;;IAAhCC,eAAe;eAAfA,yBAAe;;IAA/BC,cAAc;eAAdA,wBAAc;;IACxBC,IAAI;eAAJA,UAAI;;IAAcC,WAAW;eAAXA,iBAAW;;IAAvBC,UAAU;eAAVA,gBAAU;;IAIhBC,MAAM;eAANA,cAAM;;IAHNC,KAAK;eAALA,YAAK;;IAAeC,YAAY;eAAZA,mBAAY;;IAAzBC,WAAW;eAAXA,kBAAW;;IAClBC,KAAK;eAALA,YAAK;;IAAeC,YAAY;eAAZA,mBAAY;;IAAzBC,WAAW;eAAXA,kBAAW;;;0BAHgD;sBAC7B;uBACG;uBACA;sBACX;wBACI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-motion-components-preview",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "A preview package for Fluent UI motion components, providing a collection of components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",