@fluentui/react-motion-components-preview 0.0.0-nightly-20250711-0406.1 → 0.0.0-nightly-20250715-0406.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -7
- package/dist/index.d.ts +24 -0
- package/lib/atoms/slide-atom.js +27 -0
- package/lib/atoms/slide-atom.js.map +1 -0
- package/lib/components/Slide/Slide.js +48 -0
- package/lib/components/Slide/Slide.js.map +1 -0
- package/lib/components/Slide/index.js +1 -0
- package/lib/components/Slide/index.js.map +1 -0
- package/lib/components/Slide/slide-types.js +1 -0
- package/lib/components/Slide/slide-types.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/atoms/slide-atom.js +29 -0
- package/lib-commonjs/atoms/slide-atom.js.map +1 -0
- package/lib-commonjs/components/Slide/Slide.js +69 -0
- package/lib-commonjs/components/Slide/Slide.js.map +1 -0
- package/lib-commonjs/components/Slide/index.js +22 -0
- package/lib-commonjs/components/Slide/index.js.map +1 -0
- package/lib-commonjs/components/Slide/slide-types.js +4 -0
- package/lib-commonjs/components/Slide/slide-types.js.map +1 -0
- package/lib-commonjs/index.js +10 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# Change Log - @fluentui/react-motion-components-preview
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 15 Jul 2025 04:20:48 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20250715-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20250715-0406.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.6.2..@fluentui/react-motion-components-preview_v0.0.0-nightly-
|
9
|
+
Tue, 15 Jul 2025 04:20:48 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.6.2..@fluentui/react-motion-components-preview_v0.0.0-nightly-20250715-0406.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-motion to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-conformance to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-motion to v0.0.0-nightly-20250715-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/1a6ee366a07ec5a9c1067858f12158fabaeed874) by beachball)
|
16
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20250715-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/1a6ee366a07ec5a9c1067858f12158fabaeed874) by beachball)
|
17
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20250715-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/1a6ee366a07ec5a9c1067858f12158fabaeed874) by beachball)
|
18
18
|
|
19
19
|
## [0.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.6.2)
|
20
20
|
|
package/dist/index.d.ts
CHANGED
@@ -108,4 +108,28 @@ declare type ScaleVariantParams = {
|
|
108
108
|
animateOpacity?: boolean;
|
109
109
|
};
|
110
110
|
|
111
|
+
/** A React component that applies slide in/out transitions to its children. */
|
112
|
+
export declare const Slide: PresenceComponent<SlideParams>;
|
113
|
+
|
114
|
+
declare type SlideParams = {
|
115
|
+
/** Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (250 ms). */
|
116
|
+
duration?: number;
|
117
|
+
/** Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value. */
|
118
|
+
easing?: string;
|
119
|
+
/** Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry. */
|
120
|
+
exitDuration?: number;
|
121
|
+
/** Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value. */
|
122
|
+
exitEasing?: string;
|
123
|
+
/** The X translate value with units to animate from. Defaults to `'0px'`. */
|
124
|
+
fromX?: string;
|
125
|
+
/** The Y translate value with units to animate from. Defaults to `'20px'`. */
|
126
|
+
fromY?: string;
|
127
|
+
/** Whether to animate the opacity. Defaults to `true`. */
|
128
|
+
animateOpacity?: boolean;
|
129
|
+
};
|
130
|
+
|
131
|
+
export declare const SlideRelaxed: PresenceComponent<SlideParams>;
|
132
|
+
|
133
|
+
export declare const SlideSnappy: PresenceComponent<SlideParams>;
|
134
|
+
|
111
135
|
export { }
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { motionTokens } from '@fluentui/react-motion';
|
2
|
+
/**
|
3
|
+
* Generates a motion atom object for a slide in or slide out.
|
4
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
5
|
+
* @param duration - The duration of the motion in milliseconds.
|
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., '0px', '100%'). Defaults to '0px'.
|
8
|
+
* @param fromY - The starting Y translate value with units (e.g., '-20px', '100%'). Defaults to '0px'.
|
9
|
+
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
10
|
+
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromX = '0px', fromY = '0px' })=>{
|
11
|
+
const keyframes = [
|
12
|
+
{
|
13
|
+
translate: `${fromX} ${fromY}`
|
14
|
+
},
|
15
|
+
{
|
16
|
+
translate: '0px 0px'
|
17
|
+
}
|
18
|
+
];
|
19
|
+
if (direction === 'exit') {
|
20
|
+
keyframes.reverse();
|
21
|
+
}
|
22
|
+
return {
|
23
|
+
keyframes,
|
24
|
+
duration,
|
25
|
+
easing
|
26
|
+
};
|
27
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/atoms/slide-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface SlideAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromX?: string;\n fromY?: string;\n}\n\n/**\n * Generates a motion atom object for a slide in or slide out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromX - The starting X translate value with units (e.g., '0px', '100%'). Defaults to '0px'.\n * @param fromY - The starting Y translate value with units (e.g., '-20px', '100%'). Defaults to '0px'.\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 fromX = '0px',\n fromY = '0px',\n}: SlideAtomParams): AtomMotion => {\n const keyframes = [{ translate: `${fromX} ${fromY}` }, { translate: '0px 0px' }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","slideAtom","direction","duration","easing","curveLinear","fromX","fromY","keyframes","translate","reverse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AAUrF;;;;;;;;CAQC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACG;IAChB,MAAMC,YAAY;QAAC;YAAEC,WAAW,CAAC,EAAEH,MAAM,CAAC,EAAEC,MAAM,CAAC;QAAC;QAAG;YAAEE,WAAW;QAAU;KAAE;IAChF,IAAIP,cAAc,QAAQ;QACxBM,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAL;QACAC;IACF;AACF,EAAE"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';
|
2
|
+
import { fadeAtom } from '../../atoms/fade-atom';
|
3
|
+
import { slideAtom } from '../../atoms/slide-atom';
|
4
|
+
/** Define a presence motion for slide in/out */ const slidePresenceFn = ({ duration = motionTokens.durationNormal, easing = motionTokens.curveDecelerateMid, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMid, fromX = '0px', fromY = '20px', animateOpacity = true })=>{
|
5
|
+
const enterAtoms = [
|
6
|
+
slideAtom({
|
7
|
+
direction: 'enter',
|
8
|
+
duration,
|
9
|
+
easing,
|
10
|
+
fromX,
|
11
|
+
fromY
|
12
|
+
})
|
13
|
+
];
|
14
|
+
const exitAtoms = [
|
15
|
+
slideAtom({
|
16
|
+
direction: 'exit',
|
17
|
+
duration: exitDuration,
|
18
|
+
easing: exitEasing,
|
19
|
+
fromX,
|
20
|
+
fromY
|
21
|
+
})
|
22
|
+
];
|
23
|
+
// Only add fade atoms if animateOpacity is true.
|
24
|
+
if (animateOpacity) {
|
25
|
+
enterAtoms.push(fadeAtom({
|
26
|
+
direction: 'enter',
|
27
|
+
duration,
|
28
|
+
easing
|
29
|
+
}));
|
30
|
+
exitAtoms.push(fadeAtom({
|
31
|
+
direction: 'exit',
|
32
|
+
duration: exitDuration,
|
33
|
+
easing: exitEasing
|
34
|
+
}));
|
35
|
+
}
|
36
|
+
return {
|
37
|
+
enter: enterAtoms,
|
38
|
+
exit: exitAtoms
|
39
|
+
};
|
40
|
+
};
|
41
|
+
/** A React component that applies slide in/out transitions to its children. */ export const Slide = createPresenceComponent(slidePresenceFn);
|
42
|
+
export const SlideSnappy = createPresenceComponentVariant(Slide, {
|
43
|
+
easing: motionTokens.curveDecelerateMax,
|
44
|
+
exitEasing: motionTokens.curveAccelerateMax
|
45
|
+
});
|
46
|
+
export const SlideRelaxed = createPresenceComponentVariant(Slide, {
|
47
|
+
duration: motionTokens.durationGentle
|
48
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/Slide.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { slideAtom } from '../../atoms/slide-atom';\nimport { SlideParams } from './slide-types';\n\n/** Define a presence motion for slide in/out */\nconst slidePresenceFn: PresenceMotionFn<SlideParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveDecelerateMid,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMid,\n fromX = '0px',\n fromY = '20px',\n animateOpacity = true,\n}: SlideParams) => {\n const enterAtoms = [slideAtom({ direction: 'enter', duration, easing, fromX, fromY })];\n const exitAtoms = [\n slideAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n fromX,\n fromY,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\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/** A React component that applies slide in/out transitions to its children. */\nexport const Slide = createPresenceComponent(slidePresenceFn);\n\nexport const SlideSnappy = createPresenceComponentVariant(Slide, {\n easing: motionTokens.curveDecelerateMax,\n exitEasing: motionTokens.curveAccelerateMax,\n});\n\nexport const SlideRelaxed = createPresenceComponentVariant(Slide, {\n duration: motionTokens.durationGentle,\n});\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","fadeAtom","slideAtom","slidePresenceFn","duration","durationNormal","easing","curveDecelerateMid","exitDuration","exitEasing","curveAccelerateMid","fromX","fromY","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Slide","SlideSnappy","curveDecelerateMax","curveAccelerateMax","SlideRelaxed","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EACZC,uBAAuB,EAEvBC,8BAA8B,QACzB,yBAAyB;AAChC,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,SAAS,QAAQ,yBAAyB;AAGnD,8CAA8C,GAC9C,MAAMC,kBAAiD,CAAC,EACtDC,WAAWN,aAAaO,cAAc,EACtCC,SAASR,aAAaS,kBAAkB,EACxCC,eAAeJ,QAAQ,EACvBK,aAAaX,aAAaY,kBAAkB,EAC5CC,QAAQ,KAAK,EACbC,QAAQ,MAAM,EACdC,iBAAiB,IAAI,EACT;IACZ,MAAMC,aAAa;QAACZ,UAAU;YAAEa,WAAW;YAASX;YAAUE;YAAQK;YAAOC;QAAM;KAAG;IACtF,MAAMI,YAAY;QAChBd,UAAU;YACRa,WAAW;YACXX,UAAUI;YACVF,QAAQG;YACRE;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWG,IAAI,CAAChB,SAAS;YAAEc,WAAW;YAASX;YAAUE;QAAO;QAChEU,UAAUC,IAAI,CAAChB,SAAS;YAAEc,WAAW;YAAQX,UAAUI;YAAcF,QAAQG;QAAW;IAC1F;IAEA,OAAO;QACLS,OAAOJ;QACPK,MAAMH;IACR;AACF;AAEA,6EAA6E,GAC7E,OAAO,MAAMI,QAAQrB,wBAAwBI,iBAAiB;AAE9D,OAAO,MAAMkB,cAAcrB,+BAA+BoB,OAAO;IAC/Dd,QAAQR,aAAawB,kBAAkB;IACvCb,YAAYX,aAAayB,kBAAkB;AAC7C,GAAG;AAEH,OAAO,MAAMC,eAAexB,+BAA+BoB,OAAO;IAChEhB,UAAUN,aAAa2B,cAAc;AACvC,GAAG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Slide, SlideRelaxed, SlideSnappy } from './Slide';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/index.ts"],"sourcesContent":["export { Slide, SlideRelaxed, SlideSnappy } from './Slide';\n"],"names":["Slide","SlideRelaxed","SlideSnappy"],"rangeMappings":"","mappings":"AAAA,SAASA,KAAK,EAAEC,YAAY,EAAEC,WAAW,QAAQ,UAAU"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/slide-types.ts"],"sourcesContent":["export type SlideParams = {\n /** Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (250 ms). */\n duration?: number;\n\n /** Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value. */\n easing?: string;\n\n /** Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry. */\n exitDuration?: number;\n\n /** Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value. */\n exitEasing?: string;\n\n /** The X translate value with units to animate from. Defaults to `'0px'`. */\n fromX?: string;\n\n /** The Y translate value with units to animate from. Defaults to `'20px'`. */\n fromY?: string;\n\n /** Whether to animate the opacity. Defaults to `true`. */\n animateOpacity?: boolean;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAqBE"}
|
package/lib/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
export { Collapse, CollapseSnappy, CollapseRelaxed, CollapseDelayed, createCollapsePresence, createCollapseDelayedPresence } from './components/Collapse';
|
2
2
|
export { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';
|
3
3
|
export { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';
|
4
|
+
export { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseRelaxed,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport type { CollapseRuntimeParams } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\n"],"names":["Collapse","CollapseSnappy","CollapseRelaxed","CollapseDelayed","createCollapsePresence","createCollapseDelayedPresence","Fade","FadeSnappy","FadeRelaxed","Scale","ScaleSnappy","ScaleRelaxed"],"rangeMappings":"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseRelaxed,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport type { CollapseRuntimeParams } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\n"],"names":["Collapse","CollapseSnappy","CollapseRelaxed","CollapseDelayed","createCollapsePresence","createCollapseDelayedPresence","Fade","FadeSnappy","FadeRelaxed","Scale","ScaleSnappy","ScaleRelaxed","Slide","SlideSnappy","SlideRelaxed"],"rangeMappings":";;;","mappings":"AAAA,SACEA,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,sBAAsB,EACtBC,6BAA6B,QACxB,wBAAwB;AAE/B,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"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "slideAtom", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return slideAtom;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _reactmotion = require("@fluentui/react-motion");
|
12
|
+
const slideAtom = ({ direction, duration, easing = _reactmotion.motionTokens.curveLinear, fromX = '0px', fromY = '0px' })=>{
|
13
|
+
const keyframes = [
|
14
|
+
{
|
15
|
+
translate: `${fromX} ${fromY}`
|
16
|
+
},
|
17
|
+
{
|
18
|
+
translate: '0px 0px'
|
19
|
+
}
|
20
|
+
];
|
21
|
+
if (direction === 'exit') {
|
22
|
+
keyframes.reverse();
|
23
|
+
}
|
24
|
+
return {
|
25
|
+
keyframes,
|
26
|
+
duration,
|
27
|
+
easing
|
28
|
+
};
|
29
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/atoms/slide-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface SlideAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromX?: string;\n fromY?: string;\n}\n\n/**\n * Generates a motion atom object for a slide in or slide out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromX - The starting X translate value with units (e.g., '0px', '100%'). Defaults to '0px'.\n * @param fromY - The starting Y translate value with units (e.g., '-20px', '100%'). Defaults to '0px'.\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 fromX = '0px',\n fromY = '0px',\n}: SlideAtomParams): AtomMotion => {\n const keyframes = [{ translate: `${fromX} ${fromY}` }, { translate: '0px 0px' }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["slideAtom","direction","duration","easing","motionTokens","curveLinear","fromX","fromY","keyframes","translate","reverse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBaA;;;eAAAA;;;6BAnB+C;AAmBrD,MAAMA,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASC,yBAAY,CAACC,WAAW,EACjCC,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACG;IAChB,MAAMC,YAAY;QAAC;YAAEC,WAAW,CAAC,EAAEH,MAAM,CAAC,EAAEC,MAAM,CAAC;QAAC;QAAG;YAAEE,WAAW;QAAU;KAAE;IAChF,IAAIR,cAAc,QAAQ;QACxBO,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAN;QACAC;IACF;AACF"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
Slide: function() {
|
13
|
+
return Slide;
|
14
|
+
},
|
15
|
+
SlideRelaxed: function() {
|
16
|
+
return SlideRelaxed;
|
17
|
+
},
|
18
|
+
SlideSnappy: function() {
|
19
|
+
return SlideSnappy;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const _reactmotion = require("@fluentui/react-motion");
|
23
|
+
const _fadeatom = require("../../atoms/fade-atom");
|
24
|
+
const _slideatom = require("../../atoms/slide-atom");
|
25
|
+
/** Define a presence motion for slide in/out */ const slidePresenceFn = ({ duration = _reactmotion.motionTokens.durationNormal, easing = _reactmotion.motionTokens.curveDecelerateMid, exitDuration = duration, exitEasing = _reactmotion.motionTokens.curveAccelerateMid, fromX = '0px', fromY = '20px', animateOpacity = true })=>{
|
26
|
+
const enterAtoms = [
|
27
|
+
(0, _slideatom.slideAtom)({
|
28
|
+
direction: 'enter',
|
29
|
+
duration,
|
30
|
+
easing,
|
31
|
+
fromX,
|
32
|
+
fromY
|
33
|
+
})
|
34
|
+
];
|
35
|
+
const exitAtoms = [
|
36
|
+
(0, _slideatom.slideAtom)({
|
37
|
+
direction: 'exit',
|
38
|
+
duration: exitDuration,
|
39
|
+
easing: exitEasing,
|
40
|
+
fromX,
|
41
|
+
fromY
|
42
|
+
})
|
43
|
+
];
|
44
|
+
// Only add fade atoms if animateOpacity is true.
|
45
|
+
if (animateOpacity) {
|
46
|
+
enterAtoms.push((0, _fadeatom.fadeAtom)({
|
47
|
+
direction: 'enter',
|
48
|
+
duration,
|
49
|
+
easing
|
50
|
+
}));
|
51
|
+
exitAtoms.push((0, _fadeatom.fadeAtom)({
|
52
|
+
direction: 'exit',
|
53
|
+
duration: exitDuration,
|
54
|
+
easing: exitEasing
|
55
|
+
}));
|
56
|
+
}
|
57
|
+
return {
|
58
|
+
enter: enterAtoms,
|
59
|
+
exit: exitAtoms
|
60
|
+
};
|
61
|
+
};
|
62
|
+
const Slide = (0, _reactmotion.createPresenceComponent)(slidePresenceFn);
|
63
|
+
const SlideSnappy = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
|
64
|
+
easing: _reactmotion.motionTokens.curveDecelerateMax,
|
65
|
+
exitEasing: _reactmotion.motionTokens.curveAccelerateMax
|
66
|
+
});
|
67
|
+
const SlideRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
|
68
|
+
duration: _reactmotion.motionTokens.durationGentle
|
69
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/Slide.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { slideAtom } from '../../atoms/slide-atom';\nimport { SlideParams } from './slide-types';\n\n/** Define a presence motion for slide in/out */\nconst slidePresenceFn: PresenceMotionFn<SlideParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveDecelerateMid,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMid,\n fromX = '0px',\n fromY = '20px',\n animateOpacity = true,\n}: SlideParams) => {\n const enterAtoms = [slideAtom({ direction: 'enter', duration, easing, fromX, fromY })];\n const exitAtoms = [\n slideAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n fromX,\n fromY,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\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/** A React component that applies slide in/out transitions to its children. */\nexport const Slide = createPresenceComponent(slidePresenceFn);\n\nexport const SlideSnappy = createPresenceComponentVariant(Slide, {\n easing: motionTokens.curveDecelerateMax,\n exitEasing: motionTokens.curveAccelerateMax,\n});\n\nexport const SlideRelaxed = createPresenceComponentVariant(Slide, {\n duration: motionTokens.durationGentle,\n});\n"],"names":["Slide","SlideRelaxed","SlideSnappy","slidePresenceFn","duration","motionTokens","durationNormal","easing","curveDecelerateMid","exitDuration","exitEasing","curveAccelerateMid","fromX","fromY","animateOpacity","enterAtoms","slideAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","curveDecelerateMax","curveAccelerateMax","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA4CaA,KAAK;eAALA;;IAOAC,YAAY;eAAZA;;IALAC,WAAW;eAAXA;;;6BAzCN;0BACkB;2BACC;AAG1B,8CAA8C,GAC9C,MAAMC,kBAAiD,CAAC,EACtDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,eAAeL,QAAQ,EACvBM,aAAaL,yBAAY,CAACM,kBAAkB,EAC5CC,QAAQ,KAAK,EACbC,QAAQ,MAAM,EACdC,iBAAiB,IAAI,EACT;IACZ,MAAMC,aAAa;QAACC,IAAAA,oBAAS,EAAC;YAAEC,WAAW;YAASb;YAAUG;YAAQK;YAAOC;QAAM;KAAG;IACtF,MAAMK,YAAY;QAChBF,IAAAA,oBAAS,EAAC;YACRC,WAAW;YACXb,UAAUK;YACVF,QAAQG;YACRE;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASb;YAAUG;QAAO;QAChEW,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQb,UAAUK;YAAcF,QAAQG;QAAW;IAC1F;IAEA,OAAO;QACLW,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMlB,QAAQuB,IAAAA,oCAAuB,EAACpB;AAEtC,MAAMD,cAAcsB,IAAAA,2CAA8B,EAACxB,OAAO;IAC/DO,QAAQF,yBAAY,CAACoB,kBAAkB;IACvCf,YAAYL,yBAAY,CAACqB,kBAAkB;AAC7C;AAEO,MAAMzB,eAAeuB,IAAAA,2CAA8B,EAACxB,OAAO;IAChEI,UAAUC,yBAAY,CAACsB,cAAc;AACvC"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
Slide: function() {
|
13
|
+
return _Slide.Slide;
|
14
|
+
},
|
15
|
+
SlideRelaxed: function() {
|
16
|
+
return _Slide.SlideRelaxed;
|
17
|
+
},
|
18
|
+
SlideSnappy: function() {
|
19
|
+
return _Slide.SlideSnappy;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const _Slide = require("./Slide");
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/index.ts"],"sourcesContent":["export { Slide, SlideRelaxed, SlideSnappy } from './Slide';\n"],"names":["Slide","SlideRelaxed","SlideSnappy"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;;uBAAQ"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"rangeMappings":"","mappings":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -39,6 +39,15 @@ _export(exports, {
|
|
39
39
|
ScaleSnappy: function() {
|
40
40
|
return _Scale.ScaleSnappy;
|
41
41
|
},
|
42
|
+
Slide: function() {
|
43
|
+
return _Slide.Slide;
|
44
|
+
},
|
45
|
+
SlideRelaxed: function() {
|
46
|
+
return _Slide.SlideRelaxed;
|
47
|
+
},
|
48
|
+
SlideSnappy: function() {
|
49
|
+
return _Slide.SlideSnappy;
|
50
|
+
},
|
42
51
|
createCollapseDelayedPresence: function() {
|
43
52
|
return _Collapse.createCollapseDelayedPresence;
|
44
53
|
},
|
@@ -49,3 +58,4 @@ _export(exports, {
|
|
49
58
|
const _Collapse = require("./components/Collapse");
|
50
59
|
const _Fade = require("./components/Fade");
|
51
60
|
const _Scale = require("./components/Scale");
|
61
|
+
const _Slide = require("./components/Slide");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseRelaxed,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport type { CollapseRuntimeParams } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\n"],"names":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","Fade","FadeRelaxed","FadeSnappy","Scale","ScaleRelaxed","ScaleSnappy","createCollapseDelayedPresence","createCollapsePresence"],"rangeMappings":"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseRelaxed,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport type { CollapseRuntimeParams } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeRelaxed } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleRelaxed } from './components/Scale';\nexport { Slide, SlideSnappy, SlideRelaxed } from './components/Slide';\n"],"names":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","Fade","FadeRelaxed","FadeSnappy","Scale","ScaleRelaxed","ScaleSnappy","Slide","SlideRelaxed","SlideSnappy","createCollapseDelayedPresence","createCollapsePresence"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,QAAQ;eAARA,kBAAQ;;IAGRC,eAAe;eAAfA,yBAAe;;IADfC,eAAe;eAAfA,yBAAe;;IADfC,cAAc;eAAdA,wBAAc;;IAOPC,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;;IALzBC,6BAA6B;eAA7BA,uCAA6B;;IAD7BC,sBAAsB;eAAtBA,gCAAsB;;;0BAEjB;sBAEuC;uBACG;uBACA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-motion-components-preview",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20250715-0406.1",
|
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",
|
@@ -19,12 +19,12 @@
|
|
19
19
|
"license": "MIT",
|
20
20
|
"devDependencies": {
|
21
21
|
"@fluentui/eslint-plugin": "*",
|
22
|
-
"@fluentui/react-conformance": "0.0.0-nightly-
|
23
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
22
|
+
"@fluentui/react-conformance": "0.0.0-nightly-20250715-0406.1",
|
23
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20250715-0406.1",
|
24
24
|
"@fluentui/scripts-api-extractor": "*"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@fluentui/react-motion": "0.0.0-nightly-
|
27
|
+
"@fluentui/react-motion": "0.0.0-nightly-20250715-0406.1",
|
28
28
|
"@swc/helpers": "^0.5.1"
|
29
29
|
},
|
30
30
|
"peerDependencies": {
|