@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
@@ -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":";;;;+BAASA;;;eAAAA,UAAI;;;sBAAQ"}
|
@@ -20,96 +20,130 @@ _export(exports, {
|
|
20
20
|
},
|
21
21
|
CollapseSnappy: function() {
|
22
22
|
return CollapseSnappy;
|
23
|
-
},
|
24
|
-
createCollapseDelayedPresence: function() {
|
25
|
-
return createCollapseDelayedPresence;
|
26
|
-
},
|
27
|
-
createCollapsePresence: function() {
|
28
|
-
return createCollapsePresence;
|
29
23
|
}
|
30
24
|
});
|
31
25
|
const _reactmotion = require("@fluentui/react-motion");
|
32
26
|
const _collapseatoms = require("./collapse-atoms");
|
33
27
|
const _fadeatom = require("../../atoms/fade-atom");
|
34
|
-
|
35
|
-
|
36
|
-
exitSizeDuration
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
orientation,
|
42
|
-
duration: enterSizeDuration,
|
43
|
-
easing: enterEasing,
|
44
|
-
element
|
45
|
-
}),
|
46
|
-
(0, _collapseatoms.whitespaceAtom)({
|
47
|
-
direction: 'enter',
|
48
|
-
orientation,
|
49
|
-
duration: enterSizeDuration,
|
50
|
-
easing: enterEasing
|
51
|
-
})
|
52
|
-
];
|
53
|
-
// Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
54
|
-
if (animateOpacity) {
|
55
|
-
enterAtoms.push({
|
56
|
-
...(0, _fadeatom.fadeAtom)({
|
57
|
-
direction: 'enter',
|
58
|
-
duration: enterOpacityDuration,
|
59
|
-
easing: enterEasing
|
60
|
-
}),
|
61
|
-
delay: enterDelay,
|
62
|
-
fill: 'both'
|
63
|
-
});
|
64
|
-
}
|
65
|
-
// ----- EXIT -----
|
66
|
-
// The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.
|
67
|
-
const exitAtoms = [];
|
68
|
-
// Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
69
|
-
if (animateOpacity) {
|
70
|
-
exitAtoms.push((0, _fadeatom.fadeAtom)({
|
71
|
-
direction: 'exit',
|
72
|
-
duration: exitOpacityDuration,
|
73
|
-
easing: exitEasing
|
74
|
-
}));
|
75
|
-
}
|
76
|
-
exitAtoms.push((0, _collapseatoms.sizeExitAtom)({
|
28
|
+
/** Internal helper to create collapse atoms with shared logic */ function createCollapseAtoms({ element, orientation, animateOpacity, // Enter params
|
29
|
+
sizeDuration, opacityDuration = sizeDuration, easing, delay, // Exit params
|
30
|
+
exitSizeDuration, exitOpacityDuration = exitSizeDuration, exitEasing, exitDelay }) {
|
31
|
+
// ----- ENTER -----
|
32
|
+
// The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.
|
33
|
+
const enterAtoms = [
|
34
|
+
(0, _collapseatoms.sizeEnterAtom)({
|
77
35
|
orientation,
|
78
|
-
duration:
|
79
|
-
easing
|
80
|
-
element
|
81
|
-
|
82
|
-
|
83
|
-
direction: '
|
36
|
+
duration: sizeDuration,
|
37
|
+
easing,
|
38
|
+
element
|
39
|
+
}),
|
40
|
+
(0, _collapseatoms.whitespaceAtom)({
|
41
|
+
direction: 'enter',
|
84
42
|
orientation,
|
85
|
-
duration:
|
86
|
-
easing
|
87
|
-
|
43
|
+
duration: sizeDuration,
|
44
|
+
easing
|
45
|
+
})
|
46
|
+
];
|
47
|
+
// Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
48
|
+
if (animateOpacity) {
|
49
|
+
enterAtoms.push({
|
50
|
+
...(0, _fadeatom.fadeAtom)({
|
51
|
+
direction: 'enter',
|
52
|
+
duration: opacityDuration,
|
53
|
+
easing
|
54
|
+
}),
|
55
|
+
delay,
|
56
|
+
fill: 'both'
|
57
|
+
});
|
58
|
+
}
|
59
|
+
// ----- EXIT -----
|
60
|
+
// The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.
|
61
|
+
const exitAtoms = [];
|
62
|
+
// Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.
|
63
|
+
if (animateOpacity) {
|
64
|
+
exitAtoms.push((0, _fadeatom.fadeAtom)({
|
65
|
+
direction: 'exit',
|
66
|
+
duration: exitOpacityDuration,
|
67
|
+
easing: exitEasing
|
88
68
|
}));
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
69
|
+
}
|
70
|
+
exitAtoms.push((0, _collapseatoms.sizeExitAtom)({
|
71
|
+
orientation,
|
72
|
+
duration: exitSizeDuration,
|
73
|
+
easing: exitEasing,
|
74
|
+
element,
|
75
|
+
delay: exitDelay
|
76
|
+
}), (0, _collapseatoms.whitespaceAtom)({
|
77
|
+
direction: 'exit',
|
78
|
+
orientation,
|
79
|
+
duration: exitSizeDuration,
|
80
|
+
easing: exitEasing,
|
81
|
+
delay: exitDelay
|
82
|
+
}));
|
83
|
+
return {
|
84
|
+
enter: enterAtoms,
|
85
|
+
exit: exitAtoms
|
93
86
|
};
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* Define a presence motion for collapse/expand
|
90
|
+
*
|
91
|
+
* @param element - The element to apply the collapse motion to
|
92
|
+
* @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)
|
93
|
+
* @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value
|
94
|
+
* @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry
|
95
|
+
* @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry
|
96
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
|
97
|
+
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
|
98
|
+
*/ const collapsePresenceFn = ({ element, duration = _reactmotion.motionTokens.durationNormal, easing = _reactmotion.motionTokens.curveEasyEaseMax, exitDuration = duration, exitEasing = easing, animateOpacity = true, orientation = 'vertical' })=>{
|
99
|
+
return createCollapseAtoms({
|
100
|
+
element,
|
101
|
+
orientation,
|
102
|
+
animateOpacity,
|
103
|
+
sizeDuration: duration,
|
104
|
+
opacityDuration: duration,
|
105
|
+
easing,
|
99
106
|
exitSizeDuration: exitDuration,
|
100
|
-
|
107
|
+
exitOpacityDuration: exitDuration,
|
108
|
+
exitEasing,
|
109
|
+
delay: 0,
|
110
|
+
exitDelay: 0
|
101
111
|
});
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
112
|
+
};
|
113
|
+
/**
|
114
|
+
* Define a presence motion for collapse/expand that can stagger the size and opacity motions by a given delay
|
115
|
+
*
|
116
|
+
* @param element - The element to apply the collapse motion to
|
117
|
+
* @param sizeDuration - Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms)
|
118
|
+
* @param opacityDuration - Time (ms) for the fade-in. Defaults to the `durationSlower` value (400 ms)
|
119
|
+
* @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEase` value
|
120
|
+
* @param delay - Time (ms) between the size expand start and the fade-in start. Defaults to the `durationNormal` value (200 ms)
|
121
|
+
* @param exitSizeDuration - Time (ms) for the size collapse. Defaults to the `sizeDuration` param for temporal symmetry
|
122
|
+
* @param exitOpacityDuration - Time (ms) for the fade-out. Defaults to the `opacityDuration` param for temporal symmetry
|
123
|
+
* @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry
|
124
|
+
* @param exitDelay - Time (ms) between the fade-out start and the size collapse start. Defaults to the `durationSlower` value (400 ms)
|
125
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
|
126
|
+
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
|
127
|
+
*/ const collapseDelayedPresenceFn = ({ element, sizeDuration = _reactmotion.motionTokens.durationNormal, opacityDuration = _reactmotion.motionTokens.durationSlower, easing = _reactmotion.motionTokens.curveEasyEase, delay = _reactmotion.motionTokens.durationNormal, exitSizeDuration = sizeDuration, exitOpacityDuration = opacityDuration, exitEasing = easing, exitDelay = _reactmotion.motionTokens.durationSlower, animateOpacity = true, orientation = 'vertical' })=>{
|
128
|
+
return createCollapseAtoms({
|
129
|
+
element,
|
130
|
+
orientation,
|
131
|
+
animateOpacity,
|
132
|
+
sizeDuration,
|
133
|
+
opacityDuration,
|
134
|
+
easing,
|
135
|
+
delay,
|
136
|
+
exitSizeDuration,
|
137
|
+
exitOpacityDuration,
|
138
|
+
exitEasing,
|
139
|
+
exitDelay
|
140
|
+
});
|
141
|
+
};
|
142
|
+
const Collapse = (0, _reactmotion.createPresenceComponent)(collapsePresenceFn);
|
143
|
+
const CollapseSnappy = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
|
144
|
+
duration: _reactmotion.motionTokens.durationFast
|
145
|
+
});
|
146
|
+
const CollapseRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
|
147
|
+
duration: _reactmotion.motionTokens.durationSlower
|
148
|
+
});
|
149
|
+
const CollapseDelayed = (0, _reactmotion.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/**\n * Define a presence motion for collapse/expand\n *\n * @param element - The element to apply the collapse motion to\n * @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)\n * @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value\n * @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry\n * @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`\n * @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height\n */\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/**\n * Define a presence motion for collapse/expand that can stagger the size and opacity motions by a given delay\n *\n * @param element - The element to apply the collapse motion to\n * @param sizeDuration - Time (ms) for the size expand. Defaults to the `durationNormal` value (200 ms)\n * @param opacityDuration - Time (ms) for the fade-in. Defaults to the `durationSlower` value (400 ms)\n * @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEase` value\n * @param delay - Time (ms) between the size expand start and the fade-in start. Defaults to the `durationNormal` value (200 ms)\n * @param exitSizeDuration - Time (ms) for the size collapse. Defaults to the `sizeDuration` param for temporal symmetry\n * @param exitOpacityDuration - Time (ms) for the fade-out. Defaults to the `opacityDuration` param for temporal symmetry\n * @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry\n * @param exitDelay - Time (ms) between the fade-out start and the size collapse start. Defaults to the `durationSlower` value (400 ms)\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`\n * @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height\n */\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":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","createCollapseAtoms","element","orientation","animateOpacity","sizeDuration","opacityDuration","easing","delay","exitSizeDuration","exitOpacityDuration","exitEasing","exitDelay","enterAtoms","sizeEnterAtom","duration","whitespaceAtom","direction","push","fadeAtom","fill","exitAtoms","sizeExitAtom","enter","exit","collapsePresenceFn","motionTokens","durationNormal","curveEasyEaseMax","exitDuration","collapseDelayedPresenceFn","durationSlower","curveEasyEase","createPresenceComponent","createPresenceComponentVariant","durationFast"],"mappings":";;;;;;;;;;;IAsJaA,QAAQ;eAARA;;IAWAC,eAAe;eAAfA;;IALAC,eAAe;eAAfA;;IAJAC,cAAc;eAAdA;;;6BAlJN;+BAEqD;0BACnC;AAEzB,+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/BC,IAAAA,4BAAa,EAAC;YAAEX;YAAaY,UAAUV;YAAcE;YAAQL;QAAQ;QACrEc,IAAAA,6BAAc,EAAC;YAAEC,WAAW;YAASd;YAAaY,UAAUV;YAAcE;QAAO;KAClF;IACD,+EAA+E;IAC/E,IAAIH,gBAAgB;QAClBS,WAAWK,IAAI,CAAC;YACd,GAAGC,IAAAA,kBAAQ,EAAC;gBAAEF,WAAW;gBAASF,UAAUT;gBAAiBC;YAAO,EAAE;YACtEC;YACAY,MAAM;QACR;IACF;IAEA,mBAAmB;IACnB,yFAAyF;IACzF,MAAMC,YAA0B,EAAE;IAClC,gFAAgF;IAChF,IAAIjB,gBAAgB;QAClBiB,UAAUH,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEF,WAAW;YAAQF,UAAUL;YAAqBH,QAAQI;QAAW;IACjG;IAEAU,UAAUH,IAAI,CACZI,IAAAA,2BAAY,EAAC;QAAEnB;QAAaY,UAAUN;QAAkBF,QAAQI;QAAYT;QAASM,OAAOI;IAAU,IACtGI,IAAAA,6BAAc,EAAC;QACbC,WAAW;QACXd;QACAY,UAAUN;QACVF,QAAQI;QACRH,OAAOI;IACT;IAGF,OAAO;QACLW,OAAOV;QACPW,MAAMH;IACR;AACF;AAEA;;;;;;;;;;CAUC,GACD,MAAMI,qBAAuD,CAAC,EAC5DvB,OAAO,EACPa,WAAWW,yBAAY,CAACC,cAAc,EACtCpB,SAASmB,yBAAY,CAACE,gBAAgB,EACtCC,eAAed,QAAQ,EACvBJ,aAAaJ,MAAM,EACnBH,iBAAiB,IAAI,EACrBD,cAAc,UAAU,EACzB;IACC,OAAOF,oBAAoB;QACzBC;QACAC;QACAC;QACAC,cAAcU;QACdT,iBAAiBS;QACjBR;QACAE,kBAAkBoB;QAClBnB,qBAAqBmB;QACrBlB;QACAH,OAAO;QACPI,WAAW;IACb;AACF;AAEA;;;;;;;;;;;;;;CAcC,GACD,MAAMkB,4BAAqE,CAAC,EAC1E5B,OAAO,EACPG,eAAeqB,yBAAY,CAACC,cAAc,EAC1CrB,kBAAkBoB,yBAAY,CAACK,cAAc,EAC7CxB,SAASmB,yBAAY,CAACM,aAAa,EACnCxB,QAAQkB,yBAAY,CAACC,cAAc,EACnClB,mBAAmBJ,YAAY,EAC/BK,sBAAsBJ,eAAe,EACrCK,aAAaJ,MAAM,EACnBK,YAAYc,yBAAY,CAACK,cAAc,EACvC3B,iBAAiB,IAAI,EACrBD,cAAc,UAAU,EACzB;IACC,OAAOF,oBAAoB;QACzBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;AACF;AAGO,MAAMf,WAAWoC,IAAAA,oCAAuB,EAACR;AAEzC,MAAMzB,iBAAiBkC,IAAAA,2CAA8B,EAACrC,UAAU;IACrEkB,UAAUW,yBAAY,CAACS,YAAY;AACrC;AAEO,MAAMpC,kBAAkBmC,IAAAA,2CAA8B,EAACrC,UAAU;IACtEkB,UAAUW,yBAAY,CAACK,cAAc;AACvC;AAGO,MAAMjC,kBAAkBmC,IAAAA,oCAAuB,EAACH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/collapse-atoms.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection } from '@fluentui/react-motion';\nimport { CollapseOrientation } from './collapse-types';\n\n// ----- SIZE -----\n\nconst sizeValuesForOrientation = (orientation: CollapseOrientation, element: Element) => {\n const sizeName = orientation === 'horizontal' ? 'maxWidth' : 'maxHeight';\n const overflowName = orientation === 'horizontal' ? 'overflowX' : 'overflowY';\n const measuredSize = orientation === 'horizontal' ? element.scrollWidth : element.scrollHeight;\n const toSize = `${measuredSize}px`;\n return { sizeName, overflowName, toSize };\n};\n\ninterface SizeEnterAtomParams {\n orientation: CollapseOrientation;\n duration: number;\n easing: string;\n element: HTMLElement;\n fromSize?: string;\n}\n\nexport const sizeEnterAtom = ({\n orientation,\n duration,\n easing,\n element,\n fromSize = '0',\n}: SizeEnterAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: fromSize, [overflowName]: 'hidden' },\n { [sizeName]: toSize, offset: 0.9999, [overflowName]: 'hidden' },\n { [sizeName]: 'unset', [overflowName]: 'unset' },\n ],\n duration,\n easing,\n };\n};\n\ninterface SizeExitAtomParams extends SizeEnterAtomParams {\n delay?: number;\n}\n\nexport const sizeExitAtom = ({\n orientation,\n duration,\n easing,\n element,\n delay = 0,\n fromSize = '0',\n}: SizeExitAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: toSize, [overflowName]: 'hidden' },\n { [sizeName]: fromSize, [overflowName]: 'hidden' },\n ],\n duration,\n easing,\n fill: 'both',\n delay,\n };\n};\n\n// ----- WHITESPACE -----\n\n// Whitespace animation includes padding and margin.\nconst whitespaceValuesForOrientation = (orientation: CollapseOrientation) => {\n // horizontal whitespace collapse\n if (orientation === 'horizontal') {\n return {\n paddingStart: 'paddingInlineStart',\n paddingEnd: 'paddingInlineEnd',\n marginStart: 'marginInlineStart',\n marginEnd: 'marginInlineEnd',\n };\n }\n // vertical whitespace collapse\n return {\n paddingStart: 'paddingBlockStart',\n paddingEnd: 'paddingBlockEnd',\n marginStart: 'marginBlockStart',\n marginEnd: 'marginBlockEnd',\n };\n};\n\ninterface WhitespaceAtomParams {\n direction: PresenceDirection;\n orientation: CollapseOrientation;\n duration: number;\n easing: string;\n delay?: number;\n}\n\n/**\n * A collapse animates an element's height to zero,\n but the zero height does not eliminate padding or margin in the box model.\n So here we generate keyframes to animate those whitespace properties to zero.\n */\nexport const whitespaceAtom = ({\n direction,\n orientation,\n duration,\n easing,\n delay = 0,\n}: WhitespaceAtomParams): AtomMotion => {\n const { paddingStart, paddingEnd, marginStart, marginEnd } = whitespaceValuesForOrientation(orientation);\n // The keyframe with zero whitespace is at the start for enter and at the end for exit.\n const offset = direction === 'enter' ? 0 : 1;\n const keyframes = [{ [paddingStart]: '0', [paddingEnd]: '0', [marginStart]: '0', [marginEnd]: '0', offset }];\n\n const atom: AtomMotion = {\n keyframes,\n duration,\n easing,\n delay,\n };\n if (direction === 'exit') {\n atom.fill = 'forwards';\n }\n return atom;\n};\n"],"names":["sizeEnterAtom","sizeExitAtom","whitespaceAtom","sizeValuesForOrientation","orientation","element","sizeName","overflowName","measuredSize","scrollWidth","scrollHeight","toSize","duration","easing","fromSize","keyframes","offset","delay","fill","whitespaceValuesForOrientation","paddingStart","paddingEnd","marginStart","marginEnd","direction","atom"],"
|
1
|
+
{"version":3,"sources":["../src/components/Collapse/collapse-atoms.ts"],"sourcesContent":["import { AtomMotion, PresenceDirection } from '@fluentui/react-motion';\nimport { CollapseOrientation } from './collapse-types';\n\n// ----- SIZE -----\n\nconst sizeValuesForOrientation = (orientation: CollapseOrientation, element: Element) => {\n const sizeName = orientation === 'horizontal' ? 'maxWidth' : 'maxHeight';\n const overflowName = orientation === 'horizontal' ? 'overflowX' : 'overflowY';\n const measuredSize = orientation === 'horizontal' ? element.scrollWidth : element.scrollHeight;\n const toSize = `${measuredSize}px`;\n return { sizeName, overflowName, toSize };\n};\n\ninterface SizeEnterAtomParams {\n orientation: CollapseOrientation;\n duration: number;\n easing: string;\n element: HTMLElement;\n fromSize?: string;\n}\n\nexport const sizeEnterAtom = ({\n orientation,\n duration,\n easing,\n element,\n fromSize = '0',\n}: SizeEnterAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: fromSize, [overflowName]: 'hidden' },\n { [sizeName]: toSize, offset: 0.9999, [overflowName]: 'hidden' },\n { [sizeName]: 'unset', [overflowName]: 'unset' },\n ],\n duration,\n easing,\n };\n};\n\ninterface SizeExitAtomParams extends SizeEnterAtomParams {\n delay?: number;\n}\n\nexport const sizeExitAtom = ({\n orientation,\n duration,\n easing,\n element,\n delay = 0,\n fromSize = '0',\n}: SizeExitAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: toSize, [overflowName]: 'hidden' },\n { [sizeName]: fromSize, [overflowName]: 'hidden' },\n ],\n duration,\n easing,\n fill: 'both',\n delay,\n };\n};\n\n// ----- WHITESPACE -----\n\n// Whitespace animation includes padding and margin.\nconst whitespaceValuesForOrientation = (orientation: CollapseOrientation) => {\n // horizontal whitespace collapse\n if (orientation === 'horizontal') {\n return {\n paddingStart: 'paddingInlineStart',\n paddingEnd: 'paddingInlineEnd',\n marginStart: 'marginInlineStart',\n marginEnd: 'marginInlineEnd',\n };\n }\n // vertical whitespace collapse\n return {\n paddingStart: 'paddingBlockStart',\n paddingEnd: 'paddingBlockEnd',\n marginStart: 'marginBlockStart',\n marginEnd: 'marginBlockEnd',\n };\n};\n\ninterface WhitespaceAtomParams {\n direction: PresenceDirection;\n orientation: CollapseOrientation;\n duration: number;\n easing: string;\n delay?: number;\n}\n\n/**\n * A collapse animates an element's height to zero,\n but the zero height does not eliminate padding or margin in the box model.\n So here we generate keyframes to animate those whitespace properties to zero.\n */\nexport const whitespaceAtom = ({\n direction,\n orientation,\n duration,\n easing,\n delay = 0,\n}: WhitespaceAtomParams): AtomMotion => {\n const { paddingStart, paddingEnd, marginStart, marginEnd } = whitespaceValuesForOrientation(orientation);\n // The keyframe with zero whitespace is at the start for enter and at the end for exit.\n const offset = direction === 'enter' ? 0 : 1;\n const keyframes = [{ [paddingStart]: '0', [paddingEnd]: '0', [marginStart]: '0', [marginEnd]: '0', offset }];\n\n const atom: AtomMotion = {\n keyframes,\n duration,\n easing,\n delay,\n };\n if (direction === 'exit') {\n atom.fill = 'forwards';\n }\n return atom;\n};\n"],"names":["sizeEnterAtom","sizeExitAtom","whitespaceAtom","sizeValuesForOrientation","orientation","element","sizeName","overflowName","measuredSize","scrollWidth","scrollHeight","toSize","duration","easing","fromSize","keyframes","offset","delay","fill","whitespaceValuesForOrientation","paddingStart","paddingEnd","marginStart","marginEnd","direction","atom"],"mappings":";;;;;;;;;;;IAqBaA,aAAa;eAAbA;;IAwBAC,YAAY;eAAZA;;IAyDAC,cAAc;eAAdA;;;AAnGb,mBAAmB;AAEnB,MAAMC,2BAA2B,CAACC,aAAkCC;IAClE,MAAMC,WAAWF,gBAAgB,eAAe,aAAa;IAC7D,MAAMG,eAAeH,gBAAgB,eAAe,cAAc;IAClE,MAAMI,eAAeJ,gBAAgB,eAAeC,QAAQI,WAAW,GAAGJ,QAAQK,YAAY;IAC9F,MAAMC,SAAS,GAAGH,aAAa,EAAE,CAAC;IAClC,OAAO;QAAEF;QAAUC;QAAcI;IAAO;AAC1C;AAUO,MAAMX,gBAAgB,CAAC,EAC5BI,WAAW,EACXQ,QAAQ,EACRC,MAAM,EACNR,OAAO,EACPS,WAAW,GAAG,EACM;IACpB,MAAM,EAAER,QAAQ,EAAEC,YAAY,EAAEI,MAAM,EAAE,GAAGR,yBAAyBC,aAAaC;IAEjF,OAAO;QACLU,WAAW;YACT;gBAAE,CAACT,SAAS,EAAEQ;gBAAU,CAACP,aAAa,EAAE;YAAS;YACjD;gBAAE,CAACD,SAAS,EAAEK;gBAAQK,QAAQ;gBAAQ,CAACT,aAAa,EAAE;YAAS;YAC/D;gBAAE,CAACD,SAAS,EAAE;gBAAS,CAACC,aAAa,EAAE;YAAQ;SAChD;QACDK;QACAC;IACF;AACF;AAMO,MAAMZ,eAAe,CAAC,EAC3BG,WAAW,EACXQ,QAAQ,EACRC,MAAM,EACNR,OAAO,EACPY,QAAQ,CAAC,EACTH,WAAW,GAAG,EACK;IACnB,MAAM,EAAER,QAAQ,EAAEC,YAAY,EAAEI,MAAM,EAAE,GAAGR,yBAAyBC,aAAaC;IAEjF,OAAO;QACLU,WAAW;YACT;gBAAE,CAACT,SAAS,EAAEK;gBAAQ,CAACJ,aAAa,EAAE;YAAS;YAC/C;gBAAE,CAACD,SAAS,EAAEQ;gBAAU,CAACP,aAAa,EAAE;YAAS;SAClD;QACDK;QACAC;QACAK,MAAM;QACND;IACF;AACF;AAEA,yBAAyB;AAEzB,oDAAoD;AACpD,MAAME,iCAAiC,CAACf;IACtC,iCAAiC;IACjC,IAAIA,gBAAgB,cAAc;QAChC,OAAO;YACLgB,cAAc;YACdC,YAAY;YACZC,aAAa;YACbC,WAAW;QACb;IACF;IACA,+BAA+B;IAC/B,OAAO;QACLH,cAAc;QACdC,YAAY;QACZC,aAAa;QACbC,WAAW;IACb;AACF;AAeO,MAAMrB,iBAAiB,CAAC,EAC7BsB,SAAS,EACTpB,WAAW,EACXQ,QAAQ,EACRC,MAAM,EACNI,QAAQ,CAAC,EACY;IACrB,MAAM,EAAEG,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGJ,+BAA+Bf;IAC5F,uFAAuF;IACvF,MAAMY,SAASQ,cAAc,UAAU,IAAI;IAC3C,MAAMT,YAAY;QAAC;YAAE,CAACK,aAAa,EAAE;YAAK,CAACC,WAAW,EAAE;YAAK,CAACC,YAAY,EAAE;YAAK,CAACC,UAAU,EAAE;YAAKP;QAAO;KAAE;IAE5G,MAAMS,OAAmB;QACvBV;QACAH;QACAC;QACAI;IACF;IACA,IAAIO,cAAc,QAAQ;QACxBC,KAAKP,IAAI,GAAG;IACd;IACA,OAAOO;AACT"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
@@ -20,12 +20,6 @@ _export(exports, {
|
|
20
20
|
},
|
21
21
|
CollapseSnappy: function() {
|
22
22
|
return _Collapse.CollapseSnappy;
|
23
|
-
},
|
24
|
-
createCollapseDelayedPresence: function() {
|
25
|
-
return _Collapse.createCollapseDelayedPresence;
|
26
|
-
},
|
27
|
-
createCollapsePresence: function() {
|
28
|
-
return _Collapse.createCollapsePresence;
|
29
23
|
}
|
30
24
|
});
|
31
25
|
const _Collapse = require("./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"],"mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAAEC,eAAe;eAAfA,yBAAe;;IAAEC,eAAe;eAAfA,yBAAe;;IAAEC,cAAc;eAAdA,wBAAc;;;0BAAQ"}
|
@@ -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';\n\
|
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/**\n * Define a presence motion for fade in/out\n *\n * @param duration - Time (ms) for the enter transition (fade-in). Defaults to the `durationNormal` value (200 ms).\n * @param easing - Easing curve for the enter transition (fade-in). Defaults to the `curveEasyEase` value.\n * @param exitDuration - Time (ms) for the exit transition (fade-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (fade-out). Defaults to the `easing` param for symmetry.\n */\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":["Fade","FadeRelaxed","FadeSnappy","fadePresenceFn","duration","motionTokens","durationNormal","easing","curveEasyEase","exitDuration","exitEasing","enter","fadeAtom","direction","exit","createPresenceComponent","createPresenceComponentVariant","durationFast","durationGentle"],"mappings":";;;;;;;;;;;IA8BaA,IAAI;eAAJA;;IAIAC,WAAW;eAAXA;;IAFAC,UAAU;eAAVA;;IAfAC,cAAc;eAAdA;;;6BAZN;0BACkB;AAWlB,MAAMA,iBAA+C,CAAC,EAC3DC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,aAAa,EACnCC,eAAeL,QAAQ,EACvBM,aAAaH,MAAM,EACpB;IACC,OAAO;QACLI,OAAOC,IAAAA,kBAAQ,EAAC;YAAEC,WAAW;YAAST;YAAUG;QAAO;QACvDO,MAAMF,IAAAA,kBAAQ,EAAC;YAAEC,WAAW;YAAQT,UAAUK;YAAcF,QAAQG;QAAW;IACjF;AACF;AAGO,MAAMV,OAAOe,IAAAA,oCAAuB,EAACZ;AAErC,MAAMD,aAAac,IAAAA,2CAA8B,EAAChB,MAAM;IAAEI,UAAUC,yBAAY,CAACY,YAAY;AAAC;AAE9F,MAAMhB,cAAce,IAAAA,2CAA8B,EAAChB,MAAM;IAAEI,UAAUC,yBAAY,CAACa,cAAc;AAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Fade/index.ts"],"sourcesContent":["export { Fade, FadeRelaxed, FadeSnappy } from './Fade';\n"],"names":["Fade","FadeRelaxed","FadeSnappy"],"
|
1
|
+
{"version":3,"sources":["../src/components/Fade/index.ts"],"sourcesContent":["export { Fade, FadeRelaxed, FadeSnappy } from './Fade';\n"],"names":["Fade","FadeRelaxed","FadeSnappy"],"mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAAEC,WAAW;eAAXA,iBAAW;;IAAEC,UAAU;eAAVA,gBAAU;;;sBAAQ"}
|
@@ -22,13 +22,22 @@ _export(exports, {
|
|
22
22
|
const _reactmotion = require("@fluentui/react-motion");
|
23
23
|
const _fadeatom = require("../../atoms/fade-atom");
|
24
24
|
const _scaleatom = require("../../atoms/scale-atom");
|
25
|
-
/**
|
25
|
+
/**
|
26
|
+
* Define a presence motion for scale in/out
|
27
|
+
*
|
28
|
+
* @param duration - Time (ms) for the enter transition (scale-in). Defaults to the `durationGentle` value (250 ms).
|
29
|
+
* @param easing - Easing curve for the enter transition (scale-in). Defaults to the `curveDecelerateMax` value.
|
30
|
+
* @param exitDuration - Time (ms) for the exit transition (scale-out). Defaults to the `durationNormal` value (200 ms).
|
31
|
+
* @param exitEasing - Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value.
|
32
|
+
* @param fromScale - The scale value to animate from. Defaults to `0.9`.
|
33
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
34
|
+
*/ const scalePresenceFn = ({ duration = _reactmotion.motionTokens.durationGentle, easing = _reactmotion.motionTokens.curveDecelerateMax, exitDuration = _reactmotion.motionTokens.durationNormal, exitEasing = _reactmotion.motionTokens.curveAccelerateMax, fromScale = 0.9, animateOpacity = true })=>{
|
26
35
|
const enterAtoms = [
|
27
36
|
(0, _scaleatom.scaleAtom)({
|
28
37
|
direction: 'enter',
|
29
38
|
duration,
|
30
39
|
easing,
|
31
|
-
|
40
|
+
fromScale: fromScale
|
32
41
|
})
|
33
42
|
];
|
34
43
|
const exitAtoms = [
|
@@ -36,7 +45,7 @@ const _scaleatom = require("../../atoms/scale-atom");
|
|
36
45
|
direction: 'exit',
|
37
46
|
duration: exitDuration,
|
38
47
|
easing: exitEasing,
|
39
|
-
|
48
|
+
fromScale
|
40
49
|
})
|
41
50
|
];
|
42
51
|
// Only add fade atoms if animateOpacity is true.
|
@@ -59,8 +68,10 @@ const _scaleatom = require("../../atoms/scale-atom");
|
|
59
68
|
};
|
60
69
|
const Scale = (0, _reactmotion.createPresenceComponent)(scalePresenceFn);
|
61
70
|
const ScaleSnappy = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
|
62
|
-
duration: _reactmotion.motionTokens.durationNormal
|
71
|
+
duration: _reactmotion.motionTokens.durationNormal,
|
72
|
+
exitDuration: _reactmotion.motionTokens.durationFast
|
63
73
|
});
|
64
74
|
const ScaleRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
|
65
|
-
duration: _reactmotion.motionTokens.durationSlow
|
75
|
+
duration: _reactmotion.motionTokens.durationSlow,
|
76
|
+
exitDuration: _reactmotion.motionTokens.durationGentle
|
66
77
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Scale/Scale.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { scaleAtom } from '../../atoms/scale-atom';\n\
|
1
|
+
{"version":3,"sources":["../src/components/Scale/Scale.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { scaleAtom } from '../../atoms/scale-atom';\nimport { ScaleParams } from './scale-types';\n\n/**\n * Define a presence motion for scale in/out\n *\n * @param duration - Time (ms) for the enter transition (scale-in). Defaults to the `durationGentle` value (250 ms).\n * @param easing - Easing curve for the enter transition (scale-in). Defaults to the `curveDecelerateMax` value.\n * @param exitDuration - Time (ms) for the exit transition (scale-out). Defaults to the `durationNormal` value (200 ms).\n * @param exitEasing - Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value.\n * @param fromScale - The scale value to animate from. Defaults to `0.9`.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst scalePresenceFn: PresenceMotionFn<ScaleParams> = ({\n duration = motionTokens.durationGentle,\n easing = motionTokens.curveDecelerateMax,\n exitDuration = motionTokens.durationNormal,\n exitEasing = motionTokens.curveAccelerateMax,\n fromScale = 0.9,\n animateOpacity = true,\n}) => {\n const enterAtoms = [scaleAtom({ direction: 'enter', duration, easing, fromScale: fromScale })];\n const exitAtoms = [\n scaleAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n fromScale,\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 scale in/out transitions to its children. */\nexport const Scale = createPresenceComponent(scalePresenceFn);\n\nexport const ScaleSnappy = createPresenceComponentVariant(Scale, {\n duration: motionTokens.durationNormal,\n exitDuration: motionTokens.durationFast,\n});\n\nexport const ScaleRelaxed = createPresenceComponentVariant(Scale, {\n duration: motionTokens.durationSlow,\n exitDuration: motionTokens.durationGentle,\n});\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy","scalePresenceFn","duration","motionTokens","durationGentle","easing","curveDecelerateMax","exitDuration","durationNormal","exitEasing","curveAccelerateMax","fromScale","animateOpacity","enterAtoms","scaleAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","durationFast","durationSlow"],"mappings":";;;;;;;;;;;IAmDaA,KAAK;eAALA;;IAOAC,YAAY;eAAZA;;IALAC,WAAW;eAAXA;;;6BAhDN;0BACkB;2BACC;AAG1B;;;;;;;;;CASC,GACD,MAAMC,kBAAiD,CAAC,EACtDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,eAAeJ,yBAAY,CAACK,cAAc,EAC1CC,aAAaN,yBAAY,CAACO,kBAAkB,EAC5CC,YAAY,GAAG,EACfC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACC,IAAAA,oBAAS,EAAC;YAAEC,WAAW;YAASb;YAAUG;YAAQM,WAAWA;QAAU;KAAG;IAC9F,MAAMK,YAAY;QAChBF,IAAAA,oBAAS,EAAC;YACRC,WAAW;YACXb,UAAUK;YACVF,QAAQI;YACRE;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASb;YAAUG;QAAO;QAChEW,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQb,UAAUK;YAAcF,QAAQI;QAAW;IAC1F;IAEA,OAAO;QACLU,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMlB,QAAQuB,IAAAA,oCAAuB,EAACpB;AAEtC,MAAMD,cAAcsB,IAAAA,2CAA8B,EAACxB,OAAO;IAC/DI,UAAUC,yBAAY,CAACK,cAAc;IACrCD,cAAcJ,yBAAY,CAACoB,YAAY;AACzC;AAEO,MAAMxB,eAAeuB,IAAAA,2CAA8B,EAACxB,OAAO;IAChEI,UAAUC,yBAAY,CAACqB,YAAY;IACnCjB,cAAcJ,yBAAY,CAACC,cAAc;AAC3C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/components/Scale/index.ts"],"sourcesContent":["export { Scale, ScaleRelaxed, ScaleSnappy } from './Scale';\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy"],"
|
1
|
+
{"version":3,"sources":["../src/components/Scale/index.ts"],"sourcesContent":["export { Scale, ScaleRelaxed, ScaleSnappy } from './Scale';\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy"],"mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;;uBAAQ"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
@@ -0,0 +1,79 @@
|
|
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
|
+
Slide: function() {
|
13
|
+
return Slide;
|
14
|
+
},
|
15
|
+
SlideRelaxed: function() {
|
16
|
+
return SlideRelaxed;
|
17
|
+
},
|
18
|
+
SlideSnappy: function() {
|
19
|
+
return SlideSnappy;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const _reactmotion = require("@fluentui/react-motion");
|
23
|
+
const _fadeatom = require("../../atoms/fade-atom");
|
24
|
+
const _slideatom = require("../../atoms/slide-atom");
|
25
|
+
/**
|
26
|
+
* Define a presence motion for slide in/out
|
27
|
+
*
|
28
|
+
* @param duration - Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (200 ms).
|
29
|
+
* @param easing - Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value.
|
30
|
+
* @param exitDuration - Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry.
|
31
|
+
* @param exitEasing - Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value.
|
32
|
+
* @param fromX - The X translate value with units to animate from. Defaults to `'0px'`.
|
33
|
+
* @param fromY - The Y translate value with units to animate from. Defaults to `'20px'`.
|
34
|
+
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
|
35
|
+
*/ const slidePresenceFn = ({ duration = _reactmotion.motionTokens.durationNormal, easing = _reactmotion.motionTokens.curveDecelerateMid, exitDuration = duration, exitEasing = _reactmotion.motionTokens.curveAccelerateMid, fromX = '0px', fromY = '20px', animateOpacity = true })=>{
|
36
|
+
const enterAtoms = [
|
37
|
+
(0, _slideatom.slideAtom)({
|
38
|
+
direction: 'enter',
|
39
|
+
duration,
|
40
|
+
easing,
|
41
|
+
fromX,
|
42
|
+
fromY
|
43
|
+
})
|
44
|
+
];
|
45
|
+
const exitAtoms = [
|
46
|
+
(0, _slideatom.slideAtom)({
|
47
|
+
direction: 'exit',
|
48
|
+
duration: exitDuration,
|
49
|
+
easing: exitEasing,
|
50
|
+
fromX,
|
51
|
+
fromY
|
52
|
+
})
|
53
|
+
];
|
54
|
+
// Only add fade atoms if animateOpacity is true.
|
55
|
+
if (animateOpacity) {
|
56
|
+
enterAtoms.push((0, _fadeatom.fadeAtom)({
|
57
|
+
direction: 'enter',
|
58
|
+
duration,
|
59
|
+
easing
|
60
|
+
}));
|
61
|
+
exitAtoms.push((0, _fadeatom.fadeAtom)({
|
62
|
+
direction: 'exit',
|
63
|
+
duration: exitDuration,
|
64
|
+
easing: exitEasing
|
65
|
+
}));
|
66
|
+
}
|
67
|
+
return {
|
68
|
+
enter: enterAtoms,
|
69
|
+
exit: exitAtoms
|
70
|
+
};
|
71
|
+
};
|
72
|
+
const Slide = (0, _reactmotion.createPresenceComponent)(slidePresenceFn);
|
73
|
+
const SlideSnappy = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
|
74
|
+
easing: _reactmotion.motionTokens.curveDecelerateMax,
|
75
|
+
exitEasing: _reactmotion.motionTokens.curveAccelerateMax
|
76
|
+
});
|
77
|
+
const SlideRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
|
78
|
+
duration: _reactmotion.motionTokens.durationGentle
|
79
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/Slide.ts"],"sourcesContent":["import {\n motionTokens,\n createPresenceComponent,\n PresenceMotionFn,\n createPresenceComponentVariant,\n} from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { slideAtom } from '../../atoms/slide-atom';\nimport { SlideParams } from './slide-types';\n\n/**\n * Define a presence motion for slide in/out\n *\n * @param duration - Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (200 ms).\n * @param easing - Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value.\n * @param exitDuration - Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value.\n * @param fromX - The X translate value with units to animate from. Defaults to `'0px'`.\n * @param fromY - The Y translate value with units to animate from. Defaults to `'20px'`.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst slidePresenceFn: PresenceMotionFn<SlideParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveDecelerateMid,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMid,\n fromX = '0px',\n fromY = '20px',\n animateOpacity = true,\n}: SlideParams) => {\n const enterAtoms = [slideAtom({ direction: 'enter', duration, easing, fromX, fromY })];\n const exitAtoms = [\n slideAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n fromX,\n fromY,\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 slide in/out transitions to its children. */\nexport const Slide = createPresenceComponent(slidePresenceFn);\n\nexport const SlideSnappy = createPresenceComponentVariant(Slide, {\n easing: motionTokens.curveDecelerateMax,\n exitEasing: motionTokens.curveAccelerateMax,\n});\n\nexport const SlideRelaxed = createPresenceComponentVariant(Slide, {\n duration: motionTokens.durationGentle,\n});\n"],"names":["Slide","SlideRelaxed","SlideSnappy","slidePresenceFn","duration","motionTokens","durationNormal","easing","curveDecelerateMid","exitDuration","exitEasing","curveAccelerateMid","fromX","fromY","animateOpacity","enterAtoms","slideAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","curveDecelerateMax","curveAccelerateMax","durationGentle"],"mappings":";;;;;;;;;;;IAsDaA,KAAK;eAALA;;IAOAC,YAAY;eAAZA;;IALAC,WAAW;eAAXA;;;6BAnDN;0BACkB;2BACC;AAG1B;;;;;;;;;;CAUC,GACD,MAAMC,kBAAiD,CAAC,EACtDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,eAAeL,QAAQ,EACvBM,aAAaL,yBAAY,CAACM,kBAAkB,EAC5CC,QAAQ,KAAK,EACbC,QAAQ,MAAM,EACdC,iBAAiB,IAAI,EACT;IACZ,MAAMC,aAAa;QAACC,IAAAA,oBAAS,EAAC;YAAEC,WAAW;YAASb;YAAUG;YAAQK;YAAOC;QAAM;KAAG;IACtF,MAAMK,YAAY;QAChBF,IAAAA,oBAAS,EAAC;YACRC,WAAW;YACXb,UAAUK;YACVF,QAAQG;YACRE;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASb;YAAUG;QAAO;QAChEW,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQb,UAAUK;YAAcF,QAAQG;QAAW;IAC1F;IAEA,OAAO;QACLW,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMlB,QAAQuB,IAAAA,oCAAuB,EAACpB;AAEtC,MAAMD,cAAcsB,IAAAA,2CAA8B,EAACxB,OAAO;IAC/DO,QAAQF,yBAAY,CAACoB,kBAAkB;IACvCf,YAAYL,yBAAY,CAACqB,kBAAkB;AAC7C;AAEO,MAAMzB,eAAeuB,IAAAA,2CAA8B,EAACxB,OAAO;IAChEI,UAAUC,yBAAY,CAACsB,cAAc;AACvC"}
|
@@ -0,0 +1,22 @@
|
|
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
|
+
Slide: function() {
|
13
|
+
return _Slide.Slide;
|
14
|
+
},
|
15
|
+
SlideRelaxed: function() {
|
16
|
+
return _Slide.SlideRelaxed;
|
17
|
+
},
|
18
|
+
SlideSnappy: function() {
|
19
|
+
return _Slide.SlideSnappy;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const _Slide = require("./Slide");
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/Slide/index.ts"],"sourcesContent":["export { Slide, SlideRelaxed, SlideSnappy } from './Slide';\n"],"names":["Slide","SlideRelaxed","SlideSnappy"],"mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;;uBAAQ"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -9,6 +9,9 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
+
Blur: function() {
|
13
|
+
return _Blur.Blur;
|
14
|
+
},
|
12
15
|
Collapse: function() {
|
13
16
|
return _Collapse.Collapse;
|
14
17
|
},
|
@@ -39,13 +42,18 @@ _export(exports, {
|
|
39
42
|
ScaleSnappy: function() {
|
40
43
|
return _Scale.ScaleSnappy;
|
41
44
|
},
|
42
|
-
|
43
|
-
return
|
45
|
+
Slide: function() {
|
46
|
+
return _Slide.Slide;
|
47
|
+
},
|
48
|
+
SlideRelaxed: function() {
|
49
|
+
return _Slide.SlideRelaxed;
|
44
50
|
},
|
45
|
-
|
46
|
-
return
|
51
|
+
SlideSnappy: function() {
|
52
|
+
return _Slide.SlideSnappy;
|
47
53
|
}
|
48
54
|
});
|
49
55
|
const _Collapse = require("./components/Collapse");
|
50
56
|
const _Fade = require("./components/Fade");
|
51
57
|
const _Scale = require("./components/Scale");
|
58
|
+
const _Slide = require("./components/Slide");
|
59
|
+
const _Blur = require("./components/Blur");
|