@fluentui/react-motion-components-preview 0.1.0 → 0.1.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 CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/react-motion-components-preview
2
2
 
3
- This log was last generated on Mon, 15 Jul 2024 17:20:20 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 23 Jul 2024 20:09:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.1.1)
8
+
9
+ Tue, 23 Jul 2024 20:09:19 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.1.0..@fluentui/react-motion-components-preview_v0.1.1)
11
+
12
+ ### Patches
13
+
14
+ - feat: add Fade motion component ([PR #32020](https://github.com/microsoft/fluentui/pull/32020) by olkatruk@microsoft.com)
15
+ - feat(motion): add Scale motion component ([PR #32021](https://github.com/microsoft/fluentui/pull/32021) by olkatruk@microsoft.com)
16
+
7
17
  ## [0.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.1.0)
8
18
 
9
- Mon, 15 Jul 2024 17:20:20 GMT
19
+ Mon, 15 Jul 2024 17:25:37 GMT
10
20
 
11
21
  ### Minor changes
12
22
 
package/dist/index.d.ts CHANGED
@@ -13,4 +13,24 @@ export declare const CollapseSnappy: PresenceComponent< {
13
13
  animateOpacity?: boolean | undefined;
14
14
  }>;
15
15
 
16
+ /** A React component that applies fade in/out transitions to its children. */
17
+ export declare const Fade: PresenceComponent< {}>;
18
+
19
+ export declare const FadeExaggerated: PresenceComponent< {}>;
20
+
21
+ export declare const FadeSnappy: PresenceComponent< {}>;
22
+
23
+ /** A React component that applies scale in/out transitions to its children. */
24
+ export declare const Scale: PresenceComponent< {
25
+ animateOpacity?: boolean | undefined;
26
+ }>;
27
+
28
+ export declare const ScaleExaggerated: PresenceComponent< {
29
+ animateOpacity?: boolean | undefined;
30
+ }>;
31
+
32
+ export declare const ScaleSnappy: PresenceComponent< {
33
+ animateOpacity?: boolean | undefined;
34
+ }>;
35
+
16
36
  export { }
@@ -0,0 +1,40 @@
1
+ import { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';
2
+ const duration = motionTokens.durationNormal;
3
+ const easing = motionTokens.curveEasyEase;
4
+ /** Define a presence motion for fade in/out */ const fadeMotion = {
5
+ enter: {
6
+ duration,
7
+ easing,
8
+ keyframes: [
9
+ {
10
+ opacity: 0
11
+ },
12
+ {
13
+ opacity: 1
14
+ }
15
+ ]
16
+ },
17
+ exit: {
18
+ duration,
19
+ easing,
20
+ keyframes: [
21
+ {
22
+ opacity: 1
23
+ },
24
+ {
25
+ opacity: 0
26
+ }
27
+ ]
28
+ }
29
+ };
30
+ /** A React component that applies fade in/out transitions to its children. */ export const Fade = createPresenceComponent(fadeMotion);
31
+ export const FadeSnappy = createPresenceComponentVariant(Fade, {
32
+ all: {
33
+ duration: motionTokens.durationFast
34
+ }
35
+ });
36
+ export const FadeExaggerated = createPresenceComponentVariant(Fade, {
37
+ all: {
38
+ duration: motionTokens.durationGentle
39
+ }
40
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Fade.ts"],"sourcesContent":["import {\n motionTokens,\n PresenceMotion,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\nconst duration = motionTokens.durationNormal;\nconst easing = motionTokens.curveEasyEase;\n\n/** Define a presence motion for fade in/out */\nconst fadeMotion: PresenceMotion = {\n enter: { duration, easing, keyframes: [{ opacity: 0 }, { opacity: 1 }] },\n exit: { duration, easing, keyframes: [{ opacity: 1 }, { opacity: 0 }] },\n};\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(fadeMotion);\n\nexport const FadeSnappy = createPresenceComponentVariant(Fade, { all: { duration: motionTokens.durationFast } });\n\nexport const FadeExaggerated = createPresenceComponentVariant(Fade, { all: { duration: motionTokens.durationGentle } });\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","duration","durationNormal","easing","curveEasyEase","fadeMotion","enter","keyframes","opacity","exit","Fade","FadeSnappy","all","durationFast","FadeExaggerated","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EAEZC,uBAAuB,EACvBC,8BAA8B,QACzB,yBAAyB;AAEhC,MAAMC,WAAWH,aAAaI,cAAc;AAC5C,MAAMC,SAASL,aAAaM,aAAa;AAEzC,8CAA8C,GAC9C,MAAMC,aAA6B;IACjCC,OAAO;QAAEL;QAAUE;QAAQI,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;IAAC;IACvEC,MAAM;QAAER;QAAUE;QAAQI,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;IAAC;AACxE;AAEA,4EAA4E,GAC5E,OAAO,MAAME,OAAOX,wBAAwBM,YAAY;AAExD,OAAO,MAAMM,aAAaX,+BAA+BU,MAAM;IAAEE,KAAK;QAAEX,UAAUH,aAAae,YAAY;IAAC;AAAE,GAAG;AAEjH,OAAO,MAAMC,kBAAkBd,+BAA+BU,MAAM;IAAEE,KAAK;QAAEX,UAAUH,aAAaiB,cAAc;IAAC;AAAE,GAAG"}
@@ -0,0 +1 @@
1
+ export * from './Fade';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Fade';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,SAAS"}
@@ -0,0 +1,62 @@
1
+ import { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';
2
+ /** Define a presence motion for scale in/out */ const scaleMotion = ({ animateOpacity = true })=>{
3
+ const fromOpacity = animateOpacity ? 0 : 1;
4
+ const toOpacity = 1;
5
+ const fromScale = 0.9; // Could be a custom param in the future
6
+ const toScale = 1;
7
+ const enterKeyframes = [
8
+ {
9
+ opacity: fromOpacity,
10
+ transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
11
+ visibility: 'visible'
12
+ },
13
+ {
14
+ opacity: toOpacity,
15
+ transform: `scale3d(${toScale}, ${toScale}, 1)`
16
+ }
17
+ ];
18
+ const exitKeyframes = [
19
+ {
20
+ opacity: toOpacity,
21
+ transform: `scale3d(${toScale}, ${toScale}, 1)`
22
+ },
23
+ {
24
+ opacity: fromOpacity,
25
+ transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
26
+ visibility: 'hidden'
27
+ }
28
+ ];
29
+ return {
30
+ enter: {
31
+ duration: motionTokens.durationGentle,
32
+ easing: motionTokens.curveDecelerateMax,
33
+ keyframes: enterKeyframes
34
+ },
35
+ exit: {
36
+ duration: motionTokens.durationNormal,
37
+ easing: motionTokens.curveAccelerateMax,
38
+ keyframes: exitKeyframes
39
+ }
40
+ };
41
+ };
42
+ /** A React component that applies scale in/out transitions to its children. */ export const Scale = createPresenceComponent(scaleMotion);
43
+ export const ScaleSnappy = createPresenceComponentVariant(Scale, {
44
+ enter: {
45
+ duration: motionTokens.durationNormal,
46
+ easing: motionTokens.curveDecelerateMax
47
+ },
48
+ exit: {
49
+ duration: motionTokens.durationFast,
50
+ easing: motionTokens.curveAccelerateMax
51
+ }
52
+ });
53
+ export const ScaleExaggerated = createPresenceComponentVariant(Scale, {
54
+ enter: {
55
+ duration: motionTokens.durationSlow,
56
+ easing: motionTokens.curveDecelerateMax
57
+ },
58
+ exit: {
59
+ duration: motionTokens.durationGentle,
60
+ easing: motionTokens.curveAccelerateMax
61
+ }
62
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Scale.ts"],"sourcesContent":["import {\n motionTokens,\n PresenceMotionFn,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\n/** Define a presence motion for scale in/out */\nconst scaleMotion: PresenceMotionFn<{ animateOpacity?: boolean }> = ({ animateOpacity = true }) => {\n const fromOpacity = animateOpacity ? 0 : 1;\n const toOpacity = 1;\n const fromScale = 0.9; // Could be a custom param in the future\n const toScale = 1;\n\n const enterKeyframes = [\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'visible' },\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'hidden' },\n ];\n\n return {\n enter: {\n duration: motionTokens.durationGentle,\n easing: motionTokens.curveDecelerateMax,\n keyframes: enterKeyframes,\n },\n exit: { duration: motionTokens.durationNormal, easing: motionTokens.curveAccelerateMax, keyframes: exitKeyframes },\n };\n};\n\n/** A React component that applies scale in/out transitions to its children. */\nexport const Scale = createPresenceComponent(scaleMotion);\n\nexport const ScaleSnappy = createPresenceComponentVariant(Scale, {\n enter: { duration: motionTokens.durationNormal, easing: motionTokens.curveDecelerateMax },\n exit: { duration: motionTokens.durationFast, easing: motionTokens.curveAccelerateMax },\n});\n\nexport const ScaleExaggerated = createPresenceComponentVariant(Scale, {\n enter: { duration: motionTokens.durationSlow, easing: motionTokens.curveDecelerateMax },\n exit: { duration: motionTokens.durationGentle, easing: motionTokens.curveAccelerateMax },\n});\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","scaleMotion","animateOpacity","fromOpacity","toOpacity","fromScale","toScale","enterKeyframes","opacity","transform","visibility","exitKeyframes","enter","duration","durationGentle","easing","curveDecelerateMax","keyframes","exit","durationNormal","curveAccelerateMax","Scale","ScaleSnappy","durationFast","ScaleExaggerated","durationSlow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EAEZC,uBAAuB,EACvBC,8BAA8B,QACzB,yBAAyB;AAEhC,8CAA8C,GAC9C,MAAMC,cAA8D,CAAC,EAAEC,iBAAiB,IAAI,EAAE;IAC5F,MAAMC,cAAcD,iBAAiB,IAAI;IACzC,MAAME,YAAY;IAClB,MAAMC,YAAY,KAAK,wCAAwC;IAC/D,MAAMC,UAAU;IAEhB,MAAMC,iBAAiB;QACrB;YAAEC,SAASL;YAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;YAAEK,YAAY;QAAU;QACnG;YAAEF,SAASJ;YAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;QAAC;KACvE;IAED,MAAMK,gBAAgB;QACpB;YAAEH,SAASJ;YAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;QAAC;QACtE;YAAEE,SAASL;YAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;YAAEK,YAAY;QAAS;KACnG;IAED,OAAO;QACLE,OAAO;YACLC,UAAUf,aAAagB,cAAc;YACrCC,QAAQjB,aAAakB,kBAAkB;YACvCC,WAAWV;QACb;QACAW,MAAM;YAAEL,UAAUf,aAAaqB,cAAc;YAAEJ,QAAQjB,aAAasB,kBAAkB;YAAEH,WAAWN;QAAc;IACnH;AACF;AAEA,6EAA6E,GAC7E,OAAO,MAAMU,QAAQtB,wBAAwBE,aAAa;AAE1D,OAAO,MAAMqB,cAActB,+BAA+BqB,OAAO;IAC/DT,OAAO;QAAEC,UAAUf,aAAaqB,cAAc;QAAEJ,QAAQjB,aAAakB,kBAAkB;IAAC;IACxFE,MAAM;QAAEL,UAAUf,aAAayB,YAAY;QAAER,QAAQjB,aAAasB,kBAAkB;IAAC;AACvF,GAAG;AAEH,OAAO,MAAMI,mBAAmBxB,+BAA+BqB,OAAO;IACpET,OAAO;QAAEC,UAAUf,aAAa2B,YAAY;QAAEV,QAAQjB,aAAakB,kBAAkB;IAAC;IACtFE,MAAM;QAAEL,UAAUf,aAAagB,cAAc;QAAEC,QAAQjB,aAAasB,kBAAkB;IAAC;AACzF,GAAG"}
@@ -0,0 +1 @@
1
+ export * from './Scale';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Scale';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,UAAU"}
package/lib/index.js CHANGED
@@ -1 +1,3 @@
1
1
  export { Collapse, CollapseSnappy, CollapseExaggerated } from './components/Collapse';
2
+ export { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';
3
+ export { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseExaggerated } from './components/Collapse';\n"],"names":["Collapse","CollapseSnappy","CollapseExaggerated"],"rangeMappings":"","mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,wBAAwB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseExaggerated } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseSnappy","CollapseExaggerated","Fade","FadeSnappy","FadeExaggerated","Scale","ScaleSnappy","ScaleExaggerated"],"rangeMappings":";;","mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,wBAAwB;AACtF,SAASC,IAAI,EAAEC,UAAU,EAAEC,eAAe,QAAQ,oBAAoB;AACtE,SAASC,KAAK,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,qBAAqB"}
@@ -0,0 +1,61 @@
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
+ Fade: function() {
13
+ return Fade;
14
+ },
15
+ FadeExaggerated: function() {
16
+ return FadeExaggerated;
17
+ },
18
+ FadeSnappy: function() {
19
+ return FadeSnappy;
20
+ }
21
+ });
22
+ const _reactmotion = require("@fluentui/react-motion");
23
+ const duration = _reactmotion.motionTokens.durationNormal;
24
+ const easing = _reactmotion.motionTokens.curveEasyEase;
25
+ /** Define a presence motion for fade in/out */ const fadeMotion = {
26
+ enter: {
27
+ duration,
28
+ easing,
29
+ keyframes: [
30
+ {
31
+ opacity: 0
32
+ },
33
+ {
34
+ opacity: 1
35
+ }
36
+ ]
37
+ },
38
+ exit: {
39
+ duration,
40
+ easing,
41
+ keyframes: [
42
+ {
43
+ opacity: 1
44
+ },
45
+ {
46
+ opacity: 0
47
+ }
48
+ ]
49
+ }
50
+ };
51
+ const Fade = (0, _reactmotion.createPresenceComponent)(fadeMotion);
52
+ const FadeSnappy = (0, _reactmotion.createPresenceComponentVariant)(Fade, {
53
+ all: {
54
+ duration: _reactmotion.motionTokens.durationFast
55
+ }
56
+ });
57
+ const FadeExaggerated = (0, _reactmotion.createPresenceComponentVariant)(Fade, {
58
+ all: {
59
+ duration: _reactmotion.motionTokens.durationGentle
60
+ }
61
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Fade.ts"],"sourcesContent":["import {\n motionTokens,\n PresenceMotion,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\nconst duration = motionTokens.durationNormal;\nconst easing = motionTokens.curveEasyEase;\n\n/** Define a presence motion for fade in/out */\nconst fadeMotion: PresenceMotion = {\n enter: { duration, easing, keyframes: [{ opacity: 0 }, { opacity: 1 }] },\n exit: { duration, easing, keyframes: [{ opacity: 1 }, { opacity: 0 }] },\n};\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(fadeMotion);\n\nexport const FadeSnappy = createPresenceComponentVariant(Fade, { all: { duration: motionTokens.durationFast } });\n\nexport const FadeExaggerated = createPresenceComponentVariant(Fade, { all: { duration: motionTokens.durationGentle } });\n"],"names":["Fade","FadeExaggerated","FadeSnappy","duration","motionTokens","durationNormal","easing","curveEasyEase","fadeMotion","enter","keyframes","opacity","exit","createPresenceComponent","createPresenceComponentVariant","all","durationFast","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAiBaA,IAAAA;eAAAA;;IAIAC,eAAAA;eAAAA;;IAFAC,UAAAA;eAAAA;;;6BAdN;AAEP,MAAMC,WAAWC,yBAAAA,CAAaC,cAAc;AAC5C,MAAMC,SAASF,yBAAAA,CAAaG,aAAa;AAEzC,8CAA8C,GAC9C,MAAMC,aAA6B;IACjCC,OAAO;QAAEN;QAAUG;QAAQI,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;IAAC;IACvEC,MAAM;QAAET;QAAUG;QAAQI,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;IAAC;AACxE;AAGO,MAAMX,OAAOa,IAAAA,oCAAAA,EAAwBL;AAErC,MAAMN,aAAaY,IAAAA,2CAAAA,EAA+Bd,MAAM;IAAEe,KAAK;QAAEZ,UAAUC,yBAAAA,CAAaY,YAAY;IAAC;AAAE;AAEvG,MAAMf,kBAAkBa,IAAAA,2CAAAA,EAA+Bd,MAAM;IAAEe,KAAK;QAAEZ,UAAUC,yBAAAA,CAAaa,cAAc;IAAC;AAAE"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./Fade"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Fade';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -0,0 +1,83 @@
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
+ Scale: function() {
13
+ return Scale;
14
+ },
15
+ ScaleExaggerated: function() {
16
+ return ScaleExaggerated;
17
+ },
18
+ ScaleSnappy: function() {
19
+ return ScaleSnappy;
20
+ }
21
+ });
22
+ const _reactmotion = require("@fluentui/react-motion");
23
+ /** Define a presence motion for scale in/out */ const scaleMotion = ({ animateOpacity = true })=>{
24
+ const fromOpacity = animateOpacity ? 0 : 1;
25
+ const toOpacity = 1;
26
+ const fromScale = 0.9; // Could be a custom param in the future
27
+ const toScale = 1;
28
+ const enterKeyframes = [
29
+ {
30
+ opacity: fromOpacity,
31
+ transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
32
+ visibility: 'visible'
33
+ },
34
+ {
35
+ opacity: toOpacity,
36
+ transform: `scale3d(${toScale}, ${toScale}, 1)`
37
+ }
38
+ ];
39
+ const exitKeyframes = [
40
+ {
41
+ opacity: toOpacity,
42
+ transform: `scale3d(${toScale}, ${toScale}, 1)`
43
+ },
44
+ {
45
+ opacity: fromOpacity,
46
+ transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
47
+ visibility: 'hidden'
48
+ }
49
+ ];
50
+ return {
51
+ enter: {
52
+ duration: _reactmotion.motionTokens.durationGentle,
53
+ easing: _reactmotion.motionTokens.curveDecelerateMax,
54
+ keyframes: enterKeyframes
55
+ },
56
+ exit: {
57
+ duration: _reactmotion.motionTokens.durationNormal,
58
+ easing: _reactmotion.motionTokens.curveAccelerateMax,
59
+ keyframes: exitKeyframes
60
+ }
61
+ };
62
+ };
63
+ const Scale = (0, _reactmotion.createPresenceComponent)(scaleMotion);
64
+ const ScaleSnappy = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
65
+ enter: {
66
+ duration: _reactmotion.motionTokens.durationNormal,
67
+ easing: _reactmotion.motionTokens.curveDecelerateMax
68
+ },
69
+ exit: {
70
+ duration: _reactmotion.motionTokens.durationFast,
71
+ easing: _reactmotion.motionTokens.curveAccelerateMax
72
+ }
73
+ });
74
+ const ScaleExaggerated = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
75
+ enter: {
76
+ duration: _reactmotion.motionTokens.durationSlow,
77
+ easing: _reactmotion.motionTokens.curveDecelerateMax
78
+ },
79
+ exit: {
80
+ duration: _reactmotion.motionTokens.durationGentle,
81
+ easing: _reactmotion.motionTokens.curveAccelerateMax
82
+ }
83
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Scale.ts"],"sourcesContent":["import {\n motionTokens,\n PresenceMotionFn,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\n/** Define a presence motion for scale in/out */\nconst scaleMotion: PresenceMotionFn<{ animateOpacity?: boolean }> = ({ animateOpacity = true }) => {\n const fromOpacity = animateOpacity ? 0 : 1;\n const toOpacity = 1;\n const fromScale = 0.9; // Could be a custom param in the future\n const toScale = 1;\n\n const enterKeyframes = [\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'visible' },\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'hidden' },\n ];\n\n return {\n enter: {\n duration: motionTokens.durationGentle,\n easing: motionTokens.curveDecelerateMax,\n keyframes: enterKeyframes,\n },\n exit: { duration: motionTokens.durationNormal, easing: motionTokens.curveAccelerateMax, keyframes: exitKeyframes },\n };\n};\n\n/** A React component that applies scale in/out transitions to its children. */\nexport const Scale = createPresenceComponent(scaleMotion);\n\nexport const ScaleSnappy = createPresenceComponentVariant(Scale, {\n enter: { duration: motionTokens.durationNormal, easing: motionTokens.curveDecelerateMax },\n exit: { duration: motionTokens.durationFast, easing: motionTokens.curveAccelerateMax },\n});\n\nexport const ScaleExaggerated = createPresenceComponentVariant(Scale, {\n enter: { duration: motionTokens.durationSlow, easing: motionTokens.curveDecelerateMax },\n exit: { duration: motionTokens.durationGentle, easing: motionTokens.curveAccelerateMax },\n});\n"],"names":["Scale","ScaleExaggerated","ScaleSnappy","scaleMotion","animateOpacity","fromOpacity","toOpacity","fromScale","toScale","enterKeyframes","opacity","transform","visibility","exitKeyframes","enter","duration","motionTokens","durationGentle","easing","curveDecelerateMax","keyframes","exit","durationNormal","curveAccelerateMax","createPresenceComponent","createPresenceComponentVariant","durationFast","durationSlow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAmCaA,KAAAA;eAAAA;;IAOAC,gBAAAA;eAAAA;;IALAC,WAAAA;eAAAA;;;6BAhCN;AAEP,8CAA8C,GAC9C,MAAMC,cAA8D,CAAC,EAAEC,iBAAiB,IAAI,EAAE;IAC5F,MAAMC,cAAcD,iBAAiB,IAAI;IACzC,MAAME,YAAY;IAClB,MAAMC,YAAY,KAAK,wCAAwC;IAC/D,MAAMC,UAAU;IAEhB,MAAMC,iBAAiB;QACrB;YAAEC,SAASL;YAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;YAAEK,YAAY;QAAU;QACnG;YAAEF,SAASJ;YAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;QAAC;KACvE;IAED,MAAMK,gBAAgB;QACpB;YAAEH,SAASJ;YAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;QAAC;QACtE;YAAEE,SAASL;YAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;YAAEK,YAAY;QAAS;KACnG;IAED,OAAO;QACLE,OAAO;YACLC,UAAUC,yBAAAA,CAAaC,cAAc;YACrCC,QAAQF,yBAAAA,CAAaG,kBAAkB;YACvCC,WAAWX;QACb;QACAY,MAAM;YAAEN,UAAUC,yBAAAA,CAAaM,cAAc;YAAEJ,QAAQF,yBAAAA,CAAaO,kBAAkB;YAAEH,WAAWP;QAAc;IACnH;AACF;AAGO,MAAMb,QAAQwB,IAAAA,oCAAAA,EAAwBrB;AAEtC,MAAMD,cAAcuB,IAAAA,2CAAAA,EAA+BzB,OAAO;IAC/Dc,OAAO;QAAEC,UAAUC,yBAAAA,CAAaM,cAAc;QAAEJ,QAAQF,yBAAAA,CAAaG,kBAAkB;IAAC;IACxFE,MAAM;QAAEN,UAAUC,yBAAAA,CAAaU,YAAY;QAAER,QAAQF,yBAAAA,CAAaO,kBAAkB;IAAC;AACvF;AAEO,MAAMtB,mBAAmBwB,IAAAA,2CAAAA,EAA+BzB,OAAO;IACpEc,OAAO;QAAEC,UAAUC,yBAAAA,CAAaW,YAAY;QAAET,QAAQF,yBAAAA,CAAaG,kBAAkB;IAAC;IACtFE,MAAM;QAAEN,UAAUC,yBAAAA,CAAaC,cAAc;QAAEC,QAAQF,yBAAAA,CAAaO,kBAAkB;IAAC;AACzF"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./Scale"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Scale';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -17,6 +17,26 @@ _export(exports, {
17
17
  },
18
18
  CollapseSnappy: function() {
19
19
  return _Collapse.CollapseSnappy;
20
+ },
21
+ Fade: function() {
22
+ return _Fade.Fade;
23
+ },
24
+ FadeExaggerated: function() {
25
+ return _Fade.FadeExaggerated;
26
+ },
27
+ FadeSnappy: function() {
28
+ return _Fade.FadeSnappy;
29
+ },
30
+ Scale: function() {
31
+ return _Scale.Scale;
32
+ },
33
+ ScaleExaggerated: function() {
34
+ return _Scale.ScaleExaggerated;
35
+ },
36
+ ScaleSnappy: function() {
37
+ return _Scale.ScaleSnappy;
20
38
  }
21
39
  });
22
40
  const _Collapse = require("./components/Collapse");
41
+ const _Fade = require("./components/Fade");
42
+ const _Scale = require("./components/Scale");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseExaggerated } from './components/Collapse';\n"],"names":["Collapse","CollapseExaggerated","CollapseSnappy"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAAkBC,mBAAmB;eAAnBA,6BAAmB;;IAAnCC,cAAc;eAAdA,wBAAc;;;0BAA6B"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { Collapse, CollapseSnappy, CollapseExaggerated } from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseExaggerated","CollapseSnappy","Fade","FadeExaggerated","FadeSnappy","Scale","ScaleExaggerated","ScaleSnappy"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAAkBC,mBAAmB;eAAnBA,6BAAmB;;IAAnCC,cAAc;eAAdA,wBAAc;;IACxBC,IAAI;eAAJA,UAAI;;IAAcC,eAAe;eAAfA,qBAAe;;IAA3BC,UAAU;eAAVA,gBAAU;;IAChBC,KAAK;eAALA,YAAK;;IAAeC,gBAAgB;eAAhBA,uBAAgB;;IAA7BC,WAAW;eAAXA,kBAAW;;;0BAFmC;sBACZ;uBACG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-motion-components-preview",
3
- "version": "0.1.0",
3
+ "version": "0.1.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",