@fluentui/react-motion-components-preview 0.0.0-nightly-20241022-0408.1 → 0.0.0-nightly-20241025-0408.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,20 +1,20 @@
1
1
  # Change Log - @fluentui/react-motion-components-preview
2
2
 
3
- This log was last generated on Tue, 22 Oct 2024 04:13:00 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 25 Oct 2024 04:13:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20241022-0408.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20241022-0408.1)
7
+ ## [0.0.0-nightly-20241025-0408.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.0.0-nightly-20241025-0408.1)
8
8
 
9
- Tue, 22 Oct 2024 04:13:00 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.2.0..@fluentui/react-motion-components-preview_v0.0.0-nightly-20241022-0408.1)
9
+ Fri, 25 Oct 2024 04:13:26 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.2.0..@fluentui/react-motion-components-preview_v0.0.0-nightly-20241025-0408.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-20241022-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/34387c50336474b28c7676ffe0d9dacee23d478c) by beachball)
16
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20241022-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/34387c50336474b28c7676ffe0d9dacee23d478c) by beachball)
17
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20241022-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/34387c50336474b28c7676ffe0d9dacee23d478c) by beachball)
15
+ - Bump @fluentui/react-motion to v0.0.0-nightly-20241025-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/3012e825c951e5a060b596b5e04b86f7403bdc30) by beachball)
16
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20241025-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/3012e825c951e5a060b596b5e04b86f7403bdc30) by beachball)
17
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20241025-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/3012e825c951e5a060b596b5e04b86f7403bdc30) by beachball)
18
18
 
19
19
  ## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.2.0)
20
20
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { MotionParam } from '@fluentui/react-motion';
2
2
  import { PresenceComponent } from '@fluentui/react-motion';
3
+ import type { PresenceMotion } from '@fluentui/react-motion';
3
4
  import type { PresenceMotionFn } from '@fluentui/react-motion';
4
5
 
5
6
  /** A React component that applies collapse/expand transitions to its children. */
@@ -56,6 +57,9 @@ export declare const createCollapseDelayedPresence: PresenceMotionFnCreator<Coll
56
57
  /** Defines a presence motion for collapse/expand. */
57
58
  export declare const createCollapsePresence: PresenceMotionFnCreator<CollapseVariantParams, CollapseRuntimeParams>;
58
59
 
60
+ /** Define a presence motion for fade in/out */
61
+ export declare const createFadePresence: PresenceMotionCreator<FadeVariantParams>;
62
+
59
63
  /** A React component that applies fade in/out transitions to its children. */
60
64
  export declare const Fade: PresenceComponent< {}>;
61
65
 
@@ -63,6 +67,26 @@ export declare const FadeExaggerated: PresenceComponent< {}>;
63
67
 
64
68
  export declare const FadeSnappy: PresenceComponent< {}>;
65
69
 
