Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,78 @@
"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;
},
createScalePresence: function() {
return createScalePresence;
}
});
const _reactmotion = require("@fluentui/react-motion");
const createScalePresence = ({ enterDuration = _reactmotion.motionTokens.durationGentle, enterEasing = _reactmotion.motionTokens.curveDecelerateMax, exitDuration = _reactmotion.motionTokens.durationNormal, exitEasing = _reactmotion.motionTokens.curveAccelerateMax } = {})=>({ animateOpacity = true })=>{
const fromOpacity = animateOpacity ? 0 : 1;
const toOpacity = 1;
const fromScale = 0.9; // Could be a custom param in the future
const toScale = 1;
const enterKeyframes = [
{
opacity: fromOpacity,
transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
visibility: 'visible'
},
{
opacity: toOpacity,
transform: `scale3d(${toScale}, ${toScale}, 1)`
}
];
const exitKeyframes = [
{
opacity: toOpacity,
transform: `scale3d(${toScale}, ${toScale}, 1)`
},
{
opacity: fromOpacity,
transform: `scale3d(${fromScale}, ${fromScale}, 1)`,
visibility: 'hidden'
}
];
return {
enter: {
duration: enterDuration,
easing: enterEasing,
keyframes: enterKeyframes
},
exit: {
duration: exitDuration,
easing: exitEasing,
keyframes: exitKeyframes
}
};
};
const Scale = (0, _reactmotion.createPresenceComponent)(createScalePresence());
const ScaleSnappy = (0, _reactmotion.createPresenceComponent)(createScalePresence({
enterDuration: _reactmotion.motionTokens.durationNormal,
enterEasing: _reactmotion.motionTokens.curveDecelerateMax,
exitDuration: _reactmotion.motionTokens.durationFast,
exitEasing: _reactmotion.motionTokens.curveAccelerateMax
}));
const ScaleRelaxed = (0, _reactmotion.createPresenceComponent)(createScalePresence({
enterDuration: _reactmotion.motionTokens.durationSlow,
enterEasing: _reactmotion.motionTokens.curveDecelerateMax,
exitDuration: _reactmotion.motionTokens.durationGentle,
exitEasing: _reactmotion.motionTokens.curveAccelerateMax
}));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Scale/Scale.ts"],"sourcesContent":["import { motionTokens, createPresenceComponent } from '@fluentui/react-motion';\nimport { PresenceMotionFnCreator } from '../../types';\nimport { ScaleRuntimeParams_unstable, ScaleVariantParams_unstable } from './Scale.types';\n\n/** Define a presence motion for scale in/out */\nexport const createScalePresence: PresenceMotionFnCreator<ScaleVariantParams_unstable, ScaleRuntimeParams_unstable> =\n ({\n enterDuration = motionTokens.durationGentle,\n enterEasing = motionTokens.curveDecelerateMax,\n exitDuration = motionTokens.durationNormal,\n exitEasing = motionTokens.curveAccelerateMax,\n } = {}) =>\n ({ animateOpacity = true }) => {\n const fromOpacity = animateOpacity ? 0 : 1;\n const toOpacity = 1;\n const fromScale = 0.9; // Could be a custom param in the future\n const toScale = 1;\n\n const enterKeyframes = [\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'visible' },\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, transform: `scale3d(${toScale}, ${toScale}, 1)` },\n { opacity: fromOpacity, transform: `scale3d(${fromScale}, ${fromScale}, 1)`, visibility: 'hidden' },\n ];\n return {\n enter: {\n duration: enterDuration,\n easing: enterEasing,\n keyframes: enterKeyframes,\n },\n exit: { duration: exitDuration, easing: exitEasing, keyframes: exitKeyframes },\n };\n };\n\n/** A React component that applies scale in/out transitions to its children. */\nexport const Scale = createPresenceComponent(createScalePresence());\n\nexport const ScaleSnappy = createPresenceComponent(\n createScalePresence({\n enterDuration: motionTokens.durationNormal,\n enterEasing: motionTokens.curveDecelerateMax,\n exitDuration: motionTokens.durationFast,\n exitEasing: motionTokens.curveAccelerateMax,\n }),\n);\n\nexport const ScaleRelaxed = createPresenceComponent(\n createScalePresence({\n enterDuration: motionTokens.durationSlow,\n enterEasing: motionTokens.curveDecelerateMax,\n exitDuration: motionTokens.durationGentle,\n exitEasing: motionTokens.curveAccelerateMax,\n }),\n);\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy","createScalePresence","enterDuration","motionTokens","durationGentle","enterEasing","curveDecelerateMax","exitDuration","durationNormal","exitEasing","curveAccelerateMax","animateOpacity","fromOpacity","toOpacity","fromScale","toScale","enterKeyframes","opacity","transform","visibility","exitKeyframes","enter","duration","easing","keyframes","exit","createPresenceComponent","durationFast","durationSlow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAsCaA,KAAK;eAALA;;IAWAC,YAAY;eAAZA;;IATAC,WAAW;eAAXA;;IAnCAC,mBAAmB;eAAnBA;;;6BALyC;AAK/C,MAAMA,sBACX,CAAC,EACCC,gBAAgBC,yBAAY,CAACC,cAAc,EAC3CC,cAAcF,yBAAY,CAACG,kBAAkB,EAC7CC,eAAeJ,yBAAY,CAACK,cAAc,EAC1CC,aAAaN,yBAAY,CAACO,kBAAkB,EAC7C,GAAG,CAAC,CAAC,GACN,CAAC,EAAEC,iBAAiB,IAAI,EAAE;QACxB,MAAMC,cAAcD,iBAAiB,IAAI;QACzC,MAAME,YAAY;QAClB,MAAMC,YAAY,KAAK,wCAAwC;QAC/D,MAAMC,UAAU;QAEhB,MAAMC,iBAAiB;YACrB;gBAAEC,SAASL;gBAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;gBAAEK,YAAY;YAAU;YACnG;gBAAEF,SAASJ;gBAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;YAAC;SACvE;QAED,MAAMK,gBAAgB;YACpB;gBAAEH,SAASJ;gBAAWK,WAAW,CAAC,QAAQ,EAAEH,QAAQ,EAAE,EAAEA,QAAQ,IAAI,CAAC;YAAC;YACtE;gBAAEE,SAASL;gBAAaM,WAAW,CAAC,QAAQ,EAAEJ,UAAU,EAAE,EAAEA,UAAU,IAAI,CAAC;gBAAEK,YAAY;YAAS;SACnG;QACD,OAAO;YACLE,OAAO;gBACLC,UAAUpB;gBACVqB,QAAQlB;gBACRmB,WAAWR;YACb;YACAS,MAAM;gBAAEH,UAAUf;gBAAcgB,QAAQd;gBAAYe,WAAWJ;YAAc;QAC/E;IACF;AAGK,MAAMtB,QAAQ4B,IAAAA,oCAAuB,EAACzB;AAEtC,MAAMD,cAAc0B,IAAAA,oCAAuB,EAChDzB,oBAAoB;IAClBC,eAAeC,yBAAY,CAACK,cAAc;IAC1CH,aAAaF,yBAAY,CAACG,kBAAkB;IAC5CC,cAAcJ,yBAAY,CAACwB,YAAY;IACvClB,YAAYN,yBAAY,CAACO,kBAAkB;AAC7C;AAGK,MAAMX,eAAe2B,IAAAA,oCAAuB,EACjDzB,oBAAoB;IAClBC,eAAeC,yBAAY,CAACyB,YAAY;IACxCvB,aAAaF,yBAAY,CAACG,kBAAkB;IAC5CC,cAAcJ,yBAAY,CAACC,cAAc;IACzCK,YAAYN,yBAAY,CAACO,kBAAkB;AAC7C"}
@@ -0,0 +1,5 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Scale/Scale.types.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type ScaleVariantParams_unstable = {\n /** Time (ms) for the enter transition. Defaults to the `durationNormal` value (200 ms). */\n enterDuration?: number;\n\n /** Easing curve for the enter transition. Defaults to the `easeEaseMax` value. */\n enterEasing?: string;\n\n /** Time (ms) for the exit transition. Defaults to the `enterDuration` param for symmetry. */\n exitDuration?: number;\n\n /** Easing curve for the exit transition. Defaults to the `enterEasing` param for symmetry. */\n exitEasing?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type ScaleRuntimeParams_unstable = {\n /** Whether to animate the opacity. Defaults to `true`. */\n animateOpacity?: boolean;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAAA,gEAAgE"}
@@ -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, {
Scale: function() {
return _Scale.Scale;
},
ScaleRelaxed: function() {
return _Scale.ScaleRelaxed;
},
ScaleSnappy: function() {
return _Scale.ScaleSnappy;
},
createScalePresence: function() {
return _Scale.createScalePresence;
}
});
const _Scale = require("./Scale");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Scale/index.ts"],"sourcesContent":["export { Scale, ScaleRelaxed, ScaleSnappy, createScalePresence } from './Scale';\n"],"names":["Scale","ScaleRelaxed","ScaleSnappy","createScalePresence"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,YAAY;eAAZA,mBAAY;;IAAEC,WAAW;eAAXA,kBAAW;;IAAEC,mBAAmB;eAAnBA,0BAAmB;;;uBAAQ"}