Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Blur", {
enumerable: true,
get: function() {
return Blur;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _fadeatom = require("../../atoms/fade-atom");
const _bluratom = require("../../atoms/blur-atom");
/**
* Define a presence motion for blur in/out
*
* @param duration - Time (ms) for the enter transition (blur-in). Defaults to the `durationSlow` value (300 ms).
* @param easing - Easing curve for the enter transition (blur-in). Defaults to the `curveDecelerateMin` value.
* @param delay - Time (ms) to delay the enter transition. Defaults to 0.
* @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the `duration` param for symmetry.
* @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
* @param outRadius - Blur radius for the out state (exited). Defaults to `'10px'`.
* @param inRadius - Blur radius for the in state (entered). Defaults to `'0px'`.
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
*/ const blurPresenceFn = ({ duration = _reactmotion.motionTokens.durationSlow, easing = _reactmotion.motionTokens.curveDecelerateMin, delay = 0, exitDuration = duration, exitEasing = _reactmotion.motionTokens.curveAccelerateMin, exitDelay = delay, outRadius = '10px', inRadius = '0px', animateOpacity = true })=>{
const enterAtoms = [
(0, _bluratom.blurAtom)({
direction: 'enter',
duration,
easing,
delay,
outRadius,
inRadius
})
];
const exitAtoms = [
(0, _bluratom.blurAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay,
outRadius,
inRadius
})
];
// Only add fade atoms if animateOpacity is true.
if (animateOpacity) {
enterAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'enter',
duration,
easing,
delay
}));
exitAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay
}));
}
return {
enter: enterAtoms,
exit: exitAtoms
};
};
const Blur = (0, _reactmotion.createPresenceComponent)(blurPresenceFn);

View File

