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,29 @@
import { MOTION_DEFINITION, createMotionComponent } from './createMotionComponent';
/**
* Create a variant function that wraps a motion function to customize it.
* The new motion function has the supplied variant params as defaults,
* but these can still be overridden by runtime params when the new function is called.
*
* @internal
*/ export function createMotionFnVariant(motionFn, variantParams) {
const variantFn = (runtimeParams)=>motionFn({
...variantParams,
...runtimeParams
});
return variantFn;
}
/**
* Create a new motion component based on another motion component,
* using the provided variant parameters as defaults.
*
* @param component - A component created by `createMotionComponent`.
* @param variantParams - An object containing the variant parameters to be used as defaults.
* The variant parameters should match the type of the component's motion parameters.
* @returns A new motion component that uses the provided variant parameters as defaults.
* The new component can still accept runtime parameters that override the defaults.
*/ export function createMotionComponentVariant(component, variantParams) {
const originalFn = component[MOTION_DEFINITION];
// The variant params become new defaults, but they can still be overridden by runtime params.
const variantFn = createMotionFnVariant(originalFn, variantParams);
return createMotionComponent(variantFn);
}