@fluentui/react-motion-components-preview 0.0.0-nightly-20240723-0406.1 → 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 +7 -9
- package/dist/index.d.ts +36 -0
- package/lib/components/Collapse/Collapse.js +71 -0
- package/lib/components/Collapse/Collapse.js.map +1 -0
- package/lib/components/Collapse/index.js +1 -0
- package/lib/components/Collapse/index.js.map +1 -0
- package/lib/components/Fade/Fade.js +40 -0
- package/lib/components/Fade/Fade.js.map +1 -0
- package/lib/components/Fade/index.js +1 -0
- package/lib/components/Fade/index.js.map +1 -0
- package/lib/components/Scale/Scale.js +62 -0
- package/lib/components/Scale/Scale.js.map +1 -0
- package/lib/components/Scale/index.js +1 -0
- package/lib/components/Scale/index.js.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/components/Collapse/Collapse.js +92 -0
- package/lib-commonjs/components/Collapse/Collapse.js.map +1 -0
- package/lib-commonjs/components/Collapse/index.js +6 -0
- package/lib-commonjs/components/Collapse/index.js.map +1 -0
- package/lib-commonjs/components/Fade/Fade.js +61 -0
- package/lib-commonjs/components/Fade/Fade.js.map +1 -0
- package/lib-commonjs/components/Fade/index.js +6 -0
- package/lib-commonjs/components/Fade/index.js.map +1 -0
- package/lib-commonjs/components/Scale/Scale.js +83 -0
- package/lib-commonjs/components/Scale/Scale.js.map +1 -0
- package/lib-commonjs/components/Scale/index.js +6 -0
- package/lib-commonjs/components/Scale/index.js.map +1 -0
- package/lib-commonjs/index.js +42 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
# Change Log - @fluentui/react-motion-components-preview
|
2
2
|
|
3
|
-
This log was last generated on Tue, 23 Jul 2024
|
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.
|
7
|
+
## [0.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.1.1)
|
8
8
|
|
9
|
-
Tue, 23 Jul 2024
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.1.0..@fluentui/react-motion-components-preview_v0.
|
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
11
|
|
12
|
-
###
|
12
|
+
### Patches
|
13
13
|
|
14
|
-
-
|
15
|
-
-
|
16
|
-
- Bump @fluentui/react-conformance to v0.0.0-nightly-20240723-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/1218096ed9f02bd5bb5860d3e0b464620998382c) by beachball)
|
17
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20240723-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/1218096ed9f02bd5bb5860d3e0b464620998382c) by beachball)
|
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)
|
18
16
|
|
19
17
|
## [0.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.1.0)
|
20
18
|
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
import { PresenceComponent } from '@fluentui/react-motion';
|
2
|
+
|
3
|
+
/** A React component that applies collapse/expand transitions to its children. */
|
4
|
+
export declare const Collapse: PresenceComponent< {
|
5
|
+
animateOpacity?: boolean | undefined;
|
6
|
+
}>;
|
7
|
+
|
8
|
+
export declare const CollapseExaggerated: PresenceComponent< {
|
9
|
+
animateOpacity?: boolean | undefined;
|
10
|
+
}>;
|
11
|
+
|
12
|
+
export declare const CollapseSnappy: PresenceComponent< {
|
13
|
+
animateOpacity?: boolean | undefined;
|
14
|
+
}>;
|
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
|
+
|
36
|
+
export { }
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';
|
2
|
+
/** Define a presence motion for collapse/expand */ const collapseMotion = ({ element, animateOpacity = true })=>{
|
3
|
+
const fromOpacity = animateOpacity ? 0 : 1;
|
4
|
+
const toOpacity = 1;
|
5
|
+
const fromHeight = '0'; // Could be a custom param in the future: start partially expanded
|
6
|
+
const toHeight = `${element.scrollHeight}px`;
|
7
|
+
const overflow = 'hidden';
|
8
|
+
const duration = motionTokens.durationNormal;
|
9
|
+
const easing = motionTokens.curveEasyEaseMax;
|
10
|
+
const enterKeyframes = [
|
11
|
+
{
|
12
|
+
opacity: fromOpacity,
|
13
|
+
maxHeight: fromHeight,
|
14
|
+
overflow
|
15
|
+
},
|
16
|
+
// Transition to the height of the content, at 99.99% of the duration.
|
17
|
+
{
|
18
|
+
opacity: toOpacity,
|
19
|
+
maxHeight: toHeight,
|
20
|
+
offset: 0.9999,
|
21
|
+
overflow
|
22
|
+
},
|
23
|
+
// On completion, remove the maxHeight because the content might need to expand later.
|
24
|
+
// This extra keyframe is simpler than firing a callback on completion.
|
25
|
+
{
|
26
|
+
opacity: toOpacity,
|
27
|
+
maxHeight: 'unset',
|
28
|
+
overflow
|
29
|
+
}
|
30
|
+
];
|
31
|
+
const exitKeyframes = [
|
32
|
+
{
|
33
|
+
opacity: toOpacity,
|
34
|
+
maxHeight: toHeight,
|
35
|
+
overflow
|
36
|
+
},
|
37
|
+
{
|
38
|
+
opacity: fromOpacity,
|
39
|
+
maxHeight: fromHeight,
|
40
|
+
overflow
|
41
|
+
}
|
42
|
+
];
|
43
|
+
return {
|
44
|
+
enter: {
|
45
|
+
duration,
|
46
|
+
easing,
|
47
|
+
keyframes: enterKeyframes
|
48
|
+
},
|
49
|
+
exit: {
|
50
|
+
duration,
|
51
|
+
easing,
|
52
|
+
keyframes: exitKeyframes
|
53
|
+
}
|
54
|
+
};
|
55
|
+
};
|
56
|
+
/** A React component that applies collapse/expand transitions to its children. */ export const Collapse = createPresenceComponent(collapseMotion);
|
57
|
+
export const CollapseSnappy = createPresenceComponentVariant(Collapse, {
|
58
|
+
all: {
|
59
|
+
duration: motionTokens.durationUltraFast
|
60
|
+
}
|
61
|
+
});
|
62
|
+
export const CollapseExaggerated = createPresenceComponentVariant(Collapse, {
|
63
|
+
enter: {
|
64
|
+
duration: motionTokens.durationSlow,
|
65
|
+
easing: motionTokens.curveEasyEaseMax
|
66
|
+
},
|
67
|
+
exit: {
|
68
|
+
duration: motionTokens.durationNormal,
|
69
|
+
easing: motionTokens.curveEasyEaseMax
|
70
|
+
}
|
71
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["Collapse.ts"],"sourcesContent":["import {\n motionTokens,\n type PresenceMotionFn,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\n/** Define a presence motion for collapse/expand */\nconst collapseMotion: PresenceMotionFn<{ animateOpacity?: boolean }> = ({ element, animateOpacity = true }) => {\n const fromOpacity = animateOpacity ? 0 : 1;\n const toOpacity = 1;\n const fromHeight = '0'; // Could be a custom param in the future: start partially expanded\n const toHeight = `${element.scrollHeight}px`;\n const overflow = 'hidden';\n\n const duration = motionTokens.durationNormal;\n const easing = motionTokens.curveEasyEaseMax;\n\n const enterKeyframes = [\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n // Transition to the height of the content, at 99.99% of the duration.\n { opacity: toOpacity, maxHeight: toHeight, offset: 0.9999, overflow },\n // On completion, remove the maxHeight because the content might need to expand later.\n // This extra keyframe is simpler than firing a callback on completion.\n { opacity: toOpacity, maxHeight: 'unset', overflow },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, maxHeight: toHeight, overflow },\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n ];\n\n return {\n enter: { duration, easing, keyframes: enterKeyframes },\n exit: { duration, easing, keyframes: exitKeyframes },\n };\n};\n\n/** A React component that applies collapse/expand transitions to its children. */\nexport const Collapse = createPresenceComponent(collapseMotion);\n\nexport const CollapseSnappy = createPresenceComponentVariant(Collapse, {\n all: { duration: motionTokens.durationUltraFast },\n});\n\nexport const CollapseExaggerated = createPresenceComponentVariant(Collapse, {\n enter: { duration: motionTokens.durationSlow, easing: motionTokens.curveEasyEaseMax },\n exit: { duration: motionTokens.durationNormal, easing: motionTokens.curveEasyEaseMax },\n});\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","collapseMotion","element","animateOpacity","fromOpacity","toOpacity","fromHeight","toHeight","scrollHeight","overflow","duration","durationNormal","easing","curveEasyEaseMax","enterKeyframes","opacity","maxHeight","offset","exitKeyframes","enter","keyframes","exit","Collapse","CollapseSnappy","all","durationUltraFast","CollapseExaggerated","durationSlow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EAEZC,uBAAuB,EACvBC,8BAA8B,QACzB,yBAAyB;AAEhC,iDAAiD,GACjD,MAAMC,iBAAiE,CAAC,EAAEC,OAAO,EAAEC,iBAAiB,IAAI,EAAE;IACxG,MAAMC,cAAcD,iBAAiB,IAAI;IACzC,MAAME,YAAY;IAClB,MAAMC,aAAa,KAAK,kEAAkE;IAC1F,MAAMC,WAAW,CAAC,EAAEL,QAAQM,YAAY,CAAC,EAAE,CAAC;IAC5C,MAAMC,WAAW;IAEjB,MAAMC,WAAWZ,aAAaa,cAAc;IAC5C,MAAMC,SAASd,aAAae,gBAAgB;IAE5C,MAAMC,iBAAiB;QACrB;YAAEC,SAASX;YAAaY,WAAWV;YAAYG;QAAS;QACxD,sEAAsE;QACtE;YAAEM,SAASV;YAAWW,WAAWT;YAAUU,QAAQ;YAAQR;QAAS;QACpE,sFAAsF;QACtF,uEAAuE;QACvE;YAAEM,SAASV;YAAWW,WAAW;YAASP;QAAS;KACpD;IAED,MAAMS,gBAAgB;QACpB;YAAEH,SAASV;YAAWW,WAAWT;YAAUE;QAAS;QACpD;YAAEM,SAASX;YAAaY,WAAWV;YAAYG;QAAS;KACzD;IAED,OAAO;QACLU,OAAO;YAAET;YAAUE;YAAQQ,WAAWN;QAAe;QACrDO,MAAM;YAAEX;YAAUE;YAAQQ,WAAWF;QAAc;IACrD;AACF;AAEA,gFAAgF,GAChF,OAAO,MAAMI,WAAWvB,wBAAwBE,gBAAgB;AAEhE,OAAO,MAAMsB,iBAAiBvB,+BAA+BsB,UAAU;IACrEE,KAAK;QAAEd,UAAUZ,aAAa2B,iBAAiB;IAAC;AAClD,GAAG;AAEH,OAAO,MAAMC,sBAAsB1B,+BAA+BsB,UAAU;IAC1EH,OAAO;QAAET,UAAUZ,aAAa6B,YAAY;QAAEf,QAAQd,aAAae,gBAAgB;IAAC;IACpFQ,MAAM;QAAEX,UAAUZ,aAAaa,cAAc;QAAEC,QAAQd,aAAae,gBAAgB;IAAC;AACvF,GAAG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Collapse';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Collapse';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,aAAa"}
|
@@ -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
ADDED
package/lib/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
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,92 @@
|
|
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
|
+
Collapse: function() {
|
13
|
+
return Collapse;
|
14
|
+
},
|
15
|
+
CollapseExaggerated: function() {
|
16
|
+
return CollapseExaggerated;
|
17
|
+
},
|
18
|
+
CollapseSnappy: function() {
|
19
|
+
return CollapseSnappy;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const _reactmotion = require("@fluentui/react-motion");
|
23
|
+
/** Define a presence motion for collapse/expand */ const collapseMotion = ({ element, animateOpacity = true })=>{
|
24
|
+
const fromOpacity = animateOpacity ? 0 : 1;
|
25
|
+
const toOpacity = 1;
|
26
|
+
const fromHeight = '0'; // Could be a custom param in the future: start partially expanded
|
27
|
+
const toHeight = `${element.scrollHeight}px`;
|
28
|
+
const overflow = 'hidden';
|
29
|
+
const duration = _reactmotion.motionTokens.durationNormal;
|
30
|
+
const easing = _reactmotion.motionTokens.curveEasyEaseMax;
|
31
|
+
const enterKeyframes = [
|
32
|
+
{
|
33
|
+
opacity: fromOpacity,
|
34
|
+
maxHeight: fromHeight,
|
35
|
+
overflow
|
36
|
+
},
|
37
|
+
// Transition to the height of the content, at 99.99% of the duration.
|
38
|
+
{
|
39
|
+
opacity: toOpacity,
|
40
|
+
maxHeight: toHeight,
|
41
|
+
offset: 0.9999,
|
42
|
+
overflow
|
43
|
+
},
|
44
|
+
// On completion, remove the maxHeight because the content might need to expand later.
|
45
|
+
// This extra keyframe is simpler than firing a callback on completion.
|
46
|
+
{
|
47
|
+
opacity: toOpacity,
|
48
|
+
maxHeight: 'unset',
|
49
|
+
overflow
|
50
|
+
}
|
51
|
+
];
|
52
|
+
const exitKeyframes = [
|
53
|
+
{
|
54
|
+
opacity: toOpacity,
|
55
|
+
maxHeight: toHeight,
|
56
|
+
overflow
|
57
|
+
},
|
58
|
+
{
|
59
|
+
opacity: fromOpacity,
|
60
|
+
maxHeight: fromHeight,
|
61
|
+
overflow
|
62
|
+
}
|
63
|
+
];
|
64
|
+
return {
|
65
|
+
enter: {
|
66
|
+
duration,
|
67
|
+
easing,
|
68
|
+
keyframes: enterKeyframes
|
69
|
+
},
|
70
|
+
exit: {
|
71
|
+
duration,
|
72
|
+
easing,
|
73
|
+
keyframes: exitKeyframes
|
74
|
+
}
|
75
|
+
};
|
76
|
+
};
|
77
|
+
const Collapse = (0, _reactmotion.createPresenceComponent)(collapseMotion);
|
78
|
+
const CollapseSnappy = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
|
79
|
+
all: {
|
80
|
+
duration: _reactmotion.motionTokens.durationUltraFast
|
81
|
+
}
|
82
|
+
});
|
83
|
+
const CollapseExaggerated = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
|
84
|
+
enter: {
|
85
|
+
duration: _reactmotion.motionTokens.durationSlow,
|
86
|
+
easing: _reactmotion.motionTokens.curveEasyEaseMax
|
87
|
+
},
|
88
|
+
exit: {
|
89
|
+
duration: _reactmotion.motionTokens.durationNormal,
|
90
|
+
easing: _reactmotion.motionTokens.curveEasyEaseMax
|
91
|
+
}
|
92
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["Collapse.ts"],"sourcesContent":["import {\n motionTokens,\n type PresenceMotionFn,\n createPresenceComponent,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\n\n/** Define a presence motion for collapse/expand */\nconst collapseMotion: PresenceMotionFn<{ animateOpacity?: boolean }> = ({ element, animateOpacity = true }) => {\n const fromOpacity = animateOpacity ? 0 : 1;\n const toOpacity = 1;\n const fromHeight = '0'; // Could be a custom param in the future: start partially expanded\n const toHeight = `${element.scrollHeight}px`;\n const overflow = 'hidden';\n\n const duration = motionTokens.durationNormal;\n const easing = motionTokens.curveEasyEaseMax;\n\n const enterKeyframes = [\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n // Transition to the height of the content, at 99.99% of the duration.\n { opacity: toOpacity, maxHeight: toHeight, offset: 0.9999, overflow },\n // On completion, remove the maxHeight because the content might need to expand later.\n // This extra keyframe is simpler than firing a callback on completion.\n { opacity: toOpacity, maxHeight: 'unset', overflow },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, maxHeight: toHeight, overflow },\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n ];\n\n return {\n enter: { duration, easing, keyframes: enterKeyframes },\n exit: { duration, easing, keyframes: exitKeyframes },\n };\n};\n\n/** A React component that applies collapse/expand transitions to its children. */\nexport const Collapse = createPresenceComponent(collapseMotion);\n\nexport const CollapseSnappy = createPresenceComponentVariant(Collapse, {\n all: { duration: motionTokens.durationUltraFast },\n});\n\nexport const CollapseExaggerated = createPresenceComponentVariant(Collapse, {\n enter: { duration: motionTokens.durationSlow, easing: motionTokens.curveEasyEaseMax },\n exit: { duration: motionTokens.durationNormal, easing: motionTokens.curveEasyEaseMax },\n});\n"],"names":["Collapse","CollapseExaggerated","CollapseSnappy","collapseMotion","element","animateOpacity","fromOpacity","toOpacity","fromHeight","toHeight","scrollHeight","overflow","duration","motionTokens","durationNormal","easing","curveEasyEaseMax","enterKeyframes","opacity","maxHeight","offset","exitKeyframes","enter","keyframes","exit","createPresenceComponent","createPresenceComponentVariant","all","durationUltraFast","durationSlow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAuCaA,QAAAA;eAAAA;;IAMAC,mBAAAA;eAAAA;;IAJAC,cAAAA;eAAAA;;;6BApCN;AAEP,iDAAiD,GACjD,MAAMC,iBAAiE,CAAC,EAAEC,OAAO,EAAEC,iBAAiB,IAAI,EAAE;IACxG,MAAMC,cAAcD,iBAAiB,IAAI;IACzC,MAAME,YAAY;IAClB,MAAMC,aAAa,KAAK,kEAAkE;IAC1F,MAAMC,WAAW,CAAC,EAAEL,QAAQM,YAAY,CAAC,EAAE,CAAC;IAC5C,MAAMC,WAAW;IAEjB,MAAMC,WAAWC,yBAAAA,CAAaC,cAAc;IAC5C,MAAMC,SAASF,yBAAAA,CAAaG,gBAAgB;IAE5C,MAAMC,iBAAiB;QACrB;YAAEC,SAASZ;YAAaa,WAAWX;YAAYG;QAAS;QACxD,sEAAsE;QACtE;YAAEO,SAASX;YAAWY,WAAWV;YAAUW,QAAQ;YAAQT;QAAS;QACpE,sFAAsF;QACtF,uEAAuE;QACvE;YAAEO,SAASX;YAAWY,WAAW;YAASR;QAAS;KACpD;IAED,MAAMU,gBAAgB;QACpB;YAAEH,SAASX;YAAWY,WAAWV;YAAUE;QAAS;QACpD;YAAEO,SAASZ;YAAaa,WAAWX;YAAYG;QAAS;KACzD;IAED,OAAO;QACLW,OAAO;YAAEV;YAAUG;YAAQQ,WAAWN;QAAe;QACrDO,MAAM;YAAEZ;YAAUG;YAAQQ,WAAWF;QAAc;IACrD;AACF;AAGO,MAAMrB,WAAWyB,IAAAA,oCAAAA,EAAwBtB;AAEzC,MAAMD,iBAAiBwB,IAAAA,2CAAAA,EAA+B1B,UAAU;IACrE2B,KAAK;QAAEf,UAAUC,yBAAAA,CAAae,iBAAiB;IAAC;AAClD;AAEO,MAAM3B,sBAAsByB,IAAAA,2CAAAA,EAA+B1B,UAAU;IAC1EsB,OAAO;QAAEV,UAAUC,yBAAAA,CAAagB,YAAY;QAAEd,QAAQF,yBAAAA,CAAaG,gBAAgB;IAAC;IACpFQ,MAAM;QAAEZ,UAAUC,yBAAAA,CAAaC,cAAc;QAAEC,QAAQF,yBAAAA,CAAaG,gBAAgB;IAAC;AACvF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Collapse';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -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 @@
|
|
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 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Scale';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -0,0 +1,42 @@
|
|
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
|
+
Collapse: function() {
|
13
|
+
return _Collapse.Collapse;
|
14
|
+
},
|
15
|
+
CollapseExaggerated: function() {
|
16
|
+
return _Collapse.CollapseExaggerated;
|
17
|
+
},
|
18
|
+
CollapseSnappy: function() {
|
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;
|
38
|
+
}
|
39
|
+
});
|
40
|
+
const _Collapse = require("./components/Collapse");
|
41
|
+
const _Fade = require("./components/Fade");
|
42
|
+
const _Scale = require("./components/Scale");
|
@@ -0,0 +1 @@
|
|
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.
|
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",
|
@@ -29,13 +29,13 @@
|
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
31
|
"@fluentui/eslint-plugin": "*",
|
32
|
-
"@fluentui/react-conformance": "
|
33
|
-
"@fluentui/react-conformance-griffel": "
|
32
|
+
"@fluentui/react-conformance": "*",
|
33
|
+
"@fluentui/react-conformance-griffel": "*",
|
34
34
|
"@fluentui/scripts-api-extractor": "*",
|
35
35
|
"@fluentui/scripts-tasks": "*"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@fluentui/react-motion": "
|
38
|
+
"@fluentui/react-motion": "*",
|
39
39
|
"@swc/helpers": "^0.5.1"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
@@ -53,5 +53,10 @@
|
|
53
53
|
},
|
54
54
|
"./package.json": "./package.json"
|
55
55
|
},
|
56
|
-
"beachball": {
|
56
|
+
"beachball": {
|
57
|
+
"disallowedChangeTypes": [
|
58
|
+
"major",
|
59
|
+
"prerelease"
|
60
|
+
]
|
61
|
+
}
|
57
62
|
}
|