@@ -0,0 +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 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 delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (blur-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (blur-out). Defaults to the `curveAccelerateMin` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param outRadius - Blur radius for the out state (exited). Defaults to `'10px'`.\n * @param inRadius - Blur radius for the in state (entered). Defaults to `'0px'`.\n * @param animateOpacity - Whether to animate the opacity. Defaults to `true`.\n */\nconst blurPresenceFn: PresenceMotionFn<BlurParams> = ({\n duration = motionTokens.durationSlow,\n easing = motionTokens.curveDecelerateMin,\n delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMin,\n exitDelay = delay,\n outRadius = '10px',\n inRadius = '0px',\n animateOpacity = true,\n}) => {\n const enterAtoms = [blurAtom({ direction: 'enter', duration, easing, delay, outRadius, inRadius })];\n const exitAtoms = [\n blurAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n outRadius,\n inRadius,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\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":["Blur","blurPresenceFn","duration","motionTokens","durationSlow","easing","curveDecelerateMin","delay","exitDuration","exitEasing","curveAccelerateMin","exitDelay","outRadius","inRadius","animateOpacity","enterAtoms","blurAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent"],"mappings":";;;;+BAsDaA;;;eAAAA;;;6BAtD2D;0BAC/C;0BACA;AAGzB;;;;;;;;;;;;CAYC,GACD,MAAMC,iBAA+C,CAAC,EACpDC,WAAWC,yBAAY,CAACC,YAAY,EACpCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeN,QAAQ,EACvBO,aAAaN,yBAAY,CAACO,kBAAkB,EAC5CC,YAAYJ,KAAK,EACjBK,YAAY,MAAM,EAClBC,WAAW,KAAK,EAChBC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACC,IAAAA,kBAAQ,EAAC;YAAEC,WAAW;YAASf;YAAUG;YAAQE;YAAOK;YAAWC;QAAS;KAAG;IACnG,MAAMK,YAAY;QAChBF,IAAAA,kBAAQ,EAAC;YACPC,WAAW;YACXf,UAAUM;YACVH,QAAQI;YACRF,OAAOI;YACPC;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASf;YAAUG;YAAQE;QAAM;QACvEW,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQf,UAAUM;YAAcH,QAAQI;YAAYF,OAAOI;QAAU;IAC5G;IAEA,OAAO;QACLU,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMlB,OAAOuB,IAAAA,oCAAuB,EAACtB"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Blur", {
enumerable: true,
get: function() {
return _Blur.Blur;
}
});
const _Blur = require("./Blur");

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,133 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Collapse: function() {
return Collapse;
},
CollapseDelayed: function() {
return CollapseDelayed;
},
CollapseRelaxed: function() {
return CollapseRelaxed;
},
CollapseSnappy: function() {
return CollapseSnappy;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _collapseatoms = require("./collapse-atoms");
const _fadeatom = require("../../atoms/fade-atom");
/**
* Define a presence motion for collapse/expand
*
* @param element - The element to apply the collapse motion to
* @param duration - Time (ms) for the enter transition (expand). Defaults to the `durationNormal` value (200 ms)
* @param easing - Easing curve for the enter transition. Defaults to the `curveEasyEaseMax` value
* @param delay - Time (ms) to delay the entire enter transition. Defaults to 0
* @param exitDuration - Time (ms) for the exit transition (collapse). Defaults to the `duration` param for symmetry
* @param exitEasing - Easing curve for the exit transition. Defaults to the `easing` param for symmetry
* @param exitDelay - Time (ms) to delay the entire exit transition. Defaults to the `delay` param for symmetry
* @param staggerDelay - Time (ms) offset between the size and opacity animations. Defaults to 0
* @param exitStaggerDelay - Time (ms) offset between the size and opacity animations on exit. Defaults to the `staggerDelay` param for symmetry
* @param sizeDuration - Time (ms) for the size animation during enter. Defaults to `duration` for unified timing
* @param opacityDuration - Time (ms) for the opacity animation during enter. Defaults to `sizeDuration` for synchronized timing
* @param exitSizeDuration - Time (ms) for the size animation during exit. Defaults to `exitDuration` for unified timing
* @param exitOpacityDuration - Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`
* @param orientation - The orientation of the size animation. Defaults to `'vertical'` to expand/collapse the height
* @param outSize - Size for the out state (collapsed). Defaults to `'0px'`
*/ const collapsePresenceFn = ({ element, // Primary duration controls (simple API)
duration = _reactmotion.motionTokens.durationNormal, exitDuration = duration, // Granular duration controls with smart defaults (advanced API)
sizeDuration = duration, opacityDuration = sizeDuration, exitSizeDuration = exitDuration, exitOpacityDuration = exitSizeDuration, // Other timing controls
easing = _reactmotion.motionTokens.curveEasyEaseMax, delay = 0, exitEasing = easing, exitDelay = delay, staggerDelay = 0, exitStaggerDelay = staggerDelay, // Animation controls
animateOpacity = true, orientation = 'vertical', outSize = '0px' })=>{
// ----- ENTER -----
// The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.
// For enter: size expands first, then opacity fades in after staggerDelay
const enterAtoms = [
// Apply global delay to size atom - size expansion starts first
(0, _collapseatoms.sizeEnterAtom)({
orientation,
duration: sizeDuration,
easing,
element,
outSize,
delay
}),
(0, _collapseatoms.whitespaceAtom)({
direction: 'enter',
orientation,
duration: sizeDuration,
easing,
delay
})
];
// Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.
if (animateOpacity) {
enterAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'enter',
duration: opacityDuration,
easing,
delay: delay + staggerDelay
}));
}
// ----- EXIT -----
// The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.
// For exit: opacity fades out first, then size collapses after exitStaggerDelay
const exitAtoms = [];
// Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.
if (animateOpacity) {
exitAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitOpacityDuration,
easing: exitEasing,
delay: exitDelay
}));
}
exitAtoms.push((0, _collapseatoms.sizeExitAtom)({
orientation,
duration: exitSizeDuration,
easing: exitEasing,
element,
delay: exitDelay + exitStaggerDelay,
outSize
}), (0, _collapseatoms.whitespaceAtom)({
direction: 'exit',
orientation,
duration: exitSizeDuration,
easing: exitEasing,
delay: exitDelay + exitStaggerDelay
}));
return {
enter: enterAtoms,
exit: exitAtoms
};
};
const Collapse = (0, _reactmotion.createPresenceComponent)(collapsePresenceFn);
const CollapseSnappy = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
duration: _reactmotion.motionTokens.durationFast
});
const CollapseRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
duration: _reactmotion.motionTokens.durationSlower
});
const CollapseDelayed = (0, _reactmotion.createPresenceComponentVariant)(Collapse, {
// Enter timing per motion design spec
sizeDuration: _reactmotion.motionTokens.durationNormal,
opacityDuration: _reactmotion.motionTokens.durationSlower,
staggerDelay: _reactmotion.motionTokens.durationNormal,
// Exit timing per motion design spec
exitSizeDuration: _reactmotion.motionTokens.durationNormal,
exitOpacityDuration: _reactmotion.motionTokens.durationSlower,
exitStaggerDelay: _reactmotion.motionTokens.durationSlower,
// Easing per motion design spec
easing: _reactmotion.motionTokens.curveEasyEase,
exitEasing: _reactmotion.motionTokens.curveEasyEase
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
sizeEnterAtom: function() {
return sizeEnterAtom;
},
sizeExitAtom: function() {
return sizeExitAtom;
},
whitespaceAtom: function() {
return whitespaceAtom;
}
});
// ----- SIZE -----
const sizeValuesForOrientation = (orientation, element)=>{
const sizeName = orientation === 'horizontal' ? 'maxWidth' : 'maxHeight';
const overflowName = orientation === 'horizontal' ? 'overflowX' : 'overflowY';
const measuredSize = orientation === 'horizontal' ? element.scrollWidth : element.scrollHeight;
const toSize = `${measuredSize}px`;
return {
sizeName,
overflowName,
toSize
};
};
const sizeEnterAtom = ({ orientation, duration, easing, element, outSize = '0', delay = 0 })=>{
const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);
return {
keyframes: [
{
[sizeName]: outSize,
[overflowName]: 'hidden'
},
{
[sizeName]: toSize,
offset: 0.9999,
[overflowName]: 'hidden'
},
{
[sizeName]: 'unset',
[overflowName]: 'unset'
}
],
duration,
easing,
delay,
fill: 'both'
};
};
const sizeExitAtom = ({ orientation, duration, easing, element, delay = 0, outSize = '0' })=>{
const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);
return {
keyframes: [
{
[sizeName]: toSize,
[overflowName]: 'hidden'
},
{
[sizeName]: outSize,
[overflowName]: 'hidden'
}
],
duration,
easing,
delay,
fill: 'both'
};
};
// ----- WHITESPACE -----
// Whitespace animation includes padding and margin.
const whitespaceValuesForOrientation = (orientation)=>{
// horizontal whitespace collapse
if (orientation === 'horizontal') {
return {
paddingStart: 'paddingInlineStart',
paddingEnd: 'paddingInlineEnd',
marginStart: 'marginInlineStart',
marginEnd: 'marginInlineEnd'
};
}
// vertical whitespace collapse
return {
paddingStart: 'paddingBlockStart',
paddingEnd: 'paddingBlockEnd',
marginStart: 'marginBlockStart',
marginEnd: 'marginBlockEnd'
};
};
const whitespaceAtom = ({ direction, orientation, duration, easing, delay = 0 })=>{
const { paddingStart, paddingEnd, marginStart, marginEnd } = whitespaceValuesForOrientation(orientation);
// The keyframe with zero whitespace is at the start for enter and at the end for exit.
const offset = direction === 'enter' ? 0 : 1;
const keyframes = [
{
[paddingStart]: '0',
[paddingEnd]: '0',
[marginStart]: '0',
[marginEnd]: '0',
offset
}
];
return {
keyframes,
duration,
easing,
delay,
fill: 'both'
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,155 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getCollapseDurationInfo: function() {
return getCollapseDurationInfo;
},
getCollapseMotionValidation: function() {
return getCollapseMotionValidation;
},
getCollapseOrientationInfo: function() {
return getCollapseOrientationInfo;
},
getCollapseTimingInfo: function() {
return getCollapseTimingInfo;
},
getOpacityComparisonInfo: function() {
return getOpacityComparisonInfo;
},
getSizeAtomInfo: function() {
return getSizeAtomInfo;
},
getWhitespaceAtomInfo: function() {
return getWhitespaceAtomInfo;
}
});
function getCollapseMotionValidation(motion) {
return {
enterCount: motion.enter.length,
exitCount: motion.exit.length,
hasEnterOpacity: motion.enter.length === 3 && 'opacity' in (motion.enter[2].keyframes[0] || {}),
hasExitOpacity: motion.exit.length === 3 && 'opacity' in (motion.exit[0].keyframes[0] || {}),
enterStructure: motion.enter.map((atom)=>({
hasKeyframes: Array.isArray(atom.keyframes),
hasDuration: typeof atom.duration === 'number',
hasEasing: typeof atom.easing === 'string',
hasDelay: typeof atom.delay === 'number'
})),
exitStructure: motion.exit.map((atom)=>({
hasKeyframes: Array.isArray(atom.keyframes),
hasDuration: typeof atom.duration === 'number',
hasEasing: typeof atom.easing === 'string',
hasDelay: typeof atom.delay === 'number'
}))
};
}
function getCollapseTimingInfo(motion, animateOpacity = true) {
var _motion_enter_, _motion_enter_1, _motion_enter_2, _motion_exit_, _motion_exit_1, _motion_exit_2, _motion_exit_3, _motion_exit_4;
var _motion_enter__delay, _motion_enter__delay1, _motion_enter__delay2;
const enterDelays = {
size: (_motion_enter__delay = (_motion_enter_ = motion.enter[0]) === null || _motion_enter_ === void 0 ? void 0 : _motion_enter_.delay) !== null && _motion_enter__delay !== void 0 ? _motion_enter__delay : 0,
whitespace: (_motion_enter__delay1 = (_motion_enter_1 = motion.enter[1]) === null || _motion_enter_1 === void 0 ? void 0 : _motion_enter_1.delay) !== null && _motion_enter__delay1 !== void 0 ? _motion_enter__delay1 : 0,
opacity: animateOpacity ? (_motion_enter__delay2 = (_motion_enter_2 = motion.enter[2]) === null || _motion_enter_2 === void 0 ? void 0 : _motion_enter_2.delay) !== null && _motion_enter__delay2 !== void 0 ? _motion_enter__delay2 : 0 : undefined
};
var _motion_exit__delay, _motion_exit__delay1, _motion_exit__delay2, _motion_exit__delay3, _motion_exit__delay4;
const exitDelays = animateOpacity ? {
opacity: (_motion_exit__delay = (_motion_exit_ = motion.exit[0]) === null || _motion_exit_ === void 0 ? void 0 : _motion_exit_.delay) !== null && _motion_exit__delay !== void 0 ? _motion_exit__delay : 0,
size: (_motion_exit__delay1 = (_motion_exit_1 = motion.exit[1]) === null || _motion_exit_1 === void 0 ? void 0 : _motion_exit_1.delay) !== null && _motion_exit__delay1 !== void 0 ? _motion_exit__delay1 : 0,
whitespace: (_motion_exit__delay2 = (_motion_exit_2 = motion.exit[2]) === null || _motion_exit_2 === void 0 ? void 0 : _motion_exit_2.delay) !== null && _motion_exit__delay2 !== void 0 ? _motion_exit__delay2 : 0
} : {
size: (_motion_exit__delay3 = (_motion_exit_3 = motion.exit[0]) === null || _motion_exit_3 === void 0 ? void 0 : _motion_exit_3.delay) !== null && _motion_exit__delay3 !== void 0 ? _motion_exit__delay3 : 0,
whitespace: (_motion_exit__delay4 = (_motion_exit_4 = motion.exit[1]) === null || _motion_exit_4 === void 0 ? void 0 : _motion_exit_4.delay) !== null && _motion_exit__delay4 !== void 0 ? _motion_exit__delay4 : 0
};
return {
enter: enterDelays,
exit: exitDelays
};
}
function getCollapseDurationInfo(motion, animateOpacity = true) {
var _motion_enter_, _motion_enter_1, _motion_enter_2, _motion_exit_, _motion_exit_1, _motion_exit_2, _motion_exit_3, _motion_exit_4;
var _motion_enter__duration, _motion_enter__duration1, _motion_enter__duration2;
const enterDurations = {
size: (_motion_enter__duration = (_motion_enter_ = motion.enter[0]) === null || _motion_enter_ === void 0 ? void 0 : _motion_enter_.duration) !== null && _motion_enter__duration !== void 0 ? _motion_enter__duration : 0,
whitespace: (_motion_enter__duration1 = (_motion_enter_1 = motion.enter[1]) === null || _motion_enter_1 === void 0 ? void 0 : _motion_enter_1.duration) !== null && _motion_enter__duration1 !== void 0 ? _motion_enter__duration1 : 0,
opacity: animateOpacity ? (_motion_enter__duration2 = (_motion_enter_2 = motion.enter[2]) === null || _motion_enter_2 === void 0 ? void 0 : _motion_enter_2.duration) !== null && _motion_enter__duration2 !== void 0 ? _motion_enter__duration2 : 0 : undefined
};
var _motion_exit__duration, _motion_exit__duration1, _motion_exit__duration2, _motion_exit__duration3, _motion_exit__duration4;
const exitDurations = animateOpacity ? {
opacity: (_motion_exit__duration = (_motion_exit_ = motion.exit[0]) === null || _motion_exit_ === void 0 ? void 0 : _motion_exit_.duration) !== null && _motion_exit__duration !== void 0 ? _motion_exit__duration : 0,
size: (_motion_exit__duration1 = (_motion_exit_1 = motion.exit[1]) === null || _motion_exit_1 === void 0 ? void 0 : _motion_exit_1.duration) !== null && _motion_exit__duration1 !== void 0 ? _motion_exit__duration1 : 0,
whitespace: (_motion_exit__duration2 = (_motion_exit_2 = motion.exit[2]) === null || _motion_exit_2 === void 0 ? void 0 : _motion_exit_2.duration) !== null && _motion_exit__duration2 !== void 0 ? _motion_exit__duration2 : 0
} : {
size: (_motion_exit__duration3 = (_motion_exit_3 = motion.exit[0]) === null || _motion_exit_3 === void 0 ? void 0 : _motion_exit_3.duration) !== null && _motion_exit__duration3 !== void 0 ? _motion_exit__duration3 : 0,
whitespace: (_motion_exit__duration4 = (_motion_exit_4 = motion.exit[1]) === null || _motion_exit_4 === void 0 ? void 0 : _motion_exit_4.duration) !== null && _motion_exit__duration4 !== void 0 ? _motion_exit__duration4 : 0
};
return {
enter: enterDurations,
exit: exitDurations
};
}
function getCollapseOrientationInfo(motion, animateOpacity = true) {
const enterSizeAtom = motion.enter[0];
const enterWhitespaceAtom = motion.enter[1];
const exitOffset = animateOpacity ? 1 : 0;
const exitSizeAtom = motion.exit[exitOffset];
const exitWhitespaceAtom = motion.exit[exitOffset + 1];
return {
enter: {
sizeProperties: Object.keys((enterSizeAtom === null || enterSizeAtom === void 0 ? void 0 : enterSizeAtom.keyframes[0]) || {}),
whitespaceProperties: Object.keys((enterWhitespaceAtom === null || enterWhitespaceAtom === void 0 ? void 0 : enterWhitespaceAtom.keyframes[0]) || {})
},
exit: {
sizeProperties: Object.keys((exitSizeAtom === null || exitSizeAtom === void 0 ? void 0 : exitSizeAtom.keyframes[0]) || {}),
whitespaceProperties: Object.keys((exitWhitespaceAtom === null || exitWhitespaceAtom === void 0 ? void 0 : exitWhitespaceAtom.keyframes[0]) || {})
}
};
}
function getSizeAtomInfo(sizeAtom, direction) {
const keyframes = sizeAtom.keyframes;
const properties = Object.keys(keyframes[0] || {});
return {
keyframeCount: keyframes.length,
properties,
hasOffset: direction === 'enter' ? 'offset' in (keyframes[1] || {}) : false,
hasFill: 'fill' in sizeAtom,
fillValue: sizeAtom.fill,
firstFrameValues: keyframes[0] || {},
lastFrameValues: keyframes[keyframes.length - 1] || {}
};
}
function getWhitespaceAtomInfo(whitespaceAtom, direction) {
const keyframe = whitespaceAtom.keyframes[0] || {};
return {
properties: Object.keys(keyframe),
offset: keyframe.offset,
expectedOffset: direction === 'enter' ? 0 : 1,
hasFill: 'fill' in whitespaceAtom,
fillValue: whitespaceAtom.fill,
isVertical: 'paddingBlockStart' in keyframe,
isHorizontal: 'paddingInlineStart' in keyframe
};
}
function getOpacityComparisonInfo(withOpacity, withoutOpacity) {
return {
withOpacity: {
enterCount: withOpacity.enter.length,
exitCount: withOpacity.exit.length,
hasEnterOpacity: withOpacity.enter.length === 3,
hasExitOpacity: withOpacity.exit.length === 3
},
withoutOpacity: {
enterCount: withoutOpacity.enter.length,
exitCount: withoutOpacity.exit.length,
hasEnterOpacity: false,
hasExitOpacity: false
}
};
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Collapse: function() {
return _Collapse.Collapse;
},
CollapseDelayed: function() {
return _Collapse.CollapseDelayed;
},
CollapseRelaxed: function() {
return _Collapse.CollapseRelaxed;
},
CollapseSnappy: function() {
return _Collapse.CollapseSnappy;
}
});
const _Collapse = require("./Collapse");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Collapse/index.ts"],"sourcesContent":["export { Collapse, CollapseDelayed, CollapseRelaxed, CollapseSnappy } from './Collapse';\nexport type { CollapseParams, CollapseDurations } from './collapse-types';\n"],"names":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy"],"mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAAEC,eAAe;eAAfA,yBAAe;;IAAEC,eAAe;eAAfA,yBAAe;;IAAEC,cAAc;eAAdA,wBAAc;;;0BAAQ"}

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Fade: function() {
return Fade;
},
FadeRelaxed: function() {
return FadeRelaxed;
},
FadeSnappy: function() {
return FadeSnappy;
},
fadePresenceFn: function() {
return fadePresenceFn;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _fadeatom = require("../../atoms/fade-atom");
const fadePresenceFn = ({ duration = _reactmotion.motionTokens.durationNormal, easing = _reactmotion.motionTokens.curveEasyEase, delay = 0, exitDuration = duration, exitEasing = easing, exitDelay = delay, outOpacity = 0, inOpacity = 1 })=>{
return {
enter: (0, _fadeatom.fadeAtom)({
direction: 'enter',
duration,
easing,
delay,
outOpacity,
inOpacity
}),
exit: (0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay,
outOpacity,
inOpacity
})
};
};
const Fade = (0, _reactmotion.createPresenceComponent)(fadePresenceFn);
const FadeSnappy = (0, _reactmotion.createPresenceComponentVariant)(Fade, {
duration: _reactmotion.motionTokens.durationFast
});
const FadeRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Fade, {
duration: _reactmotion.motionTokens.durationGentle
});

