@fluentui/react-motion-components-preview 0.6.2 → 0.8.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 +22 -2
- package/dist/index.d.ts +75 -77
- package/lib/atoms/blur-atom.js +26 -0
- package/lib/atoms/blur-atom.js.map +1 -0
- package/lib/atoms/fade-atom.js +3 -3
- package/lib/atoms/fade-atom.js.map +1 -1
- package/lib/atoms/scale-atom.js +5 -5
- package/lib/atoms/scale-atom.js.map +1 -1
- package/lib/atoms/slide-atom.js +27 -0
- package/lib/atoms/slide-atom.js.map +1 -0
- package/lib/components/Blur/Blur.js +48 -0
- package/lib/components/Blur/Blur.js.map +1 -0
- package/lib/components/Blur/blur-types.js +1 -0
- package/lib/components/Blur/blur-types.js.map +1 -0
- package/lib/components/Blur/index.js +1 -0
- package/lib/components/Blur/index.js.map +1 -0
- package/lib/components/Collapse/Collapse.js +117 -77
- package/lib/components/Collapse/Collapse.js.map +1 -1
- package/lib/components/Collapse/collapse-atoms.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 +8 -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/Fade/index.js.map +1 -1
- package/lib/components/Scale/Scale.js +16 -5
- package/lib/components/Scale/Scale.js.map +1 -1
- package/lib/components/Scale/index.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 +58 -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 +3 -1
- package/lib/index.js.map +1 -1
- package/lib/types.js +2 -10
- package/lib/types.js.map +1 -1
- package/lib-commonjs/atoms/blur-atom.js +29 -0
- package/lib-commonjs/atoms/blur-atom.js.map +1 -0
- 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 +3 -3
- package/lib-commonjs/atoms/scale-atom.js.map +1 -1
- package/lib-commonjs/atoms/slide-atom.js +29 -0
- package/lib-commonjs/atoms/slide-atom.js.map +1 -0
- package/lib-commonjs/components/Blur/Blur.js +58 -0
- package/lib-commonjs/components/Blur/Blur.js.map +1 -0
- package/lib-commonjs/components/Blur/blur-types.js +4 -0
- package/lib-commonjs/components/Blur/blur-types.js.map +1 -0
- package/lib-commonjs/components/Blur/index.js +11 -0
- package/lib-commonjs/components/Blur/index.js.map +1 -0
- package/lib-commonjs/components/Collapse/Collapse.js +116 -82
- package/lib-commonjs/components/Collapse/Collapse.js.map +1 -1
- package/lib-commonjs/components/Collapse/collapse-atoms.js.map +1 -1
- package/lib-commonjs/components/Collapse/collapse-types.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/Fade/index.js.map +1 -1
- package/lib-commonjs/components/Scale/Scale.js +16 -5
- package/lib-commonjs/components/Scale/Scale.js.map +1 -1
- package/lib-commonjs/components/Scale/index.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 +79 -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 +12 -4
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,32 @@
|
|
1
1
|
# Change Log - @fluentui/react-motion-components-preview
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 28 Jul 2025 18:44:10 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [0.8.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.8.0)
|
8
|
+
|
9
|
+
Mon, 28 Jul 2025 18:44:10 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.7.0..@fluentui/react-motion-components-preview_v0.8.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- feat(motion): add Fade presence motion component ([PR #34839](https://github.com/microsoft/fluentui/pull/34839) by robertpenner@microsoft.com)
|
15
|
+
|
16
|
+
## [0.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.7.0)
|
17
|
+
|
18
|
+
Wed, 16 Jul 2025 13:52:47 GMT
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.6.2..@fluentui/react-motion-components-preview_v0.7.0)
|
20
|
+
|
21
|
+
### Minor changes
|
22
|
+
|
23
|
+
- refactor(Collapse): make consistent with other motion components ([PR #34831](https://github.com/microsoft/fluentui/pull/34831) by robertpenner@microsoft.com)
|
24
|
+
- feat(motion): add Slide presence motion component ([PR #34774](https://github.com/microsoft/fluentui/pull/34774) by robertpenner@microsoft.com)
|
25
|
+
- refactor(motion): apply consistent patterns across Fade and Scale ([PR #34830](https://github.com/microsoft/fluentui/pull/34830) by robertpenner@microsoft.com)
|
26
|
+
|
7
27
|
## [0.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-motion-components-preview_v0.6.2)
|
8
28
|
|
9
|
-
Thu, 26 Jun 2025 14:
|
29
|
+
Thu, 26 Jun 2025 14:11:54 GMT
|
10
30
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motion-components-preview_v0.5.0..@fluentui/react-motion-components-preview_v0.6.2)
|
11
31
|
|
12
32
|
### Patches
|
package/dist/index.d.ts
CHANGED
@@ -1,111 +1,109 @@
|
|
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
|
-
/**
|
6
|
-
|
3
|
+
/**
|
4
|
+
* Common opacity animation parameter for motion components.
|
5
|
+
*/
|
6
|
+
declare type AnimateOpacity = {
|
7
|
+
/** Whether to animate the opacity. Defaults to `true`. */
|
8
|
+
animateOpacity?: boolean;
|
9
|
+
};
|
7
10
|
|
8
|
-
|
11
|
+
/** A React component that applies blur in/out transitions to its children. */
|
12
|
+
export declare const Blur: PresenceComponent<BlurParams>;
|
9
13
|
|
10
|
-
declare type
|
11
|
-
/**
|
12
|
-
|
13
|
-
/** Time (ms) for the fade-in. Defaults to the enterSizeDuration param, to sync fade-in with expand. */
|
14
|
-
enterOpacityDuration?: number;
|
15
|
-
/** Time (ms) for the size collapse. Defaults to the enterSizeDuration param, for temporal symmetry.. */
|
16
|
-
exitSizeDuration?: number;
|
17
|
-
/** Defaults to the exitSizeDuration param, to sync the fade-out with the collapse. */
|
18
|
-
exitOpacityDuration?: number;
|
19
|
-
/** Time (ms) between the size expand start and the fade-in start. Defaults to `0`. */
|
20
|
-
enterDelay?: number;
|
21
|
-
/** Time (ms) between the fade-out start and the size collapse start. Defaults to `0`. */
|
22
|
-
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;
|
14
|
+
declare type BlurParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
|
15
|
+
/** The radius of pixels to blend into the blur. A length string, defaulting to '20px'. */
|
16
|
+
fromRadius?: string;
|
27
17
|
};
|
28
18
|
|
29
|
-
|
30
|
-
|
31
|
-
export declare const CollapseRelaxed: PresenceComponent<CollapseRuntimeParams>;
|
19
|
+
/** A React component that applies collapse/expand transitions to its children. */
|
20
|
+
export declare const Collapse: PresenceComponent<CollapseParams>;
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
animateOpacity?: boolean;
|
22
|
+
/** Common properties shared by all collapse components */
|
23
|
+
declare type CollapseBaseParams = PresenceEasing & AnimateOpacity & {
|
36
24
|
/** The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height. */
|
37
25
|
orientation?: CollapseOrientation;
|
38
26
|
};
|
39
27
|
|
40
|
-
|
28
|
+
/** A React component that applies collapse/expand transitions with delayed fade to its children. */
|
29
|
+
export declare const CollapseDelayed: PresenceComponent<CollapseDelayedParams>;
|
41
30
|
|
42
|
-
declare type
|
43
|
-
/** Time (ms) for the
|
44
|
-
|
45
|
-
/**
|
46
|
-
|
47
|
-
/** Time (ms) for the
|
48
|
-
|
49
|
-
/**
|
50
|
-
|
31
|
+
declare type CollapseDelayedParams = CollapseBaseParams & {
|
32
|
+
/** Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms). */
|
33
|
+
sizeDuration?: number;
|
34
|
+
/** Time (ms) for the fade-in. Defaults to the `sizeDuration` param, to sync fade-in with expand. */
|
35
|
+
opacityDuration?: number;
|
36
|
+
/** Time (ms) for the size collapse. Defaults to the `sizeDuration` param, for temporal symmetry. */
|
37
|
+
exitSizeDuration?: number;
|
38
|
+
/** Time (ms) for the fade-out. Defaults to the `exitSizeDuration` param, to sync the fade-out with the collapse. */
|
39
|
+
exitOpacityDuration?: number;
|
40
|
+
/** Time (ms) between the size expand start and the fade-in start. Defaults to `0`. */
|
41
|
+
delay?: number;
|
42
|
+
/** Time (ms) between the fade-out start and the size collapse start. Defaults to `0`. */
|
43
|
+
exitDelay?: number;
|
51
44
|
};
|
52
45
|
|
53
|
-
|
54
|
-
|
46
|
+
declare type CollapseOrientation = 'horizontal' | 'vertical';
|
47
|
+
|
48
|
+
declare type CollapseParams = CollapseBaseParams & PresenceDuration;
|
49
|
+
|
50
|
+
export declare const CollapseRelaxed: PresenceComponent<CollapseParams>;
|
55
51
|
|
56
|
-
|
57
|
-
export declare const createCollapsePresence: PresenceMotionFnCreator<CollapseVariantParams, CollapseRuntimeParams>;
|
52
|
+
export declare const CollapseSnappy: PresenceComponent<CollapseParams>;
|
58
53
|
|
59
54
|
/** A React component that applies fade in/out transitions to its children. */
|
60
|
-
export declare const Fade: PresenceComponent<
|
55
|
+
export declare const Fade: PresenceComponent<FadeParams>;
|
61
56
|
|
62
|
-
|
57
|
+
declare type FadeParams = PresenceDuration & PresenceEasing;
|
63
58
|
|
64
|
-
export declare const
|
59
|
+
export declare const FadeRelaxed: PresenceComponent<FadeParams>;
|
65
60
|
|
66
|
-
declare
|
67
|
-
|
61
|
+
export declare const FadeSnappy: PresenceComponent<FadeParams>;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Common duration parameters for presence motion components.
|
65
|
+
*/
|
66
|
+
declare type PresenceDuration = {
|
67
|
+
/** Time (ms) for the enter transition. */
|
68
68
|
duration?: number;
|
69
|
-
/**
|
70
|
-
easing?: string;
|
71
|
-
/** Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry. */
|
69
|
+
/** Time (ms) for the exit transition. Defaults to the `duration` param for symmetry. */
|
72
70
|
exitDuration?: number;
|
73
|
-
/** Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry. */
|
74
|
-
exitEasing?: string;
|
75
71
|
};
|
76
72
|
|
77
73
|
/**
|
78
|
-
*
|
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`.
|
74
|
+
* Common easing parameters for presence motion components.
|
86
75
|
*/
|
87
|
-
declare type
|
76
|
+
declare type PresenceEasing = {
|
77
|
+
/** Easing curve for the enter transition. */
|
78
|
+
easing?: string;
|
79
|
+
/** Easing curve for the exit transition. Defaults to the `easing` param for symmetry. */
|
80
|
+
exitEasing?: string;
|
81
|
+
};
|
88
82
|
|
89
83
|
/** A React component that applies scale in/out transitions to its children. */
|
90
|
-
export declare const Scale: PresenceComponent<
|
91
|
-
|
92
|
-
export declare const ScaleRelaxed: PresenceComponent<ScaleVariantParams>;
|
84
|
+
export declare const Scale: PresenceComponent<ScaleParams>;
|
93
85
|
|
94
|
-
|
95
|
-
|
96
|
-
declare type ScaleVariantParams = {
|
97
|
-
/** Time (ms) for the enter transition (scale-in). Defaults to the `durationGentle` value (250 ms). */
|
98
|
-
duration?: number;
|
99
|
-
/** Easing curve for the enter transition (scale-in). Defaults to the `curveDecelerateMax` value. */
|
100
|
-
easing?: string;
|
101
|
-
/** Time (ms) for the exit transition (scale-out). Defaults to the `durationNormal` value (200 ms). */
|
102
|
-
exitDuration?: number;
|
103
|
-
/** Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value. */
|
104
|
-
exitEasing?: string;
|
86
|
+
declare type ScaleParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
|
105
87
|
/** The scale value to animate from. Defaults to `0.9`. */
|
106
88
|
fromScale?: number;
|
107
|
-
/** Whether to animate the opacity. Defaults to `true`. */
|
108
|
-
animateOpacity?: boolean;
|
109
89
|
};
|
110
90
|
|
91
|
+
export declare const ScaleRelaxed: PresenceComponent<ScaleParams>;
|
92
|
+
|
93
|
+
export declare const ScaleSnappy: PresenceComponent<ScaleParams>;
|
94
|
+
|
95
|
+
/** A React component that applies slide in/out transitions to its children. */
|
96
|
+
export declare const Slide: PresenceComponent<SlideParams>;
|
97
|
+
|
98
|
+
declare type SlideParams = PresenceDuration & PresenceEasing & AnimateOpacity & {
|
99
|
+
/** The X translate value with units to animate from. Defaults to `'0px'`. */
|
100
|
+
fromX?: string;
|
101
|
+
/** The Y translate value with units to animate from. Defaults to `'20px'`. */
|
102
|
+
fromY?: string;
|
103
|
+
};
|
104
|
+
|
105
|
+
export declare const SlideRelaxed: PresenceComponent<SlideParams>;
|
106
|
+
|
107
|
+
export declare const SlideSnappy: PresenceComponent<SlideParams>;
|
108
|
+
|
111
109
|
export { }
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { motionTokens } from '@fluentui/react-motion';
|
2
|
+
/**
|
3
|
+
* Generates a motion atom object for a blur-in or blur-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 fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '20px'.
|
8
|
+
* @returns A motion atom object with filter blur keyframes and the supplied duration and easing.
|
9
|
+
*/ export const blurAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromRadius = '10px' })=>{
|
10
|
+
const keyframes = [
|
11
|
+
{
|
12
|
+
filter: `blur(${fromRadius})`
|
13
|
+
},
|
14
|
+
{
|
15
|
+
filter: 'blur(0px)'
|
16
|
+
}
|
17
|
+
];
|
18
|
+
if (direction === 'exit') {
|
19
|
+
keyframes.reverse();
|
20
|
+
}
|
21
|
+
return {
|
22
|
+
keyframes,
|
23
|
+
duration,
|
24
|
+
easing
|
25
|
+
};
|
26
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/atoms/blur-atom.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection, motionTokens } from '@fluentui/react-motion';\n\ninterface BlurAtomParams {\n direction: PresenceDirection;\n duration: number;\n easing?: string;\n fromRadius?: string;\n}\n\n/**\n * Generates a motion atom object for a blur-in or blur-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 fromRadius - The blur radius value with units (e.g., '20px', '1rem'). Defaults to '20px'.\n * @returns A motion atom object with filter blur keyframes and the supplied duration and easing.\n */\nexport const blurAtom = ({\n direction,\n duration,\n easing = motionTokens.curveLinear,\n fromRadius = '10px',\n}: BlurAtomParams): AtomMotion => {\n const keyframes = [{ filter: `blur(${fromRadius})` }, { filter: 'blur(0px)' }];\n if (direction === 'exit') {\n keyframes.reverse();\n }\n return {\n keyframes,\n duration,\n easing,\n };\n};\n"],"names":["motionTokens","blurAtom","direction","duration","easing","curveLinear","fromRadius","keyframes","filter","reverse"],"mappings":"AAAA,SAAwCA,YAAY,QAAQ,yBAAyB;AASrF;;;;;;;CAOC,GACD,OAAO,MAAMC,WAAW,CAAC,EACvBC,SAAS,EACTC,QAAQ,EACRC,SAASJ,aAAaK,WAAW,EACjCC,aAAa,MAAM,EACJ;IACf,MAAMC,YAAY;QAAC;YAAEC,QAAQ,CAAC,KAAK,EAAEF,WAAW,CAAC,CAAC;QAAC;QAAG;YAAEE,QAAQ;QAAY;KAAE;IAC9E,IAAIN,cAAc,QAAQ;QACxBK,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAJ;QACAC;IACF;AACF,EAAE"}
|
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"],"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"}
|
package/lib/atoms/scale-atom.js
CHANGED
@@ -4,16 +4,16 @@ import { motionTokens } from '@fluentui/react-motion';
|
|
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
|
-
* @param
|
8
|
-
* @param
|
7
|
+
* @param fromScale - The starting scale value. Defaults to 0.9.
|
8
|
+
* @param toScale - The ending scale value. Defaults to 1.
|
9
9
|
* @returns A motion atom object with scale keyframes and the supplied duration and easing.
|
10
|
-
*/ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear,
|
10
|
+
*/ export const scaleAtom = ({ direction, duration, easing = motionTokens.curveLinear, fromScale = 0.9, toScale = 1 })=>{
|
11
11
|
const keyframes = [
|
12
12
|
{
|
13
|
-
scale:
|
13
|
+
scale: fromScale
|
14
14
|
},
|
15
15
|
{
|
16
|
-
scale:
|
16
|
+
scale: toScale
|
17
17
|
}
|
18
18
|
];
|
19
19
|
if (direction === 'exit') {
|
@@ -1 +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
|
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"],"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"],"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,GAAGH,MAAM,CAAC,EAAEC,OAAO;QAAC;QAAG;YAAEE,WAAW;QAAU;KAAE;IAChF,IAAIP,cAAc,QAAQ;QACxBM,UAAUE,OAAO;IACnB;IACA,OAAO;QACLF;QACAL;QACAC;IACF;AACF,EAAE"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';
|
2
|
+
import { fadeAtom } from '../../atoms/fade-atom';
|
3
|
+
import { blurAtom } from '../../atoms/blur-atom';
|
4
|
+
/**
|
5
|
+
* Define a presence motion for blur in/out
|
6
|
+
*
|
7
|
+
* @param fromRadius - The radius of pixels to blend into the blur. A length string, defaulting to '10px'.
|
8
|
+
* @param duration - Time (ms) for the enter transition (blur-in). Defaults to the `durationSlow` value (300 ms).
|
9
|
+
* @param easing - Easing curve for the enter transition (blur-in). Defaults to the `curveDecelerateMin` value.
|
10
|
+
* @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the enter duration.
|
11
|
+
* @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.
|
12
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
13
|
+
*/ const blurPresenceFn = ({ fromRadius = '10px', duration = motionTokens.durationSlow, easing = motionTokens.curveDecelerateMin, exitDuration = duration, exitEasing = motionTokens.curveAccelerateMin, animateOpacity = true })=>{
|
14
|
+
const enterAtoms = [
|
15
|
+
blurAtom({
|
16
|
+
direction: 'enter',
|
17
|
+
duration,
|
18
|
+
easing,
|
19
|
+
fromRadius
|
20
|
+
})
|
21
|
+
];
|
22
|
+
const exitAtoms = [
|
23
|
+
blurAtom({
|
24
|
+
direction: 'exit',
|
25
|
+
duration: exitDuration,
|
26
|
+
easing: exitEasing,
|
27
|
+
fromRadius
|
28
|
+
})
|
29
|
+
];
|
30
|
+
// Only add fade atoms if animateOpacity is true.
|
31
|
+
if (animateOpacity) {
|
32
|
+
enterAtoms.push(fadeAtom({
|
33
|
+
direction: 'enter',
|
34
|
+
duration,
|
35
|
+
easing
|
36
|
+
}));
|
37
|
+
exitAtoms.push(fadeAtom({
|
38
|
+
direction: 'exit',
|
39
|
+
duration: exitDuration,
|
40
|
+
easing: exitEasing
|
41
|
+
}));
|
42
|
+
}
|
43
|
+
return {
|
44
|
+
enter: enterAtoms,
|
45
|
+
exit: exitAtoms
|
46
|
+
};
|
47
|
+
};
|
48
|
+
/** A React component that applies blur in/out transitions to its children. */ export const Blur = createPresenceComponent(blurPresenceFn);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Blur/Blur.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { blurAtom } from '../../atoms/blur-atom';\nimport { BlurParams } from './blur-types';\n\n/**\n * Define a presence motion for blur in/out\n *\n * @param fromRadius - The radius of pixels to blend into the blur. A length string, defaulting to '10px'.\n * @param duration - Time (ms) for the enter transition (blur-in). Defaults to the `durationSlow` value (300 ms).\n * @param easing - Easing curve for the enter transition (blur-in). Defaults to the `curveDecelerateMin` value.\n * @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the enter duration.\n * @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst blurPresenceFn: PresenceMotionFn<BlurParams> = ({\n fromRadius = '10px',\n duration = motionTokens.durationSlow,\n easing = motionTokens.curveDecelerateMin,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMin,\n animateOpacity = true,\n}) => {\n const enterAtoms = [blurAtom({ direction: 'enter', duration, easing, fromRadius })];\n const exitAtoms = [\n blurAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n fromRadius,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n/** A React component that applies blur in/out transitions to its children. */\nexport const Blur = createPresenceComponent(blurPresenceFn);\n"],"names":["motionTokens","createPresenceComponent","fadeAtom","blurAtom","blurPresenceFn","fromRadius","duration","durationSlow","easing","curveDecelerateMin","exitDuration","exitEasing","curveAccelerateMin","animateOpacity","enterAtoms","direction","exitAtoms","push","enter","exit","Blur"],"mappings":"AAAA,SAASA,YAAY,EAAEC,uBAAuB,QAA0B,yBAAyB;AACjG,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,QAAQ,QAAQ,wBAAwB;AAGjD;;;;;;;;;CASC,GACD,MAAMC,iBAA+C,CAAC,EACpDC,aAAa,MAAM,EACnBC,WAAWN,aAAaO,YAAY,EACpCC,SAASR,aAAaS,kBAAkB,EACxCC,eAAeJ,QAAQ,EACvBK,aAAaX,aAAaY,kBAAkB,EAC5CC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACX,SAAS;YAAEY,WAAW;YAAST;YAAUE;YAAQH;QAAW;KAAG;IACnF,MAAMW,YAAY;QAChBb,SAAS;YACPY,WAAW;YACXT,UAAUI;YACVF,QAAQG;YACRN;QACF;KACD;IAED,iDAAiD;IACjD,IAAIQ,gBAAgB;QAClBC,WAAWG,IAAI,CAACf,SAAS;YAAEa,WAAW;YAAST;YAAUE;QAAO;QAChEQ,UAAUC,IAAI,CAACf,SAAS;YAAEa,WAAW;YAAQT,UAAUI;YAAcF,QAAQG;QAAW;IAC1F;IAEA,OAAO;QACLO,OAAOJ;QACPK,MAAMH;IACR;AACF;AAEA,4EAA4E,GAC5E,OAAO,MAAMI,OAAOnB,wBAAwBG,gBAAgB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Blur/blur-types.ts"],"sourcesContent":["import type { PresenceDuration, PresenceEasing, AnimateOpacity } from '../../types';\n\nexport type BlurParams = PresenceDuration &\n PresenceEasing &\n AnimateOpacity & {\n /** The radius of pixels to blend into the blur. A length string, defaulting to '20px'. */\n fromRadius?: string;\n };\n"],"names":[],"mappings":"AAEA,WAKI"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Blur } from './Blur';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Blur/index.ts"],"sourcesContent":["export { Blur } from './Blur';\nexport type { BlurParams } from './blur-types';\n"],"names":["Blur"],"mappings":"AAAA,SAASA,IAAI,QAAQ,SAAS"}
|
@@ -1,85 +1,125 @@
|
|
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
|
+
/**
|
65
|
+
* Define a presence motion for collapse/expand
|
66
|
+
*
|
67
|
+
* @param element - The element to apply the collapse motion to
|
68
|
+
* @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)
|
69
|
+
* @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value
|
70
|
+
* @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry
|
71
|
+
* @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry
|
72
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
|
73
|
+
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
|
74
|
+
*/ const collapsePresenceFn = ({ element, duration = motionTokens.durationNormal, easing = motionTokens.curveEasyEaseMax, exitDuration = duration, exitEasing = easing, animateOpacity = true, orientation = 'vertical' })=>{
|
75
|
+
return createCollapseAtoms({
|
76
|
+
element,
|
77
|
+
orientation,
|
78
|
+
animateOpacity,
|
79
|
+
sizeDuration: duration,
|
80
|
+
opacityDuration: duration,
|
81
|
+
easing,
|
69
82
|
exitSizeDuration: exitDuration,
|
70
|
-
|
83
|
+
exitOpacityDuration: exitDuration,
|
84
|
+
exitEasing,
|
85
|
+
delay: 0,
|
86
|
+
exitDelay: 0
|
87
|
+
});
|
88
|
+
};
|
89
|
+
/**
|
90
|
+
* Define a presence motion for collapse/expand that can stagger the size and opacity motions by a given delay
|
91
|
+
*
|
92
|
+
* @param element - The element to apply the collapse motion to
|
93
|
+
* @param sizeDuration - Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms)
|
94
|
+
* @param opacityDuration - Time (ms) for the fade-in. Defaults to the `durationSlower` value (400 ms)
|
95
|
+
* @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEase` value
|
96
|
+
* @param delay - Time (ms) between the size expand start and the fade-in start. Defaults to the `durationNormal` value (200 ms)
|
97
|
+
* @param exitSizeDuration - Time (ms) for the size collapse. Defaults to the `sizeDuration` param for temporal symmetry
|
98
|
+
* @param exitOpacityDuration - Time (ms) for the fade-out. Defaults to the `opacityDuration` param for temporal symmetry
|
99
|
+
* @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry
|
100
|
+
* @param exitDelay - Time (ms) between the fade-out start and the size collapse start. Defaults to the `durationSlower` value (400 ms)
|
101
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
|
102
|
+
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
|
103
|
+
*/ 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' })=>{
|
104
|
+
return createCollapseAtoms({
|
105
|
+
element,
|
106
|
+
orientation,
|
107
|
+
animateOpacity,
|
108
|
+
sizeDuration,
|
109
|
+
opacityDuration,
|
110
|
+
easing,
|
111
|
+
delay,
|
112
|
+
exitSizeDuration,
|
113
|
+
exitOpacityDuration,
|
114
|
+
exitEasing,
|
115
|
+
exitDelay
|
71
116
|
});
|
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
|
-
}));
|
117
|
+
};
|
118
|
+
/** A React component that applies collapse/expand transitions to its children. */ export const Collapse = createPresenceComponent(collapsePresenceFn);
|
119
|
+
export const CollapseSnappy = createPresenceComponentVariant(Collapse, {
|
120
|
+
duration: motionTokens.durationFast
|
121
|
+
});
|
122
|
+
export const CollapseRelaxed = createPresenceComponentVariant(Collapse, {
|
123
|
+
duration: motionTokens.durationSlower
|
124
|
+
});
|
125
|
+
/** A React component that applies collapse/expand transitions with delayed fade to its children. */ export const CollapseDelayed = createPresenceComponent(collapseDelayedPresenceFn);
|