70
+ declare type FadeVariantParams = {
71
+ /** Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms). */
72
+ enterDuration?: number;
73
+ /** Easing curve for the enter transition (fade-in). Defaults to the `easeEase` value. */
74
+ enterEasing?: string;
75
+ /** Time (ms) for the exit transition (fade-out). Defaults to the `enterDuration` param for symmetry. */
76
+ exitDuration?: number;
77
+ /** Easing curve for the exit transition (fade-out). Defaults to the `enterEasing` param for symmetry. */
78
+ exitEasing?: string;
79
+ };
80
+
81
+ /**
82
+ * This is a factory function that generates a motion object from variant params, e.g. duration, easing, etc.
83
+ * The generated object defines a presence motion with `enter` and `exit` transitions.
84
+ * This motion object is declarative, i.e. data without side effects,
85
+ * and it is framework-independent, i.e. non-React.
86
+ * It can be turned into a React component using `createPresenceComponent`.
87
+ */
88
+ declare type PresenceMotionCreator<MotionVariantParams extends Record<string, MotionParam> = {}> = (variantParams?: MotionVariantParams) => PresenceMotion;
89
+
66
90
  /**
67
91
  * This is a factory function that generates a motion function, which has variant params bound into it.
68
92
  * The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.
@@ -1,40 +1,34 @@
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
- });
1
+ import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';
2
+ /** Define a presence motion for fade in/out */ export const createFadePresence = ({ enterDuration = motionTokens.durationNormal, enterEasing = motionTokens.curveEasyEase, exitDuration = enterDuration, exitEasing = enterEasing } = {})=>({
3
+ enter: {
4
+ duration: enterDuration,
5
+ easing: enterEasing,
6
+ keyframes: [
7
+ {
8
+ opacity: 0
9
+ },
10
+ {
11
+ opacity: 1
12
+ }
13
+ ]
14
+ },
15
+ exit: {
16
+ duration: exitDuration,
17
+ easing: exitEasing,
18
+ keyframes: [
19
+ {
20
+ opacity: 1
21
+ },
22
+ {
23
+ opacity: 0
24
+ }
25
+ ]
26
+ }
27
+ });
28
+ /** A React component that applies fade in/out transitions to its children. */ export const Fade = createPresenceComponent(createFadePresence());
29
+ export const FadeSnappy = createPresenceComponent(createFadePresence({
30
+ enterDuration: motionTokens.durationFast
31
+ }));
32
+ export const FadeExaggerated = createPresenceComponent(createFadePresence({
33
+ enterDuration: motionTokens.durationGentle
34
+ }));
@@ -1 +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"}
1
+ {"version":3,"sources":["Fade.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';\nimport type { PresenceMotionCreator } from '../../types';\n\ntype FadeVariantParams = {\n /** Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms). */\n enterDuration?: number;\n\n /** Easing curve for the enter transition (fade-in). Defaults to the `easeEase` value. */\n enterEasing?: string;\n\n /** Time (ms) for the exit transition (fade-out). Defaults to the `enterDuration` param for symmetry. */\n exitDuration?: number;\n\n /** Easing curve for the exit transition (fade-out). Defaults to the `enterEasing` param for symmetry. */\n exitEasing?: string;\n};\n\n/** Define a presence motion for fade in/out */\nexport const createFadePresence: PresenceMotionCreator<FadeVariantParams> = ({\n enterDuration = motionTokens.durationNormal,\n enterEasing = motionTokens.curveEasyEase,\n exitDuration = enterDuration,\n exitEasing = enterEasing,\n} = {}) => ({\n enter: { duration: enterDuration, easing: enterEasing, keyframes: [{ opacity: 0 }, { opacity: 1 }] },\n exit: { duration: exitDuration, easing: exitEasing, keyframes: [{ opacity: 1 }, { opacity: 0 }] },\n});\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(createFadePresence());\n\nexport const FadeSnappy = createPresenceComponent(createFadePresence({ enterDuration: motionTokens.durationFast }));\n\nexport const FadeExaggerated = createPresenceComponent(\n createFadePresence({ enterDuration: motionTokens.durationGentle }),\n);\n"],"names":["motionTokens","createPresenceComponent","createFadePresence","enterDuration","durationNormal","enterEasing","curveEasyEase","exitDuration","exitEasing","enter","duration","easing","keyframes","opacity","exit","Fade","FadeSnappy","durationFast","FadeExaggerated","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAAQ,yBAAyB;AAiB/E,8CAA8C,GAC9C,OAAO,MAAMC,qBAA+D,CAAC,EAC3EC,gBAAgBH,aAAaI,cAAc,EAC3CC,cAAcL,aAAaM,aAAa,EACxCC,eAAeJ,aAAa,EAC5BK,aAAaH,WAAW,EACzB,GAAG,CAAC,CAAC,GAAM,CAAA;QACVI,OAAO;YAAEC,UAAUP;YAAeQ,QAAQN;YAAaO,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;QAAC;QACnGC,MAAM;YAAEJ,UAAUH;YAAcI,QAAQH;YAAYI,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;QAAC;IAClG,CAAA,EAAG;AAEH,4EAA4E,GAC5E,OAAO,MAAME,OAAOd,wBAAwBC,sBAAsB;AAElE,OAAO,MAAMc,aAAaf,wBAAwBC,mBAAmB;IAAEC,eAAeH,aAAaiB,YAAY;AAAC,IAAI;AAEpH,OAAO,MAAMC,kBAAkBjB,wBAC7BC,mBAAmB;IAAEC,eAAeH,aAAamB,cAAc;AAAC,IAChE"}
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { Collapse, CollapseSnappy, CollapseExaggerated, CollapseDelayed, createCollapsePresence, createCollapseDelayedPresence } from './components/Collapse';
2
- export { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';
2
+ export { Fade, FadeSnappy, FadeExaggerated, createFadePresence } from './components/Fade';
3
3
  export { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseExaggerated,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseSnappy","CollapseExaggerated","CollapseDelayed","createCollapsePresence","createCollapseDelayedPresence","Fade","FadeSnappy","FadeExaggerated","Scale","ScaleSnappy","ScaleExaggerated"],"rangeMappings":";;","mappings":"AAAA,SACEA,QAAQ,EACRC,cAAc,EACdC,mBAAmB,EACnBC,eAAe,EACfC,sBAAsB,EACtBC,6BAA6B,QACxB,wBAAwB;AAC/B,SAASC,IAAI,EAAEC,UAAU,EAAEC,eAAe,QAAQ,oBAAoB;AACtE,SAASC,KAAK,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,qBAAqB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseExaggerated,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated, createFadePresence } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseSnappy","CollapseExaggerated","CollapseDelayed","createCollapsePresence","createCollapseDelayedPresence","Fade","FadeSnappy","FadeExaggerated","createFadePresence","Scale","ScaleSnappy","ScaleExaggerated"],"rangeMappings":";;","mappings":"AAAA,SACEA,QAAQ,EACRC,cAAc,EACdC,mBAAmB,EACnBC,eAAe,EACfC,sBAAsB,EACtBC,6BAA6B,QACxB,wBAAwB;AAC/B,SAASC,IAAI,EAAEC,UAAU,EAAEC,eAAe,EAAEC,kBAAkB,QAAQ,oBAAoB;AAC1F,SAASC,KAAK,EAAEC,WAAW,EAAEC,gBAAgB,QAAQ,qBAAqB"}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"sourcesContent":["import type { MotionParam, PresenceMotionFn } from '@fluentui/react-motion';\n\n/**\n * This is a factory function that generates a motion function, which has variant params bound into it.\n * The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.\n * This separation allows the variant to be defined once and reused with different runtime params which may be orthogonal to the variant params.\n * For example, a variant may define the duration and easing of a transition, which are fixed for all instances of the variant,\n * while the runtime params may give access to the target element, which is different for each instance.\n *\n * The generated motion function is also framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionFnCreator<\n MotionVariantParams extends Record<string, MotionParam> = {},\n MotionRuntimeParams extends Record<string, MotionParam> = {},\n> = (variantParams?: MotionVariantParams) => PresenceMotionFn<MotionRuntimeParams>;\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":"AAEA;;;;;;;;;CASC,GACD,mDAAmD;AACnD,WAGmF"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import type { MotionParam, PresenceMotion, PresenceMotionFn } from '@fluentui/react-motion';\n\n/**\n * This is a factory function that generates a motion object from variant params, e.g. duration, easing, etc.\n * The generated object defines a presence motion with `enter` and `exit` transitions.\n * This motion object is declarative, i.e. data without side effects,\n * and it is framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionCreator<MotionVariantParams extends Record<string, MotionParam> = {}> = (\n variantParams?: MotionVariantParams,\n) => PresenceMotion;\n\n/**\n * This is a factory function that generates a motion function, which has variant params bound into it.\n * The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.\n * This separation allows the variant to be defined once and reused with different runtime params which may be orthogonal to the variant params.\n * For example, a variant may define the duration and easing of a transition, which are fixed for all instances of the variant,\n * while the runtime params may give access to the target element, which is different for each instance.\n *\n * The generated motion function is also framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionFnCreator<\n MotionVariantParams extends Record<string, MotionParam> = {},\n MotionRuntimeParams extends Record<string, MotionParam> = {},\n> = (variantParams?: MotionVariantParams) => PresenceMotionFn<MotionRuntimeParams>;\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":"AAcA;;;;;;;;;CASC,GACD,mDAAmD;AACnD,WAGmF"}
@@ -17,45 +17,42 @@ _export(exports, {
17
17
  },
18
18
  FadeSnappy: function() {
19
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
20
  },
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
21
+ createFadePresence: function() {
22
+ return createFadePresence;
60
23
  }
61
24
  });
25
+ const _reactmotion = require("@fluentui/react-motion");
26
+ const createFadePresence = ({ enterDuration = _reactmotion.motionTokens.durationNormal, enterEasing = _reactmotion.motionTokens.curveEasyEase, exitDuration = enterDuration, exitEasing = enterEasing } = {})=>({
27
+ enter: {
28
+ duration: enterDuration,
29
+ easing: enterEasing,
30
+ keyframes: [
31
+ {
32
+ opacity: 0
33
+ },
34
+ {
35
+ opacity: 1
36
+ }
37
+ ]
38
+ },
39
+ exit: {
40
+ duration: exitDuration,
41
+ easing: exitEasing,
42
+ keyframes: [
43
+ {
44
+ opacity: 1
45
+ },
46
+ {
47
+ opacity: 0
48
+ }
49
+ ]
50
+ }
51
+ });
52
+ const Fade = (0, _reactmotion.createPresenceComponent)(createFadePresence());
53
+ const FadeSnappy = (0, _reactmotion.createPresenceComponent)(createFadePresence({
54
+ enterDuration: _reactmotion.motionTokens.durationFast
55
+ }));
56
+ const FadeExaggerated = (0, _reactmotion.createPresenceComponent)(createFadePresence({
57
+ enterDuration: _reactmotion.motionTokens.durationGentle
58
+ }));
@@ -1 +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"}
1
+ {"version":3,"sources":["Fade.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';\nimport type { PresenceMotionCreator } from '../../types';\n\ntype FadeVariantParams = {\n /** Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms). */\n enterDuration?: number;\n\n /** Easing curve for the enter transition (fade-in). Defaults to the `easeEase` value. */\n enterEasing?: string;\n\n /** Time (ms) for the exit transition (fade-out). Defaults to the `enterDuration` param for symmetry. */\n exitDuration?: number;\n\n /** Easing curve for the exit transition (fade-out). Defaults to the `enterEasing` param for symmetry. */\n exitEasing?: string;\n};\n\n/** Define a presence motion for fade in/out */\nexport const createFadePresence: PresenceMotionCreator<FadeVariantParams> = ({\n enterDuration = motionTokens.durationNormal,\n enterEasing = motionTokens.curveEasyEase,\n exitDuration = enterDuration,\n exitEasing = enterEasing,\n} = {}) => ({\n enter: { duration: enterDuration, easing: enterEasing, keyframes: [{ opacity: 0 }, { opacity: 1 }] },\n exit: { duration: exitDuration, easing: exitEasing, keyframes: [{ opacity: 1 }, { opacity: 0 }] },\n});\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(createFadePresence());\n\nexport const FadeSnappy = createPresenceComponent(createFadePresence({ enterDuration: motionTokens.durationFast }));\n\nexport const FadeExaggerated = createPresenceComponent(\n createFadePresence({ enterDuration: motionTokens.durationGentle }),\n);\n"],"names":["Fade","FadeExaggerated","FadeSnappy","createFadePresence","enterDuration","motionTokens","durationNormal","enterEasing","curveEasyEase","exitDuration","exitEasing","enter","duration","easing","keyframes","opacity","exit","createPresenceComponent","durationFast","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6BaA,IAAAA;eAAAA;;IAIAC,eAAAA;eAAAA;;IAFAC,UAAAA;eAAAA;;IAbAC,kBAAAA;eAAAA;;;6BAlByC;AAkB/C,MAAMA,qBAA+D,CAAC,EAC3EC,gBAAgBC,yBAAAA,CAAaC,cAAc,EAC3CC,cAAcF,yBAAAA,CAAaG,aAAa,EACxCC,eAAeL,aAAa,EAC5BM,aAAaH,WAAW,EACzB,GAAG,CAAC,CAAC,GAAM,CAAA;QACVI,OAAO;YAAEC,UAAUR;YAAeS,QAAQN;YAAaO,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;QAAC;QACnGC,MAAM;YAAEJ,UAAUH;YAAcI,QAAQH;YAAYI,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;QAAC;IAClG,CAAA;AAGO,MAAMf,OAAOiB,IAAAA,oCAAAA,EAAwBd;AAErC,MAAMD,aAAae,IAAAA,oCAAAA,EAAwBd,mBAAmB;IAAEC,eAAeC,yBAAAA,CAAaa,YAAY;AAAC;AAEzG,MAAMjB,kBAAkBgB,IAAAA,oCAAAA,EAC7Bd,mBAAmB;IAAEC,eAAeC,yBAAAA,CAAac,cAAc;AAAC"}
@@ -44,6 +44,9 @@ _export(exports, {
44
44
  },
45
45
  createCollapsePresence: function() {
46
46
  return _Collapse.createCollapsePresence;
47
+ },
48
+ createFadePresence: function() {
49
+ return _Fade.createFadePresence;
47
50
  }
48
51
  });