View File

@@ -0,0 +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 delay - Time (ms) to delay the enter transition. Defaults to 0.\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 * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param outOpacity - Opacity for the out state (exited). Defaults to 0.\n * @param inOpacity - Opacity for the in state (entered). Defaults to 1.\n */\nexport const fadePresenceFn: PresenceMotionFn<FadeParams> = ({\n duration = motionTokens.durationNormal,\n easing = motionTokens.curveEasyEase,\n delay = 0,\n exitDuration = duration,\n exitEasing = easing,\n exitDelay = delay,\n outOpacity = 0,\n inOpacity = 1,\n}) => {\n return {\n enter: fadeAtom({ direction: 'enter', duration, easing, delay, outOpacity, inOpacity }),\n exit: fadeAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n outOpacity,\n inOpacity,\n }),\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","delay","exitDuration","exitEasing","exitDelay","outOpacity","inOpacity","enter","fadeAtom","direction","exit","createPresenceComponent","createPresenceComponentVariant","durationFast","durationGentle"],"mappings":";;;;;;;;;;;IA6CaA,IAAI;eAAJA;;IAIAC,WAAW;eAAXA;;IAFAC,UAAU;eAAVA;;IA1BAC,cAAc;eAAdA;;;6BAhBN;0BACkB;AAelB,MAAMA,iBAA+C,CAAC,EAC3DC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,aAAa,EACnCC,QAAQ,CAAC,EACTC,eAAeN,QAAQ,EACvBO,aAAaJ,MAAM,EACnBK,YAAYH,KAAK,EACjBI,aAAa,CAAC,EACdC,YAAY,CAAC,EACd;IACC,OAAO;QACLC,OAAOC,IAAAA,kBAAQ,EAAC;YAAEC,WAAW;YAASb;YAAUG;YAAQE;YAAOI;YAAYC;QAAU;QACrFI,MAAMF,IAAAA,kBAAQ,EAAC;YACbC,WAAW;YACXb,UAAUM;YACVH,QAAQI;YACRF,OAAOG;YACPC;YACAC;QACF;IACF;AACF;AAGO,MAAMd,OAAOmB,IAAAA,oCAAuB,EAAChB;AAErC,MAAMD,aAAakB,IAAAA,2CAA8B,EAACpB,MAAM;IAAEI,UAAUC,yBAAY,CAACgB,YAAY;AAAC;AAE9F,MAAMpB,cAAcmB,IAAAA,2CAA8B,EAACpB,MAAM;IAAEI,UAAUC,yBAAY,CAACiB,cAAc;AAAC"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Fade: function() {
return _Fade.Fade;
},
FadeRelaxed: function() {
return _Fade.FadeRelaxed;
},
FadeSnappy: function() {
return _Fade.FadeSnappy;
}
});
const _Fade = require("./Fade");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Fade/index.ts"],"sourcesContent":["export { Fade, FadeRelaxed, FadeSnappy } from './Fade';\nexport type { FadeParams } from './fade-types';\n"],"names":["Fade","FadeRelaxed","FadeSnappy"],"mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAAEC,WAAW;eAAXA,iBAAW;;IAAEC,UAAU;eAAVA,gBAAU;;;sBAAQ"}

