@fluentui/react-motion-components-preview 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/dist/index.d.ts +69 -67
- package/lib/atoms/fade-atom.js +3 -3
- package/lib/atoms/fade-atom.js.map +1 -1
- package/lib/atoms/scale-atom.js +27 -0
- package/lib/atoms/scale-atom.js.map +1 -0
- package/lib/atoms/slide-atom.js +27 -0
- package/lib/atoms/slide-atom.js.map +1 -0
- package/lib/components/Collapse/Collapse.js +93 -77
- package/lib/components/Collapse/Collapse.js.map +1 -1
- package/lib/components/Collapse/collapse-types.js.map +1 -1
- package/lib/components/Collapse/index.js +1 -1
- package/lib/components/Collapse/index.js.map +1 -1
- package/lib/components/Fade/Fade.js.map +1 -1
- package/lib/components/Fade/fade-types.js +1 -0
- package/lib/components/Fade/fade-types.js.map +1 -0
- package/lib/components/Scale/Scale.js +35 -41
- package/lib/components/Scale/Scale.js.map +1 -1
- package/lib/components/Scale/scale-types.js +1 -0
- package/lib/components/Scale/scale-types.js.map +1 -0
- package/lib/components/Slide/Slide.js +48 -0
- package/lib/components/Slide/Slide.js.map +1 -0
- package/lib/components/Slide/index.js +1 -0
- package/lib/components/Slide/index.js.map +1 -0
- package/lib/components/Slide/slide-types.js +1 -0
- package/lib/components/Slide/slide-types.js.map +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/atoms/fade-atom.js +2 -2
- package/lib-commonjs/atoms/fade-atom.js.map +1 -1
- package/lib-commonjs/atoms/scale-atom.js +29 -0
- package/lib-commonjs/atoms/scale-atom.js.map +1 -0
- package/lib-commonjs/atoms/slide-atom.js +29 -0
- package/lib-commonjs/atoms/slide-atom.js.map +1 -0
- package/lib-commonjs/components/Collapse/Collapse.js +92 -82
- package/lib-commonjs/components/Collapse/Collapse.js.map +1 -1
- package/lib-commonjs/components/Collapse/index.js +0 -6
- package/lib-commonjs/components/Collapse/index.js.map +1 -1
- package/lib-commonjs/components/Fade/Fade.js.map +1 -1
- package/lib-commonjs/components/Fade/fade-types.js +4 -0
- package/lib-commonjs/components/Fade/fade-types.js.map +1 -0
- package/lib-commonjs/components/Scale/Scale.js +35 -41
- package/lib-commonjs/components/Scale/Scale.js.map +1 -1
- package/lib-commonjs/components/Scale/scale-types.js +4 -0
- package/lib-commonjs/components/Scale/scale-types.js.map +1 -0
- package/lib-commonjs/components/Slide/Slide.js +69 -0
- package/lib-commonjs/components/Slide/Slide.js.map +1 -0
- package/lib-commonjs/components/Slide/index.js +22 -0
- package/lib-commonjs/components/Slide/index.js.map +1 -0
- package/lib-commonjs/components/Slide/slide-types.js +4 -0
- package/lib-commonjs/components/Slide/slide-types.js.map +1 -0
- package/lib-commonjs/index.js +8 -4
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,29 @@
|
|
1
1
|
# Change Log - @fluentui/react-motion-components-preview
|
2
2
|
|
3
|
-
This log was last generated on Wed,
|
3
|
+
This log was last generated on Wed, 16 Jul 2025 13:51:49 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [0.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.7.0)
|
8
|
+
|
9
|
+
Wed, 16 Jul 2025 13:51:49 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.6.2..@fluentui/react-motion-components-preview_v0.7.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- refactor(Collapse): make consistent with other motion components ([PR #34831](https://github.com/microsoft/fluentui/pull/34831) by robertpenner@microsoft.com)
|
15
|
+
- feat(motion): add Slide presence motion component ([PR #34774](https://github.com/microsoft/fluentui/pull/34774) by robertpenner@microsoft.com)
|
16
|
+
- refactor(motion): apply consistent patterns across Fade and Scale ([PR #34830](https://github.com/microsoft/fluentui/pull/34830) by robertpenner@microsoft.com)
|
17
|
+
|
18
|
+
## [0.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.6.2)
|
19
|
+
|
20
|
+
Thu, 26 Jun 2025 14:11:54 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.5.0..@fluentui/react-motion-components-preview_v0.6.2)
|
22
|
+
|
23
|
+
### Patches
|
24
|
+
|
25
|
+
- fix(Scale): update variant parameters to design spec & refactor internally ([PR #34712](https://github.com/microsoft/fluentui/pull/34712) by robertpenner@microsoft.com)
|
26
|
+
|
7
27
|
## [0.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.5.0)
|
8
28
|
|
9
29
|
Wed, 14 May 2025 18:49:17 GMT
|
package/dist/index.d.ts
CHANGED
@@ -1,69 +1,55 @@
|
|
1
|
-
import type { MotionParam } from '@fluentui/react-motion';
|
2
1
|
import { PresenceComponent } from '@fluentui/react-motion';
|
3
|
-
import type { PresenceMotionFn } from '@fluentui/react-motion';
|
4
2
|
|
5
3
|
/** A React component that applies collapse/expand transitions to its children. */
|
6
|
-
export declare const Collapse: PresenceComponent<
|
4
|
+
export declare const Collapse: PresenceComponent<CollapseParams>;
|
7
5
|
|
8
|
-
|
6
|
+
/** Common properties shared by all collapse components */
|
7
|
+
declare type CollapseBaseParams = {
|
8
|
+
/** Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value. */
|
9
|
+
easing?: string;
|
10
|
+
/** Easing curve for the exit transition. Defaults to the `easing` param for symmetry. */
|
11
|
+
exitEasing?: string;
|
12
|
+
/** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */
|
13
|
+
orientation?: CollapseOrientation;
|
14
|
+
/** Whether to animate the opacity. Defaults to `true`. */
|
15
|
+
animateOpacity?: boolean;
|
16
|
+
};
|
17
|
+
|
18
|
+
/** A React component that applies collapse/expand transitions with delayed fade to its children. */
|
19
|
+
export declare const CollapseDelayed: PresenceComponent<CollapseDelayedParams>;
|
9
20
|
|
10
|
-
declare type
|
11
|
-
/** Time (ms) for the size expand. Defaults to the durationNormal value (200 ms). */
|
12
|
-
|
13
|
-
/** Time (ms) for the fade-in. Defaults to the
|
14
|
-
|
15
|
-
/** Time (ms) for the size collapse. Defaults to the
|
21
|
+
declare type CollapseDelayedParams = CollapseBaseParams & {
|
22
|
+
/** Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms). */
|
23
|
+
sizeDuration?: number;
|
24
|
+
/** Time (ms) for the fade-in. Defaults to the `sizeDuration` param, to sync fade-in with expand. */
|
25
|
+
opacityDuration?: number;
|
26
|
+
/** Time (ms) for the size collapse. Defaults to the `sizeDuration` param, for temporal symmetry. */
|
16
27
|
exitSizeDuration?: number;
|
17
|
-
/** Defaults to the exitSizeDuration param, to sync the fade-out with the collapse. */
|
28
|
+
/** Time (ms) for the fade-out. Defaults to the `exitSizeDuration` param, to sync the fade-out with the collapse. */
|
18
29
|
exitOpacityDuration?: number;
|
19
|
-
/** Time (ms) between the size expand start and the fade-in start. Defaults to `0`.
|
20
|
-
|
21
|
-
/** Time (ms) between the fade-out start and the size collapse start. Defaults to `0`.
|
30
|
+
/** Time (ms) between the size expand start and the fade-in start. Defaults to `0`. */
|
31
|
+
delay?: number;
|
32
|
+
/** Time (ms) between the fade-out start and the size collapse start. Defaults to `0`. */
|
22
33
|
exitDelay?: number;
|
23
|
-
/** Easing curve for the enter transition, shared by size and opacity. Defaults to the easeEaseMax value. */
|
24
|
-
enterEasing?: string;
|
25
|
-
/** Easing curve for the exit transition, shared by size and opacity. Defaults to the enterEasing param. */
|
26
|
-
exitEasing?: string;
|
27
34
|
};
|
28
35
|
|
29
36
|
declare type CollapseOrientation = 'horizontal' | 'vertical';
|
30
37
|
|
31
|
-
|
32
|
-
|
33
|
-
export declare type CollapseRuntimeParams = {
|
34
|
-
/** Whether to animate the opacity. Defaults to `true`. */
|
35
|
-
animateOpacity?: boolean;
|
36
|
-
/** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */
|
37
|
-
orientation?: CollapseOrientation;
|
38
|
-
};
|
39
|
-
|
40
|
-
export declare const CollapseSnappy: PresenceComponent<CollapseRuntimeParams>;
|
41
|
-
|
42
|
-
declare type CollapseVariantParams = {
|
38
|
+
declare type CollapseParams = CollapseBaseParams & {
|
43
39
|
/** Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms). */
|
44
|
-
|
45
|
-
/**
|
46
|
-
enterEasing?: string;
|
47
|
-
/** Time (ms) for the exit transition (collapse). Defaults to the `enterDuration` param for symmetry. */
|
40
|
+
duration?: number;
|
41
|
+
/** Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry. */
|
48
42
|
exitDuration?: number;
|
49
|
-
/** Easing curve for the exit transition (collapse). Defaults to the `enterEasing` param for symmetry. */
|
50
|
-
exitEasing?: string;
|
51
43
|
};
|
52
44
|
|
53
|
-
|
54
|
-
export declare const createCollapseDelayedPresence: PresenceMotionFnCreator<CollapseDelayedVariantParams, CollapseRuntimeParams>;
|
45
|
+
export declare const CollapseRelaxed: PresenceComponent<CollapseParams>;
|
55
46
|
|
56
|
-
|
57
|
-
export declare const createCollapsePresence: PresenceMotionFnCreator<CollapseVariantParams, CollapseRuntimeParams>;
|
47
|
+
export declare const CollapseSnappy: PresenceComponent<CollapseParams>;
|
58
48
|
|
59
49
|
/** A React component that applies fade in/out transitions to its children. */
|
60
|
-
export declare const Fade: PresenceComponent<
|
50
|
+
export declare const Fade: PresenceComponent<FadeParams>;
|
61
51
|
|
62
|
-
|
63
|
-
|
64
|
-
export declare const FadeSnappy: PresenceComponent<FadeVariantParams>;
|
65
|
-
|
66
|
-
declare type FadeVariantParams = {
|
52
|
+
declare type FadeParams = {
|
67
53
|
/** Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms). */
|
68
54
|
duration?: number;
|
69
55
|
/** Easing curve for the enter transition (fade-in). Defaults to the `curveEasyEase` value. */
|
@@ -74,33 +60,21 @@ declare type FadeVariantParams = {
|
|
74
60
|
exitEasing?: string;
|
75
61
|
};
|
76
62
|
|
77
|
-
|
78
|
-
* This is a factory function that generates a motion function, which has variant params bound into it.
|
79
|
-
* The generated motion function accepts other runtime params that aren't locked into the variant, but supplied at runtime.
|
80
|
-
* This separation allows the variant to be defined once and reused with different runtime params which may be orthogonal to the variant params.
|
81
|
-
* For example, a variant may define the duration and easing of a transition, which are fixed for all instances of the variant,
|
82
|
-
* while the runtime params may give access to the target element, which is different for each instance.
|
83
|
-
*
|
84
|
-
* The generated motion function is also framework-independent, i.e. non-React.
|
85
|
-
* It can be turned into a React component using `createPresenceComponent`.
|
86
|
-
*/
|
87
|
-
declare type PresenceMotionFnCreator<MotionVariantParams extends Record<string, MotionParam> = {}, MotionRuntimeParams extends Record<string, MotionParam> = {}> = (variantParams?: MotionVariantParams) => PresenceMotionFn<MotionRuntimeParams>;
|
63
|
+
export declare const FadeRelaxed: PresenceComponent<FadeParams>;
|
88
64
|
|
89
|
-
|
90
|
-
export declare const Scale: PresenceComponent<ScaleVariantParams>;
|
65
|
+
export declare const FadeSnappy: PresenceComponent<FadeParams>;
|
91
66
|
|
92
|
-
|
93
|
-
|
94
|
-
export declare const ScaleSnappy: PresenceComponent<ScaleVariantParams>;
|
67
|
+
/** A React component that applies scale in/out transitions to its children. */
|
68
|
+
export declare const Scale: PresenceComponent<ScaleParams>;
|
95
69
|
|
96
|
-
declare type
|
97
|
-
/** Time (ms) for the enter transition (scale-in). Defaults to the `
|
70
|
+
declare type ScaleParams = {
|
71
|
+
/** Time (ms) for the enter transition (scale-in). Defaults to the `durationGentle` value (250 ms). */
|
98
72
|
duration?: number;
|
99
|
-
/** Easing curve for the enter transition (scale-in). Defaults to the `
|
73
|
+
/** Easing curve for the enter transition (scale-in). Defaults to the `curveDecelerateMax` value. */
|
100
74
|
easing?: string;
|
101
|
-
/** Time (ms) for the exit transition (scale-out). Defaults to the `
|
75
|
+
/** Time (ms) for the exit transition (scale-out). Defaults to the `durationNormal` value (200 ms). */
|
102
76
|
exitDuration?: number;
|
103
|
-
/** Easing curve for the exit transition (scale-out). Defaults to the `
|
77
|
+
/** Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value. */
|
104
78
|
exitEasing?: string;
|
105
79
|
/** The scale value to animate from. Defaults to `0.9`. */
|
106
80
|
fromScale?: number;
|
@@ -108,4 +82,32 @@ declare type ScaleVariantParams = {
|
|
108
82
|
animateOpacity?: boolean;
|
109
83
|
};
|
110
84
|
|
85
|
+
export declare const ScaleRelaxed: PresenceComponent<ScaleParams>;
|
86
|
+
|
87
|
+
export declare const ScaleSnappy: PresenceComponent<ScaleParams>;
|
88
|
+
|
89
|
+
/** A React component that applies slide in/out transitions to its children. */
|
90
|
+
export declare const Slide: PresenceComponent<SlideParams>;
|
91
|
+
|
92
|
+
declare type SlideParams = {
|
93
|
+
/** Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (250 ms). */
|
94
|
+
duration?: number;
|
95
|
+
/** Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value. */
|
96
|
+
easing?: string;
|
97
|
+
/** Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry. */
|
98
|
+
exitDuration?: number;
|
99
|
+
/** Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value. */
|
100
|
+
exitEasing?: string;
|
101
|
+
/** The X translate value with units to animate from. Defaults to `'0px'`. */
|
102
|
+
fromX?: string;
|
103
|
+
/** The Y translate value with units to animate from. Defaults to `'20px'`. */
|
104
|
+
fromY?: string;
|
105
|
+
/** Whether to animate the opacity. Defaults to `true`. */
|
106
|
+
animateOpacity?: boolean;
|
107
|
+
};
|
108
|
+
|
109
|
+
export declare const SlideRelaxed: PresenceComponent<SlideParams>;
|
110
|
+
|
111
|
+
export declare const SlideSnappy: PresenceComponent<SlideParams>;
|
112
|
+
|
111
113
|
export { }
|
package/lib/atoms/fade-atom.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { motionTokens } from '@fluentui/react-motion';
|
2
2
|
/**
|
3
|
-
* Generates a motion atom object for a fade
|
3
|
+
* Generates a motion atom object for a fade-in or fade-out.
|
4
4
|
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
5
5
|
* @param duration - The duration of the motion in milliseconds.
|
6
6
|
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
7
7
|
* @param fromValue - The starting opacity value. Defaults to 0.
|
8
8
|
* @returns A motion atom object with opacity keyframes and the supplied duration and easing.
|
9
|
-
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear,
|
9
|
+
*/ export const fadeAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromOpacity = 0 })=>{
|
10
10
|
const keyframes = [
|
11
11
|
{
|
12
|
-
opacity:
|
12
|
+
opacity: fromOpacity
|
13
13
|
},
|
14
14
|
{
|
15
15
|
opacity: 1
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/atoms/fade-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface FadeAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n
|
1
|
+
{"version":3,"sources":["../src/atoms/fade-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface FadeAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromOpacity?: number;\n}\n\n/**\n * Generates a motion atom object for a fade-in or fade-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromValue - The starting opacity value. Defaults to 0.\n * @returns A motion atom object with opacity keyframes and the supplied duration and easing.\n */\nexport const fadeAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n fromOpacity = 0,\n}: FadeAtomParams): AtomMotion => {\n const keyframes = [{ opacity: fromOpacity }, { opacity: 1 }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","fadeAtom","direction","duration","easing","curveLinear","fromOpacity","keyframes","opacity","reverse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AASrF;;;;;;;CAOC,GACD,OAAO,MAAMC,WAAW,CAAC,EACvBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,cAAc,CAAC,EACA;IACf,MAAMC,YAAY;QAAC;YAAEC,SAASF;QAAY;QAAG;YAAEE,SAAS;QAAE;KAAE;IAC5D,IAAIN,cAAc,QAAQ;QACxBK,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAJ;QACAC;IACF;AACF,EAAE"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { motionTokens } from '@fluentui/react-motion';
|
2
|
+
/**
|
3
|
+
* Generates a motion atom object for a scale in or scale out.
|
4
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
5
|
+
* @param duration - The duration of the motion in milliseconds.
|
6
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
7
|
+
* @param fromScale - The starting scale value. Defaults to 0.9.
|
8
|
+
* @param toScale - The ending scale value. Defaults to 1.
|
9
|
+
* @returns A motion atom object with scale keyframes and the supplied duration and easing.
|
10
|
+
*/ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromScale = 0.9, toScale = 1 })=>{
|
11
|
+
const keyframes = [
|
12
|
+
{
|
13
|
+
scale: fromScale
|
14
|
+
},
|
15
|
+
{
|
16
|
+
scale: toScale
|
17
|
+
}
|
18
|
+
];
|
19
|
+
if (direction === 'exit') {
|
20
|
+
keyframes.reverse();
|
21
|
+
}
|
22
|
+
return {
|
23
|
+
keyframes,
|
24
|
+
duration,
|
25
|
+
easing
|
26
|
+
};
|
27
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/atoms/scale-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface ScaleAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromScale?: number;\n toScale?: number;\n}\n\n/**\n * Generates a motion atom object for a scale in or scale out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromScale - The starting scale value. Defaults to 0.9.\n * @param toScale - The ending scale value. Defaults to 1.\n * @returns A motion atom object with scale keyframes and the supplied duration and easing.\n */\nexport const scaleAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n fromScale = 0.9,\n toScale = 1,\n}: ScaleAtomParams): AtomMotion => {\n const keyframes = [{ scale: fromScale }, { scale: toScale }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","scaleAtom","direction","duration","easing","curveLinear","fromScale","toScale","keyframes","scale","reverse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AAUrF;;;;;;;;CAQC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,YAAY,GAAG,EACfC,UAAU,CAAC,EACK;IAChB,MAAMC,YAAY;QAAC;YAAEC,OAAOH;QAAU;QAAG;YAAEG,OAAOF;QAAQ;KAAE;IAC5D,IAAIL,cAAc,QAAQ;QACxBM,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAL;QACAC;IACF;AACF,EAAE"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { motionTokens } from '@fluentui/react-motion';
|
2
|
+
/**
|
3
|
+
* Generates a motion atom object for a slide-in or slide-out.
|
4
|
+
* @param direction - The functional direction of the motion: 'enter' or 'exit'.
|
5
|
+
* @param duration - The duration of the motion in milliseconds.
|
6
|
+
* @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.
|
7
|
+
* @param fromX - The starting X translate value with units (e.g., '0px', '100%'). Defaults to '0px'.
|
8
|
+
* @param fromY - The starting Y translate value with units (e.g., '-20px', '100%'). Defaults to '0px'.
|
9
|
+
* @returns A motion atom object with translate keyframes and the supplied duration and easing.
|
10
|
+
*/ export const slideAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromX = '0px', fromY = '20px' })=>{
|
11
|
+
const keyframes = [
|
12
|
+
{
|
13
|
+
translate: `${fromX} ${fromY}`
|
14
|
+
},
|
15
|
+
{
|
16
|
+
translate: '0px 0px'
|
17
|
+
}
|
18
|
+
];
|
19
|
+
if (direction === 'exit') {
|
20
|
+
keyframes.reverse();
|
21
|
+
}
|
22
|
+
return {
|
23
|
+
keyframes,
|
24
|
+
duration,
|
25
|
+
easing
|
26
|
+
};
|
27
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/atoms/slide-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface SlideAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromX?: string;\n fromY?: string;\n}\n\n/**\n * Generates a motion atom object for a slide-in or slide-out.\n * @param direction - The functional direction of the motion: 'enter' or 'exit'.\n * @param duration - The duration of the motion in milliseconds.\n * @param easing - The easing curve for the motion. Defaults to `motionTokens.curveLinear`.\n * @param fromX - The starting X translate value with units (e.g., '0px', '100%'). Defaults to '0px'.\n * @param fromY - The starting Y translate value with units (e.g., '-20px', '100%'). Defaults to '0px'.\n * @returns A motion atom object with translate keyframes and the supplied duration and easing.\n */\nexport const slideAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n fromX = '0px',\n fromY = '20px',\n}: SlideAtomParams): AtomMotion => {\n const keyframes = [{ translate: `${fromX} ${fromY}` }, { translate: '0px 0px' }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","slideAtom","direction","duration","easing","curveLinear","fromX","fromY","keyframes","translate","reverse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AAUrF;;;;;;;;CAQC,GACD,OAAO,MAAMC,YAAY,CAAC,EACxBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,QAAQ,KAAK,EACbC,QAAQ,MAAM,EACE;IAChB,MAAMC,YAAY;QAAC;YAAEC,WAAW,CAAC,EAAEH,MAAM,CAAC,EAAEC,MAAM,CAAC;QAAC;QAAG;YAAEE,WAAW;QAAU;KAAE;IAChF,IAAIP,cAAc,QAAQ;QACxBM,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAL;QACAC;IACF;AACF,EAAE"}
|
@@ -1,85 +1,101 @@
|
|
1
|
-
import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';
|
1
|
+
import { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';
|
2
2
|
import { sizeEnterAtom, sizeExitAtom, whitespaceAtom } from './collapse-atoms';
|
3
3
|
import { fadeAtom } from '../../atoms/fade-atom';
|
4
|
-
/**
|
5
|
-
|
6
|
-
exitSizeDuration
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
orientation,
|
12
|
-
duration: enterSizeDuration,
|
13
|
-
easing: enterEasing,
|
14
|
-
element
|
15
|
-
}),
|
16
|
-
whitespaceAtom({
|
17
|
-
direction: 'enter',
|
18
|
-
orientation,
|
19
|
-
duration: enterSizeDuration,
|
20
|
-
easing: enterEasing
|
21
|
-
})
|
22
|
-
];
|
23
|
-
// Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
24
|
-
if (animateOpacity) {
|
25
|
-
enterAtoms.push({
|
26
|
-
...fadeAtom({
|
27
|
-
direction: 'enter',
|
28
|
-
duration: enterOpacityDuration,
|
29
|
-
easing: enterEasing
|
30
|
-
}),
|
31
|
-
delay: enterDelay,
|
32
|
-
fill: 'both'
|
33
|
-
});
|
34
|
-
}
|
35
|
-
// ----- EXIT -----
|
36
|
-
// The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.
|
37
|
-
const exitAtoms = [];
|
38
|
-
// Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
39
|
-
if (animateOpacity) {
|
40
|
-
exitAtoms.push(fadeAtom({
|
41
|
-
direction: 'exit',
|
42
|
-
duration: exitOpacityDuration,
|
43
|
-
easing: exitEasing
|
44
|
-
}));
|
45
|
-
}
|
46
|
-
exitAtoms.push(sizeExitAtom({
|
4
|
+
/** Internal helper to create collapse atoms with shared logic */ function createCollapseAtoms({ element, orientation, animateOpacity, // Enter params
|
5
|
+
sizeDuration, opacityDuration = sizeDuration, easing, delay, // Exit params
|
6
|
+
exitSizeDuration, exitOpacityDuration = exitSizeDuration, exitEasing, exitDelay }) {
|
7
|
+
// ----- ENTER -----
|
8
|
+
// The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.
|
9
|
+
const enterAtoms = [
|
10
|
+
sizeEnterAtom({
|
47
11
|
orientation,
|
48
|
-
duration:
|
49
|
-
easing
|
50
|
-
element
|
51
|
-
|
52
|
-
|
53
|
-
direction: '
|
12
|
+
duration: sizeDuration,
|
13
|
+
easing,
|
14
|
+
element
|
15
|
+
}),
|
16
|
+
whitespaceAtom({
|
17
|
+
direction: 'enter',
|
54
18
|
orientation,
|
55
|
-
duration:
|
56
|
-
easing
|
57
|
-
|
19
|
+
duration: sizeDuration,
|
20
|
+
easing
|
21
|
+
})
|
22
|
+
];
|
23
|
+
// Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
24
|
+
if (animateOpacity) {
|
25
|
+
enterAtoms.push({
|
26
|
+
...fadeAtom({
|
27
|
+
direction: 'enter',
|
28
|
+
duration: opacityDuration,
|
29
|
+
easing
|
30
|
+
}),
|
31
|
+
delay,
|
32
|
+
fill: 'both'
|
33
|
+
});
|
34
|
+
}
|
35
|
+
// ----- EXIT -----
|
36
|
+
// The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.
|
37
|
+
const exitAtoms = [];
|
38
|
+
// Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
39
|
+
if (animateOpacity) {
|
40
|
+
exitAtoms.push(fadeAtom({
|
41
|
+
direction: 'exit',
|
42
|
+
duration: exitOpacityDuration,
|
43
|
+
easing: exitEasing
|
58
44
|
}));
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
45
|
+
}
|
46
|
+
exitAtoms.push(sizeExitAtom({
|
47
|
+
orientation,
|
48
|
+
duration: exitSizeDuration,
|
49
|
+
easing: exitEasing,
|
50
|
+
element,
|
51
|
+
delay: exitDelay
|
52
|
+
}), whitespaceAtom({
|
53
|
+
direction: 'exit',
|
54
|
+
orientation,
|
55
|
+
duration: exitSizeDuration,
|
56
|
+
easing: exitEasing,
|
57
|
+
delay: exitDelay
|
58
|
+
}));
|
59
|
+
return {
|
60
|
+
enter: enterAtoms,
|
61
|
+
exit: exitAtoms
|
63
62
|
};
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
}
|
64
|
+
/** Define a presence motion for collapse/expand */ const collapsePresenceFn = ({ element, duration = motionTokens.durationNormal, easing = motionTokens.curveEasyEaseMax, exitDuration = duration, exitEasing = easing, animateOpacity = true, orientation = 'vertical' })=>{
|
65
|
+
return createCollapseAtoms({
|
66
|
+
element,
|
67
|
+
orientation,
|
68
|
+
animateOpacity,
|
69
|
+
sizeDuration: duration,
|
70
|
+
opacityDuration: duration,
|
71
|
+
easing,
|
69
72
|
exitSizeDuration: exitDuration,
|
70
|
-
|
73
|
+
exitOpacityDuration: exitDuration,
|
74
|
+
exitEasing,
|
75
|
+
delay: 0,
|
76
|
+
exitDelay: 0
|
77
|
+
});
|
78
|
+
};
|
79
|
+
/** Define a presence motion for collapse/expand that can stagger the size and opacity motions by a given delay */ const collapseDelayedPresenceFn = ({ element, sizeDuration = motionTokens.durationNormal, opacityDuration = motionTokens.durationSlower, easing = motionTokens.curveEasyEase, delay = motionTokens.durationNormal, exitSizeDuration = sizeDuration, exitOpacityDuration = opacityDuration, exitEasing = easing, exitDelay = motionTokens.durationSlower, animateOpacity = true, orientation = 'vertical' })=>{
|
80
|
+
return createCollapseAtoms({
|
81
|
+
element,
|
82
|
+
orientation,
|
83
|
+
animateOpacity,
|
84
|
+
sizeDuration,
|
85
|
+
opacityDuration,
|
86
|
+
easing,
|
87
|
+
delay,
|
88
|
+
exitSizeDuration,
|
89
|
+
exitOpacityDuration,
|
90
|
+
exitEasing,
|
91
|
+
exitDelay
|
71
92
|
});
|
72
|
-
|
73
|
-
export const
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
enterOpacityDuration: motionTokens.durationSlower,
|
82
|
-
enterDelay: motionTokens.durationNormal,
|
83
|
-
exitDelay: motionTokens.durationSlower,
|
84
|
-
enterEasing: motionTokens.curveEasyEase
|
85
|
-
}));
|
93
|
+
};
|
94
|
+
/** A React component that applies collapse/expand transitions to its children. */ export const Collapse = createPresenceComponent(collapsePresenceFn);
|
95
|
+
export const CollapseSnappy = createPresenceComponentVariant(Collapse, {
|
96
|
+
duration: motionTokens.durationFast
|
97
|
+
});
|
98
|
+
export const CollapseRelaxed = createPresenceComponentVariant(Collapse, {
|
99
|
+
duration: motionTokens.durationSlower
|
100
|
+
});
|
101
|
+
/** A React component that applies collapse/expand transitions with delayed fade to its children. */ export const CollapseDelayed = createPresenceComponent(collapseDelayedPresenceFn);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/Collapse.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../src/components/Collapse/Collapse.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n AtomMotion,\n} from '@fluentui/react-motion';\nimport type { CollapseDelayedParams, CollapseParams } from './collapse-types';\nimport { sizeEnterAtom, sizeExitAtom, whitespaceAtom } from './collapse-atoms';\nimport { fadeAtom } from '../../atoms/fade-atom';\n\n/** Internal helper to create collapse atoms with shared logic */\nfunction createCollapseAtoms({\n element,\n orientation,\n animateOpacity,\n\n // Enter params\n sizeDuration,\n opacityDuration = sizeDuration,\n easing,\n delay,\n\n // Exit params\n exitSizeDuration,\n exitOpacityDuration = exitSizeDuration,\n exitEasing,\n exitDelay,\n}: {\n element: HTMLElement;\n} & Required<CollapseDelayedParams>) {\n // ----- ENTER -----\n // The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.\n const enterAtoms: AtomMotion[] = [\n sizeEnterAtom({ orientation, duration: sizeDuration, easing, element }),\n whitespaceAtom({ direction: 'enter', orientation, duration: sizeDuration, easing }),\n ];\n // Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n enterAtoms.push({\n ...fadeAtom({ direction: 'enter', duration: opacityDuration, easing }),\n delay,\n fill: 'both',\n });\n }\n\n // ----- EXIT -----\n // The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.\n const exitAtoms: AtomMotion[] = [];\n // Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitOpacityDuration, easing: exitEasing }));\n }\n\n exitAtoms.push(\n sizeExitAtom({ orientation, duration: exitSizeDuration, easing: exitEasing, element, delay: exitDelay }),\n whitespaceAtom({\n direction: 'exit',\n orientation,\n duration: exitSizeDuration,\n easing: exitEasing,\n delay: exitDelay,\n }),\n );\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n}\n\n/** Define a presence motion for collapse/expand */\nconst collapsePresenceFn: PresenceMotionFn<CollapseParams> = ({\n element,\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveEasyEaseMax,\n exitDuration = duration,\n exitEasing = easing,\n animateOpacity = true,\n orientation = 'vertical',\n}) => {\n return createCollapseAtoms({\n element,\n orientation,\n animateOpacity,\n sizeDuration: duration,\n opacityDuration: duration,\n easing,\n exitSizeDuration: exitDuration,\n exitOpacityDuration: exitDuration,\n exitEasing,\n delay: 0,\n exitDelay: 0,\n });\n};\n\n/** Define a presence motion for collapse/expand that can stagger the size and opacity motions by a given delay */\nconst collapseDelayedPresenceFn: PresenceMotionFn<CollapseDelayedParams> = ({\n element,\n sizeDuration = motionTokens.durationNormal,\n opacityDuration = motionTokens.durationSlower,\n easing = motionTokens.curveEasyEase,\n delay = motionTokens.durationNormal,\n exitSizeDuration = sizeDuration,\n exitOpacityDuration = opacityDuration,\n exitEasing = easing,\n exitDelay = motionTokens.durationSlower,\n animateOpacity = true,\n orientation = 'vertical',\n}) => {\n return createCollapseAtoms({\n element,\n orientation,\n animateOpacity,\n sizeDuration,\n opacityDuration,\n easing,\n delay,\n exitSizeDuration,\n exitOpacityDuration,\n exitEasing,\n exitDelay,\n });\n};\n\n/** A React component that applies collapse/expand transitions to its children. */\nexport const Collapse = createPresenceComponent(collapsePresenceFn);\n\nexport const CollapseSnappy = createPresenceComponentVariant(Collapse, {\n duration: motionTokens.durationFast,\n});\n\nexport const CollapseRelaxed = createPresenceComponentVariant(Collapse, {\n duration: motionTokens.durationSlower,\n});\n\n/** A React component that applies collapse/expand transitions with delayed fade to its children. */\nexport const CollapseDelayed = createPresenceComponent(collapseDelayedPresenceFn);\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","sizeEnterAtom","sizeExitAtom","whitespaceAtom","fadeAtom","createCollapseAtoms","element","orientation","animateOpacity","sizeDuration","opacityDuration","easing","delay","exitSizeDuration","exitOpacityDuration","exitEasing","exitDelay","enterAtoms","duration","direction","push","fill","exitAtoms","enter","exit","collapsePresenceFn","durationNormal","curveEasyEaseMax","exitDuration","collapseDelayedPresenceFn","durationSlower","curveEasyEase","Collapse","CollapseSnappy","durationFast","CollapseRelaxed","CollapseDelayed"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EACZC,uBAAuB,EAEvBC,8BAA8B,QAEzB,yBAAyB;AAEhC,SAASC,aAAa,EAAEC,YAAY,EAAEC,cAAc,QAAQ,mBAAmB;AAC/E,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD,+DAA+D,GAC/D,SAASC,oBAAoB,EAC3BC,OAAO,EACPC,WAAW,EACXC,cAAc,EAEd,eAAe;AACfC,YAAY,EACZC,kBAAkBD,YAAY,EAC9BE,MAAM,EACNC,KAAK,EAEL,cAAc;AACdC,gBAAgB,EAChBC,sBAAsBD,gBAAgB,EACtCE,UAAU,EACVC,SAAS,EAGwB;IACjC,oBAAoB;IACpB,0FAA0F;IAC1F,MAAMC,aAA2B;QAC/BhB,cAAc;YAAEM;YAAaW,UAAUT;YAAcE;YAAQL;QAAQ;QACrEH,eAAe;YAAEgB,WAAW;YAASZ;YAAaW,UAAUT;YAAcE;QAAO;KAClF;IACD,+EAA+E;IAC/E,IAAIH,gBAAgB;QAClBS,WAAWG,IAAI,CAAC;YACd,GAAGhB,SAAS;gBAAEe,WAAW;gBAASD,UAAUR;gBAAiBC;YAAO,EAAE;YACtEC;YACAS,MAAM;QACR;IACF;IAEA,mBAAmB;IACnB,yFAAyF;IACzF,MAAMC,YAA0B,EAAE;IAClC,gFAAgF;IAChF,IAAId,gBAAgB;QAClBc,UAAUF,IAAI,CAAChB,SAAS;YAAEe,WAAW;YAAQD,UAAUJ;YAAqBH,QAAQI;QAAW;IACjG;IAEAO,UAAUF,IAAI,CACZlB,aAAa;QAAEK;QAAaW,UAAUL;QAAkBF,QAAQI;QAAYT;QAASM,OAAOI;IAAU,IACtGb,eAAe;QACbgB,WAAW;QACXZ;QACAW,UAAUL;QACVF,QAAQI;QACRH,OAAOI;IACT;IAGF,OAAO;QACLO,OAAON;QACPO,MAAMF;IACR;AACF;AAEA,iDAAiD,GACjD,MAAMG,qBAAuD,CAAC,EAC5DnB,OAAO,EACPY,WAAWpB,aAAa4B,cAAc,EACtCf,SAASb,aAAa6B,gBAAgB,EACtCC,eAAeV,QAAQ,EACvBH,aAAaJ,MAAM,EACnBH,iBAAiB,IAAI,EACrBD,cAAc,UAAU,EACzB;IACC,OAAOF,oBAAoB;QACzBC;QACAC;QACAC;QACAC,cAAcS;QACdR,iBAAiBQ;QACjBP;QACAE,kBAAkBe;QAClBd,qBAAqBc;QACrBb;QACAH,OAAO;QACPI,WAAW;IACb;AACF;AAEA,gHAAgH,GAChH,MAAMa,4BAAqE,CAAC,EAC1EvB,OAAO,EACPG,eAAeX,aAAa4B,cAAc,EAC1ChB,kBAAkBZ,aAAagC,cAAc,EAC7CnB,SAASb,aAAaiC,aAAa,EACnCnB,QAAQd,aAAa4B,cAAc,EACnCb,mBAAmBJ,YAAY,EAC/BK,sBAAsBJ,eAAe,EACrCK,aAAaJ,MAAM,EACnBK,YAAYlB,aAAagC,cAAc,EACvCtB,iBAAiB,IAAI,EACrBD,cAAc,UAAU,EACzB;IACC,OAAOF,oBAAoB;QACzBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;AACF;AAEA,gFAAgF,GAChF,OAAO,MAAMgB,WAAWjC,wBAAwB0B,oBAAoB;AAEpE,OAAO,MAAMQ,iBAAiBjC,+BAA+BgC,UAAU;IACrEd,UAAUpB,aAAaoC,YAAY;AACrC,GAAG;AAEH,OAAO,MAAMC,kBAAkBnC,+BAA+BgC,UAAU;IACtEd,UAAUpB,aAAagC,cAAc;AACvC,GAAG;AAEH,kGAAkG,GAClG,OAAO,MAAMM,kBAAkBrC,wBAAwB8B,2BAA2B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/collapse-types.ts"],"sourcesContent":["export type CollapseOrientation = 'horizontal' | 'vertical';\n\n
|
1
|
+
{"version":3,"sources":["../src/components/Collapse/collapse-types.ts"],"sourcesContent":["export type CollapseOrientation = 'horizontal' | 'vertical';\n\n/** Common properties shared by all collapse components */\ntype CollapseBaseParams = {\n /** Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value. */\n easing?: string;\n\n /** Easing curve for the exit transition. Defaults to the `easing` param for symmetry. */\n exitEasing?: string;\n\n /** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */\n orientation?: CollapseOrientation;\n\n /** Whether to animate the opacity. Defaults to `true`. */\n animateOpacity?: boolean;\n};\n\nexport type CollapseParams = CollapseBaseParams & {\n /** Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms). */\n duration?: number;\n\n /** Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry. */\n exitDuration?: number;\n};\n\nexport type CollapseDelayedParams = CollapseBaseParams & {\n /** Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms). */\n sizeDuration?: number;\n\n /** Time (ms) for the fade-in. Defaults to the `sizeDuration` param, to sync fade-in with expand. */\n opacityDuration?: number;\n\n /** Time (ms) for the size collapse. Defaults to the `sizeDuration` param, for temporal symmetry. */\n exitSizeDuration?: number;\n\n /** Time (ms) for the fade-out. Defaults to the `exitSizeDuration` param, to sync the fade-out with the collapse. */\n exitOpacityDuration?: number;\n\n /** Time (ms) between the size expand start and the fade-in start. Defaults to `0`. */\n delay?: number;\n\n /** Time (ms) between the fade-out start and the size collapse start. Defaults to `0`. */\n exitDelay?: number;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAyBA,WAkBE"}
|
@@ -1 +1 @@
|
|
1
|
-
export { Collapse, CollapseDelayed, CollapseRelaxed, CollapseSnappy
|
1
|
+
export { Collapse, CollapseDelayed, CollapseRelaxed, CollapseSnappy } from './Collapse';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/index.ts"],"sourcesContent":["export {
|
1
|
+
{"version":3,"sources":["../src/components/Collapse/index.ts"],"sourcesContent":["export { Collapse, CollapseDelayed, CollapseRelaxed, CollapseSnappy } from './Collapse';\n"],"names":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy"],"rangeMappings":"","mappings":"AAAA,SAASA,QAAQ,EAAEC,eAAe,EAAEC,eAAe,EAAEC,cAAc,QAAQ,aAAa"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Fade/Fade.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\
|
1
|
+
{"version":3,"sources":["../src/components/Fade/Fade.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { FadeParams } from './fade-types';\n\n/** Define a presence motion for fade in/out */\nexport const fadePresenceFn: PresenceMotionFn<FadeParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveEasyEase,\n exitDuration = duration,\n exitEasing = easing,\n}) => {\n return {\n enter: fadeAtom({ direction: 'enter', duration, easing }),\n exit: fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing }),\n };\n};\n\n/** A React component that applies fade in/out transitions to its children. */\nexport const Fade = createPresenceComponent(fadePresenceFn);\n\nexport const FadeSnappy = createPresenceComponentVariant(Fade, { duration: motionTokens.durationFast });\n\nexport const FadeRelaxed = createPresenceComponentVariant(Fade, { duration: motionTokens.durationGentle });\n"],"names":["motionTokens","createPresenceComponent","createPresenceComponentVariant","fadeAtom","fadePresenceFn","duration","durationNormal","easing","curveEasyEase","exitDuration","exitEasing","enter","direction","exit","Fade","FadeSnappy","durationFast","FadeRelaxed","durationGentle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,YAAY,EACZC,uBAAuB,EAEvBC,8BAA8B,QACzB,yBAAyB;AAChC,SAASC,QAAQ,QAAQ,wBAAwB;AAGjD,8CAA8C,GAC9C,OAAO,MAAMC,iBAA+C,CAAC,EAC3DC,WAAWL,aAAaM,cAAc,EACtCC,SAASP,aAAaQ,aAAa,EACnCC,eAAeJ,QAAQ,EACvBK,aAAaH,MAAM,EACpB;IACC,OAAO;QACLI,OAAOR,SAAS;YAAES,WAAW;YAASP;YAAUE;QAAO;QACvDM,MAAMV,SAAS;YAAES,WAAW;YAAQP,UAAUI;YAAcF,QAAQG;QAAW;IACjF;AACF,EAAE;AAEF,4EAA4E,GAC5E,OAAO,MAAMI,OAAOb,wBAAwBG,gBAAgB;AAE5D,OAAO,MAAMW,aAAab,+BAA+BY,MAAM;IAAET,UAAUL,aAAagB,YAAY;AAAC,GAAG;AAExG,OAAO,MAAMC,cAAcf,+BAA+BY,MAAM;IAAET,UAAUL,aAAakB,cAAc;AAAC,GAAG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Fade/fade-types.ts"],"sourcesContent":["export type FadeParams = {\n /** Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms). */\n duration?: number;\n\n /** Easing curve for the enter transition (fade-in). Defaults to the `curveEasyEase` value. */\n easing?: string;\n\n /** Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry. */\n exitDuration?: number;\n\n /** Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry. */\n exitEasing?: string;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAYE"}
|