49
52
  const _Collapse = require("./components/Collapse");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseExaggerated,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseDelayed","CollapseExaggerated","CollapseSnappy","Fade","FadeExaggerated","FadeSnappy","Scale","ScaleExaggerated","ScaleSnappy","createCollapseDelayedPresence","createCollapsePresence"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,QAAQ;eAARA,kBAAQ;;IAGRC,eAAe;eAAfA,yBAAe;;IADfC,mBAAmB;eAAnBA,6BAAmB;;IADnBC,cAAc;eAAdA,wBAAc;;IAMPC,IAAI;eAAJA,UAAI;;IAAcC,eAAe;eAAfA,qBAAe;;IAA3BC,UAAU;eAAVA,gBAAU;;IAChBC,KAAK;eAALA,YAAK;;IAAeC,gBAAgB;eAAhBA,uBAAgB;;IAA7BC,WAAW;eAAXA,kBAAW;;IAHzBC,6BAA6B;eAA7BA,uCAA6B;;IAD7BC,sBAAsB;eAAtBA,gCAAsB;;;0BAEjB;sBAC2C;uBACG"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Collapse,\n CollapseSnappy,\n CollapseExaggerated,\n CollapseDelayed,\n createCollapsePresence,\n createCollapseDelayedPresence,\n} from './components/Collapse';\nexport { Fade, FadeSnappy, FadeExaggerated, createFadePresence } from './components/Fade';\nexport { Scale, ScaleSnappy, ScaleExaggerated } from './components/Scale';\n"],"names":["Collapse","CollapseDelayed","CollapseExaggerated","CollapseSnappy","Fade","FadeExaggerated","FadeSnappy","Scale","ScaleExaggerated","ScaleSnappy","createCollapseDelayedPresence","createCollapsePresence","createFadePresence"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,QAAQ;eAARA,kBAAQ;;IAGRC,eAAe;eAAfA,yBAAe;;IADfC,mBAAmB;eAAnBA,6BAAmB;;IADnBC,cAAc;eAAdA,wBAAc;;IAMPC,IAAI;eAAJA,UAAI;;IAAcC,eAAe;eAAfA,qBAAe;;IAA3BC,UAAU;eAAVA,gBAAU;;IAChBC,KAAK;eAALA,YAAK;;IAAeC,gBAAgB;eAAhBA,uBAAgB;;IAA7BC,WAAW;eAAXA,kBAAW;;IAHzBC,6BAA6B;eAA7BA,uCAA6B;;IAD7BC,sBAAsB;eAAtBA,gCAAsB;;IAGoBC,kBAAkB;eAAlBA,wBAAkB;;;0BADvD;sBAC+D;uBACjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"sourcesContent":["import type { MotionParam, PresenceMotionFn } from '@fluentui/react-motion';\n\n/**\n * This is a factory function that generates a motion function, which has variant params bound into it.\n * The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.\n * This separation allows the variant to be defined once and reused with different runtime params which may be orthogonal to the variant params.\n * For example, a variant may define the duration and easing of a transition, which are fixed for all instances of the variant,\n * while the runtime params may give access to the target element, which is different for each instance.\n *\n * The generated motion function is also framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionFnCreator<\n MotionVariantParams extends Record<string, MotionParam> = {},\n MotionRuntimeParams extends Record<string, MotionParam> = {},\n> = (variantParams?: MotionVariantParams) => PresenceMotionFn<MotionRuntimeParams>;\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":"AAEA;;;;;;;;;CASC,GACD,mDAAmD"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import type { MotionParam, PresenceMotion, PresenceMotionFn } from '@fluentui/react-motion';\n\n/**\n * This is a factory function that generates a motion object from variant params, e.g. duration, easing, etc.\n * The generated object defines a presence motion with `enter` and `exit` transitions.\n * This motion object is declarative, i.e. data without side effects,\n * and it is framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionCreator<MotionVariantParams extends Record<string, MotionParam> = {}> = (\n variantParams?: MotionVariantParams,\n) => PresenceMotion;\n\n/**\n * This is a factory function that generates a motion function, which has variant params bound into it.\n * The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.\n * This separation allows the variant to be defined once and reused with different runtime params which may be orthogonal to the variant params.\n * For example, a variant may define the duration and easing of a transition, which are fixed for all instances of the variant,\n * while the runtime params may give access to the target element, which is different for each instance.\n *\n * The generated motion function is also framework-independent, i.e. non-React.\n * It can be turned into a React component using `createPresenceComponent`.\n */\n// TODO: move to @fluentui/react-motion when stable\nexport type PresenceMotionFnCreator<\n MotionVariantParams extends Record<string, MotionParam> = {},\n MotionRuntimeParams extends Record<string, MotionParam> = {},\n> = (variantParams?: MotionVariantParams) => PresenceMotionFn<MotionRuntimeParams>;\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":"AAcA;;;;;;;;;CASC,GACD,mDAAmD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-motion-components-preview",
3
- "version": "0.0.0-nightly-20241022-0408.1",
3
+ "version": "0.0.0-nightly-20241025-0408.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",
@@ -29,13 +29,13 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@fluentui/eslint-plugin": "*",
32
- "@fluentui/react-conformance": "0.0.0-nightly-20241022-0408.1",
33
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20241022-0408.1",
32
+ "@fluentui/react-conformance": "0.0.0-nightly-20241025-0408.1",
33
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20241025-0408.1",
34
34
  "@fluentui/scripts-api-extractor": "*",
35
35
  "@fluentui/scripts-tasks": "*"
36
36
  },
37
37
  "dependencies": {
38
- "@fluentui/react-motion": "0.0.0-nightly-20241022-0408.1",
38
+ "@fluentui/react-motion": "0.0.0-nightly-20241025-0408.1",
39
39
  "@swc/helpers": "^0.5.1"
40
40
  },
41
41
  "peerDependencies": {