View File

@@ -0,0 +1,69 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Rotate", {
enumerable: true,
get: function() {
return Rotate;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _fadeatom = require("../../atoms/fade-atom");
const _rotateatom = require("../../atoms/rotate-atom");
/**
* Define a presence motion for rotate in/out
*
* @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.
* @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.
* @param delay - Time (ms) to delay the enter transition. Defaults to 0.
* @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.
* @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
* @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'z'.
* @param outAngle - Rotation angle for the out state (exited) in degrees. Defaults to -90.
* @param inAngle - Rotation angle for the in state (entered) in degrees. Defaults to 0.
* @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.
*/ const rotatePresenceFn = ({ duration = _reactmotion.motionTokens.durationGentle, easing = _reactmotion.motionTokens.curveDecelerateMax, delay = 0, exitDuration = duration, exitEasing = _reactmotion.motionTokens.curveAccelerateMax, exitDelay = delay, axis = 'z', outAngle = -90, inAngle = 0, animateOpacity = true })=>{
const enterAtoms = [
(0, _rotateatom.rotateAtom)({
direction: 'enter',
duration,
easing,
delay,
axis,
outAngle,
inAngle
})
];
const exitAtoms = [
(0, _rotateatom.rotateAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay,
axis,
outAngle,
inAngle
})
];
if (animateOpacity) {
enterAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'enter',
duration,
easing,
delay
}));
exitAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay
}));
}
return {
enter: enterAtoms,
exit: exitAtoms
};
};
const Rotate = (0, _reactmotion.createPresenceComponent)(rotatePresenceFn);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rotate/Rotate.ts"],"sourcesContent":["import { AtomMotion, createPresenceComponent, motionTokens, PresenceMotionFn } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport { RotateParams } from './rotate-types';\n\n/**\n * Define a presence motion for rotate in/out\n *\n * @param duration - Time (ms) for the enter transition (rotate-in). Defaults to the `durationGentle` value.\n * @param easing - Easing curve for the enter transition (rotate-in). Defaults to the `curveDecelerateMax` value.\n * @param delay - Time (ms) to delay the enter transition. Defaults to 0.\n * @param exitDuration - Time (ms) for the exit transition (rotate-out). Defaults to the `duration` param for symmetry.\n * @param exitEasing - Easing curve for the exit transition (rotate-out). Defaults to the `curveAccelerateMax` value.\n * @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param axis - The axis of rotation: 'x', 'y', or 'z'. Defaults to 'z'.\n * @param outAngle - Rotation angle for the out state (exited) in degrees. Defaults to -90.\n * @param inAngle - Rotation angle for the in state (entered) in degrees. Defaults to 0.\n * @param animateOpacity - Whether to animate the opacity during the rotation. Defaults to `true`.\n */\nconst rotatePresenceFn: PresenceMotionFn<RotateParams> = ({\n duration = motionTokens.durationGentle,\n easing = motionTokens.curveDecelerateMax,\n delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMax,\n exitDelay = delay,\n axis = 'z',\n outAngle = -90,\n inAngle = 0,\n animateOpacity = true,\n}: RotateParams) => {\n const enterAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'enter',\n duration,\n easing,\n delay,\n axis,\n outAngle,\n inAngle,\n }),\n ];\n\n const exitAtoms: AtomMotion[] = [\n rotateAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n axis,\n outAngle,\n inAngle,\n }),\n ];\n\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\n }\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\n };\n};\n\n// Create a presence motion component to rotate an element around a single axis (x, y, or z).\nexport const Rotate = createPresenceComponent(rotatePresenceFn);\n"],"names":["Rotate","rotatePresenceFn","duration","motionTokens","durationGentle","easing","curveDecelerateMax","delay","exitDuration","exitEasing","curveAccelerateMax","exitDelay","axis","outAngle","inAngle","animateOpacity","enterAtoms","rotateAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent"],"mappings":";;;;+BAmEaA;;;eAAAA;;;6BAnEuE;0BAC3D;4BACE;AAG3B;;;;;;;;;;;;;CAaC,GACD,MAAMC,mBAAmD,CAAC,EACxDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeN,QAAQ,EACvBO,aAAaN,yBAAY,CAACO,kBAAkB,EAC5CC,YAAYJ,KAAK,EACjBK,OAAO,GAAG,EACVC,WAAW,CAAC,EAAE,EACdC,UAAU,CAAC,EACXC,iBAAiB,IAAI,EACR;IACb,MAAMC,aAA2B;QAC/BC,IAAAA,sBAAU,EAAC;YACTC,WAAW;YACXhB;YACAG;YACAE;YACAK;YACAC;YACAC;QACF;KACD;IAED,MAAMK,YAA0B;QAC9BF,IAAAA,sBAAU,EAAC;YACTC,WAAW;YACXhB,UAAUM;YACVH,QAAQI;YACRF,OAAOI;YACPC;YACAC;YACAC;QACF;KACD;IAED,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAShB;YAAUG;YAAQE;QAAM;QACvEY,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQhB,UAAUM;YAAcH,QAAQI;YAAYF,OAAOI;QAAU;IAC5G;IAEA,OAAO;QACLW,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMnB,SAASwB,IAAAA,oCAAuB,EAACvB"}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Rotate", {
enumerable: true,
get: function() {
return _Rotate.Rotate;
}
});
const _Rotate = require("./Rotate");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Rotate/index.ts"],"sourcesContent":["export { Rotate } from './Rotate';\nexport type { RotateParams } from './rotate-types';\n"],"names":["Rotate"],"mappings":";;;;+BAASA;;;eAAAA,cAAM;;;wBAAQ"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Scale: function() {
return Scale;
},
ScaleRelaxed: function() {
return ScaleRelaxed;
},
ScaleSnappy: function() {
return ScaleSnappy;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _fadeatom = require("../../atoms/fade-atom");
const _scaleatom = require("../../atoms/scale-atom");
/**
* Define a presence motion for scale in/out
*
* @param duration - Time (ms) for the enter transition (scale-in). Defaults to the `durationGentle` value (250 ms).
* @param easing - Easing curve for the enter transition (scale-in). Defaults to the `curveDecelerateMax` value.
* @param delay - Time (ms) to delay the enter transition. Defaults to 0.
* @param exitDuration - Time (ms) for the exit transition (scale-out). Defaults to the `durationNormal` value (200 ms).
* @param exitEasing - Easing curve for the exit transition (scale-out). Defaults to the `curveAccelerateMax` value.
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
* @param outScale - Scale for the out state (exited). Defaults to `0.9`.
* @param inScale - Scale for the in state (entered). Defaults to `1`.
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
*/ const scalePresenceFn = ({ duration = _reactmotion.motionTokens.durationGentle, easing = _reactmotion.motionTokens.curveDecelerateMax, delay = 0, exitDuration = _reactmotion.motionTokens.durationNormal, exitEasing = _reactmotion.motionTokens.curveAccelerateMax, exitDelay = delay, outScale = 0.9, inScale = 1, animateOpacity = true })=>{
const enterAtoms = [
(0, _scaleatom.scaleAtom)({
direction: 'enter',
duration,
easing,
delay,
outScale,
inScale
})
];
const exitAtoms = [
(0, _scaleatom.scaleAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay,
outScale,
inScale
})
];
// Only add fade atoms if animateOpacity is true.
if (animateOpacity) {
enterAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'enter',
duration,
easing,
delay
}));
exitAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay
}));
}
return {
enter: enterAtoms,
exit: exitAtoms
};
};
const Scale = (0, _reactmotion.createPresenceComponent)(scalePresenceFn);
const ScaleSnappy = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
duration: _reactmotion.motionTokens.durationNormal,
exitDuration: _reactmotion.motionTokens.durationFast
});
const ScaleRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Scale, {
duration: _reactmotion.motionTokens.durationSlow,
exitDuration: _reactmotion.motionTokens.durationGentle
});

View File

@@ -0,0 +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 delay - Time (ms) to delay the enter transition. Defaults to 0.\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 exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param outScale - Scale for the out state (exited). Defaults to `0.9`.\n * @param inScale - Scale for the in state (entered). Defaults to `1`.\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 delay = 0,\n exitDuration = motionTokens.durationNormal,\n exitEasing = motionTokens.curveAccelerateMax,\n exitDelay = delay,\n outScale = 0.9,\n inScale = 1,\n animateOpacity = true,\n}) => {\n const enterAtoms = [scaleAtom({ direction: 'enter', duration, easing, delay, outScale, inScale })];\n const exitAtoms = [\n scaleAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n outScale,\n inScale,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\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","delay","exitDuration","durationNormal","exitEasing","curveAccelerateMax","exitDelay","outScale","inScale","animateOpacity","enterAtoms","scaleAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","durationFast","durationSlow"],"mappings":";;;;;;;;;;;IA2DaA,KAAK;eAALA;;IAOAC,YAAY;eAAZA;;IALAC,WAAW;eAAXA;;;6BAxDN;0BACkB;2BACC;AAG1B;;;;;;;;;;;;CAYC,GACD,MAAMC,kBAAiD,CAAC,EACtDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeL,yBAAY,CAACM,cAAc,EAC1CC,aAAaP,yBAAY,CAACQ,kBAAkB,EAC5CC,YAAYL,KAAK,EACjBM,WAAW,GAAG,EACdC,UAAU,CAAC,EACXC,iBAAiB,IAAI,EACtB;IACC,MAAMC,aAAa;QAACC,IAAAA,oBAAS,EAAC;YAAEC,WAAW;YAAShB;YAAUG;YAAQE;YAAOM;YAAUC;QAAQ;KAAG;IAClG,MAAMK,YAAY;QAChBF,IAAAA,oBAAS,EAAC;YACRC,WAAW;YACXhB,UAAUM;YACVH,QAAQK;YACRH,OAAOK;YACPC;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAShB;YAAUG;YAAQE;QAAM;QACvEY,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQhB,UAAUM;YAAcH,QAAQK;YAAYH,OAAOK;QAAU;IAC5G;IAEA,OAAO;QACLU,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMrB,QAAQ0B,IAAAA,oCAAuB,EAACvB;AAEtC,MAAMD,cAAcyB,IAAAA,2CAA8B,EAAC3B,OAAO;IAC/DI,UAAUC,yBAAY,CAACM,cAAc;IACrCD,cAAcL,yBAAY,CAACuB,YAAY;AACzC;AAEO,MAAM3B,eAAe0B,IAAAA,2CAA8B,EAAC3B,OAAO;IAChEI,UAAUC,yBAAY,CAACwB,YAAY;IACnCnB,cAAcL,yBAAY,CAACC,cAAc;AAC3C"}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Scale: function() {
return _Scale.Scale;
},
ScaleRelaxed: function() {
return _Scale.ScaleRelaxed;
},
ScaleSnappy: function() {
return _Scale.ScaleSnappy;
}
});
const _Scale = require("./Scale");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Scale/index.ts"],"sourcesContent":["export { Scale, ScaleRelaxed, ScaleSnappy } from './Scale';\nexport type { ScaleParams } from './scale-types';\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy"],"mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;;uBAAQ"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Slide: function() {
return Slide;
},
SlideRelaxed: function() {
return SlideRelaxed;
},
SlideSnappy: function() {
return SlideSnappy;
}
});
const _reactmotion = require("@fluentui/react-motion");
const _fadeatom = require("../../atoms/fade-atom");
const _slideatom = require("../../atoms/slide-atom");
/**
* Define a presence motion for slide in/out
*
* @param duration - Time (ms) for the enter transition (slide-in). Defaults to the `durationNormal` value (200 ms).
* @param easing - Easing curve for the enter transition (slide-in). Defaults to the `curveDecelerateMid` value.
* @param delay - Time (ms) to delay the enter transition. Defaults to 0.
* @param exitDuration - Time (ms) for the exit transition (slide-out). Defaults to the `duration` param for symmetry.
* @param exitEasing - Easing curve for the exit transition (slide-out). Defaults to the `curveAccelerateMid` value.
* @param exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.
* @param outX - X translate for the out state (exited). Defaults to `'0px'`.
* @param outY - Y translate for the out state (exited). Defaults to `'0px'`.
* @param inX - X translate for the in state (entered). Defaults to `'0px'`.
* @param inY - Y translate for the in state (entered). Defaults to `'0px'`.
* @param animateOpacity - Whether to animate the opacity. Defaults to `true`.
*/ const slidePresenceFn = ({ duration = _reactmotion.motionTokens.durationNormal, easing = _reactmotion.motionTokens.curveDecelerateMid, delay = 0, exitDuration = duration, exitEasing = _reactmotion.motionTokens.curveAccelerateMid, exitDelay = delay, outX = '0px', outY = '0px', inX = '0px', inY = '0px', animateOpacity = true })=>{
const enterAtoms = [
(0, _slideatom.slideAtom)({
direction: 'enter',
duration,
easing,
delay,
outX,
outY,
inX,
inY
})
];
const exitAtoms = [
(0, _slideatom.slideAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay,
outX,
outY,
inX,
inY
})
];
// Only add fade atoms if animateOpacity is true.
if (animateOpacity) {
enterAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'enter',
duration,
easing,
delay
}));
exitAtoms.push((0, _fadeatom.fadeAtom)({
direction: 'exit',
duration: exitDuration,
easing: exitEasing,
delay: exitDelay
}));
}
return {
enter: enterAtoms,
exit: exitAtoms
};
};
const Slide = (0, _reactmotion.createPresenceComponent)(slidePresenceFn);
const SlideSnappy = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
easing: _reactmotion.motionTokens.curveDecelerateMax,
exitEasing: _reactmotion.motionTokens.curveAccelerateMax
});
const SlideRelaxed = (0, _reactmotion.createPresenceComponentVariant)(Slide, {
duration: _reactmotion.motionTokens.durationGentle
});

View File

@@ -0,0 +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 delay - Time (ms) to delay the enter transition. Defaults to 0.\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 exitDelay - Time (ms) to delay the exit transition. Defaults to the `delay` param for symmetry.\n * @param outX - X translate for the out state (exited). Defaults to `'0px'`.\n * @param outY - Y translate for the out state (exited). Defaults to `'0px'`.\n * @param inX - X translate for the in state (entered). Defaults to `'0px'`.\n * @param inY - Y translate for the in state (entered). Defaults to `'0px'`.\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 delay = 0,\n exitDuration = duration,\n exitEasing = motionTokens.curveAccelerateMid,\n exitDelay = delay,\n outX = '0px',\n outY = '0px',\n inX = '0px',\n inY = '0px',\n animateOpacity = true,\n}: SlideParams) => {\n const enterAtoms = [slideAtom({ direction: 'enter', duration, easing, delay, outX, outY, inX, inY })];\n const exitAtoms = [\n slideAtom({\n direction: 'exit',\n duration: exitDuration,\n easing: exitEasing,\n delay: exitDelay,\n outX,\n outY,\n inX,\n inY,\n }),\n ];\n\n // Only add fade atoms if animateOpacity is true.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration, easing, delay }));\n exitAtoms.push(fadeAtom({ direction: 'exit', duration: exitDuration, easing: exitEasing, delay: exitDelay }));\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","delay","exitDuration","exitEasing","curveAccelerateMid","exitDelay","outX","outY","inX","inY","animateOpacity","enterAtoms","slideAtom","direction","exitAtoms","push","fadeAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","curveDecelerateMax","curveAccelerateMax","durationGentle"],"mappings":";;;;;;;;;;;IAiEaA,KAAK;eAALA;;IAOAC,YAAY;eAAZA;;IALAC,WAAW;eAAXA;;;6BA9DN;0BACkB;2BACC;AAG1B;;;;;;;;;;;;;;CAcC,GACD,MAAMC,kBAAiD,CAAC,EACtDC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,SAASF,yBAAY,CAACG,kBAAkB,EACxCC,QAAQ,CAAC,EACTC,eAAeN,QAAQ,EACvBO,aAAaN,yBAAY,CAACO,kBAAkB,EAC5CC,YAAYJ,KAAK,EACjBK,OAAO,KAAK,EACZC,OAAO,KAAK,EACZC,MAAM,KAAK,EACXC,MAAM,KAAK,EACXC,iBAAiB,IAAI,EACT;IACZ,MAAMC,aAAa;QAACC,IAAAA,oBAAS,EAAC;YAAEC,WAAW;YAASjB;YAAUG;YAAQE;YAAOK;YAAMC;YAAMC;YAAKC;QAAI;KAAG;IACrG,MAAMK,YAAY;QAChBF,IAAAA,oBAAS,EAAC;YACRC,WAAW;YACXjB,UAAUM;YACVH,QAAQI;YACRF,OAAOI;YACPC;YACAC;YACAC;YACAC;QACF;KACD;IAED,iDAAiD;IACjD,IAAIC,gBAAgB;QAClBC,WAAWI,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAASjB;YAAUG;YAAQE;QAAM;QACvEa,UAAUC,IAAI,CAACC,IAAAA,kBAAQ,EAAC;YAAEH,WAAW;YAAQjB,UAAUM;YAAcH,QAAQI;YAAYF,OAAOI;QAAU;IAC5G;IAEA,OAAO;QACLY,OAAON;QACPO,MAAMJ;IACR;AACF;AAGO,MAAMtB,QAAQ2B,IAAAA,oCAAuB,EAACxB;AAEtC,MAAMD,cAAc0B,IAAAA,2CAA8B,EAAC5B,OAAO;IAC/DO,QAAQF,yBAAY,CAACwB,kBAAkB;IACvClB,YAAYN,yBAAY,CAACyB,kBAAkB;AAC7C;AAEO,MAAM7B,eAAe2B,IAAAA,2CAA8B,EAAC5B,OAAO;IAChEI,UAAUC,yBAAY,CAAC0B,cAAc;AACvC"}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Slide: function() {
return _Slide.Slide;
},
SlideRelaxed: function() {
return _Slide.SlideRelaxed;
},
SlideSnappy: function() {
return _Slide.SlideSnappy;
}
});
const _Slide = require("./Slide");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Slide/index.ts"],"sourcesContent":["export { Slide, SlideRelaxed, SlideSnappy } from './Slide';\nexport type { SlideParams } from './slide-types';\n"],"names":["Slide","SlideRelaxed","SlideSnappy"],"mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;;uBAAQ"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}