@fluentui/react-motion-components-preview 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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 +15 -7
- package/lib/atoms/blur-atom.js.map +1 -1
- package/lib/atoms/fade-atom.js.map +1 -1
- package/lib/atoms/rotate-atom.js.map +1 -1
- package/lib/atoms/scale-atom.js.map +1 -1
- package/lib/atoms/slide-atom.js.map +1 -1
- package/lib/choreography/Stagger/Stagger.js.map +1 -1
- package/lib/choreography/Stagger/index.js.map +1 -1
- package/lib/choreography/Stagger/stagger-types.js.map +1 -1
- package/lib/choreography/Stagger/useStaggerItemsVisibility.js.map +1 -1
- package/lib/choreography/Stagger/utils/constants.js.map +1 -1
- package/lib/choreography/Stagger/utils/getStaggerChildMapping.js.map +1 -1
- package/lib/choreography/Stagger/utils/index.js.map +1 -1
- package/lib/choreography/Stagger/utils/motionComponentDetection.js.map +1 -1
- package/lib/choreography/Stagger/utils/stagger-calculations.js.map +1 -1
- package/lib/components/Blur/Blur.js.map +1 -1
- package/lib/components/Blur/blur-types.js.map +1 -1
- package/lib/components/Blur/index.js.map +1 -1
- package/lib/components/Collapse/Collapse.js.map +1 -1
- package/lib/components/Collapse/collapse-atoms.js.map +1 -1
- package/lib/components/Collapse/collapse-test-utils.js +18 -20
- package/lib/components/Collapse/collapse-test-utils.js.map +1 -1
- package/lib/components/Collapse/collapse-types.js.map +1 -1
- package/lib/components/Collapse/index.js.map +1 -1
- package/lib/components/Fade/Fade.js.map +1 -1
- package/lib/components/Fade/fade-types.js.map +1 -1
- package/lib/components/Fade/index.js.map +1 -1
- package/lib/components/Rotate/Rotate.js.map +1 -1
- package/lib/components/Rotate/index.js.map +1 -1
- package/lib/components/Rotate/rotate-types.js.map +1 -1
- 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.map +1 -1
- package/lib/components/Slide/Slide.js.map +1 -1
- package/lib/components/Slide/index.js.map +1 -1
- package/lib/components/Slide/slide-types.js.map +1 -1
- package/lib-commonjs/atoms/blur-atom.cjs.map +1 -1
- package/lib-commonjs/atoms/fade-atom.cjs.map +1 -1
- package/lib-commonjs/atoms/rotate-atom.cjs.map +1 -1
- package/lib-commonjs/atoms/scale-atom.cjs.map +1 -1
- package/lib-commonjs/atoms/slide-atom.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/Stagger.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/index.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/useStaggerItemsVisibility.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/utils/constants.cjs +3 -3
- package/lib-commonjs/choreography/Stagger/utils/constants.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/utils/getStaggerChildMapping.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/utils/index.cjs +8 -8
- package/lib-commonjs/choreography/Stagger/utils/index.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/utils/motionComponentDetection.cjs +5 -5
- package/lib-commonjs/choreography/Stagger/utils/motionComponentDetection.cjs.map +1 -1
- package/lib-commonjs/choreography/Stagger/utils/stagger-calculations.cjs +3 -3
- package/lib-commonjs/choreography/Stagger/utils/stagger-calculations.cjs.map +1 -1
- package/lib-commonjs/components/Blur/Blur.cjs.map +1 -1
- package/lib-commonjs/components/Blur/index.cjs.map +1 -1
- package/lib-commonjs/components/Collapse/Collapse.cjs +5 -5
- package/lib-commonjs/components/Collapse/Collapse.cjs.map +1 -1
- package/lib-commonjs/components/Collapse/collapse-atoms.cjs +4 -4
- package/lib-commonjs/components/Collapse/collapse-atoms.cjs.map +1 -1
- package/lib-commonjs/components/Collapse/collapse-test-utils.cjs +26 -28
- package/lib-commonjs/components/Collapse/collapse-test-utils.cjs.map +1 -1
- package/lib-commonjs/components/Collapse/index.cjs +5 -5
- package/lib-commonjs/components/Collapse/index.cjs.map +1 -1
- package/lib-commonjs/components/Fade/Fade.cjs +5 -5
- package/lib-commonjs/components/Fade/Fade.cjs.map +1 -1
- package/lib-commonjs/components/Fade/index.cjs +4 -4
- package/lib-commonjs/components/Fade/index.cjs.map +1 -1
- package/lib-commonjs/components/Rotate/Rotate.cjs.map +1 -1
- package/lib-commonjs/components/Rotate/index.cjs.map +1 -1
- package/lib-commonjs/components/Scale/Scale.cjs +4 -4
- package/lib-commonjs/components/Scale/Scale.cjs.map +1 -1
- package/lib-commonjs/components/Scale/index.cjs +4 -4
- package/lib-commonjs/components/Scale/index.cjs.map +1 -1
- package/lib-commonjs/components/Slide/Slide.cjs +4 -4
- package/lib-commonjs/components/Slide/Slide.cjs.map +1 -1
- package/lib-commonjs/components/Slide/index.cjs +4 -4
- package/lib-commonjs/components/Slide/index.cjs.map +1 -1
- package/lib-commonjs/index.cjs +22 -22
- package/lib-commonjs/index.cjs.map +1 -1
- package/package.json +5 -8
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/choreography/Stagger/utils/motionComponentDetection.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * Checks if a React element has all of the specified props explicitly provided.\n *\n * - Exported for testing purposes\n *\n * @param element - React element to inspect\n * @param props - Array of prop names to verify presence on the element\n * @returns true if all props exist on element.props, false otherwise\n *\n * @internal\n */\n\n/**\n * Checks if a React element is a motion component created by createMotionComponent.\n * Motion components are detected by the presence of the MOTION_DEFINITION symbol on the component.\n *\n * - Exported for testing purposes\n *\n * @param element - React element to inspect\n * @returns true when the element's type contains the MOTION_DEFINITION symbol\n *\n * **Note:** This is a heuristic detection. Motion components may or may not support\n * specific props like `delay` or `visible` depending on their implementation.\n *\n * @internal\n */\nexport function isMotionComponent(element: React.ReactElement): boolean {\n if (!element?.type || typeof element.type !== 'function') {\n return false;\n }\n\n // Check if the component has the MOTION_DEFINITION symbol (internal to createMotionComponent)\n const symbols = Object.getOwnPropertySymbols(element.type);\n return symbols.some(sym => sym.description === 'MOTION_DEFINITION');\n}\n\n/**\n * Checks if a React element is a presence motion component by looking for the PRESENCE_MOTION_DEFINITION symbol.\n * This symbol is added internally by createPresenceComponent and provides reliable detection.\n *\n * - Exported for testing purposes\n *\n * @param element - React element to inspect\n * @returns true when the element's type contains the PRESENCE_MOTION_DEFINITION symbol\n *\n * **Presence components** (like Fade, Scale, Slide) are guaranteed to support both `visible` and `delay` props.\n *\n * @internal\n */\nexport function isPresenceComponent(element: React.ReactElement): boolean {\n if (!element?.type || typeof element.type !== 'function') {\n return false;\n }\n\n // Check if the component has the PRESENCE_MOTION_DEFINITION symbol (internal to createPresenceComponent)\n const symbols = Object.getOwnPropertySymbols(element.type);\n return symbols.some(sym => sym.description === 'PRESENCE_MOTION_DEFINITION');\n}\n\n/**\n * Checks if a React element accepts both `delay` and `exitDelay` props.\n * This uses a best-effort heuristic to detect components that support both delay props.\n *\n * - Exported for testing purposes\n *\n * @param element - React element to inspect\n * @returns true when the element likely supports both delay and exitDelay props\n *\n * **Auto-detection includes:**\n * - Presence components (Fade, Scale, etc.) - guaranteed to support both delay and exitDelay\n * - Motion components (.In/.Out variants, custom motion components) - may support both delay props\n * - Elements with explicit delay and exitDelay props already set\n *\n * **When to override:** If auto-detection is incorrect, use explicit `delayMode` prop on Stagger.\n * For example, custom motion components that don't support both props should use `delayMode=\"timing\"`.\n *\n * @internal\n */\nexport function acceptsDelayProps(element: React.ReactElement): boolean {\n return isPresenceComponent(element) || isMotionComponent(element);\n}\n\n/**\n * Checks if a React element accepts a `visible` prop.\n * This uses a best-effort heuristic to detect components that support visible props.\n *\n * - Exported for testing purposes\n *\n * @param element - React element to inspect\n * @returns true when the element likely supports a `visible` prop\n *\n * **Auto-detection includes:**\n * - Presence components (Fade, Scale, etc.) - guaranteed to support visible\n * - Elements with explicit visible props already set\n *\n * **When to override:** If auto-detection is incorrect, use explicit `hideMode` prop on Stagger.\n * For example, custom components that don't support visible should use `hideMode=\"visibilityStyle\"` or `hideMode=\"unmount\"`.\n *\n * @internal\n */\nexport function acceptsVisibleProp(element: React.ReactElement): boolean {\n return isPresenceComponent(element);\n}\n"],"names":["acceptsDelayProps","acceptsVisibleProp","isMotionComponent","isPresenceComponent","element","type","symbols","Object","getOwnPropertySymbols","some","sym","description"],"mappings":";;;;;;;;;;;QAgFgBA;eAAAA;;QAsBAC;eAAAA;;QA1EAC;eAAAA;;QAuBAC;eAAAA;;;AAvBT,SAASD,kBAAkBE,OAA2B;IAC3D,IAAI,EAACA,oBAAAA,8BAAAA,QAASC,IAAI,KAAI,OAAOD,QAAQC,IAAI,KAAK,YAAY;QACxD,OAAO;IACT;IAEA,8FAA8F;IAC9F,MAAMC,UAAUC,OAAOC,qBAAqB,CAACJ,QAAQC,IAAI;IACzD,OAAOC,QAAQG,IAAI,CAACC,CAAAA,MAAOA,IAAIC,WAAW,KAAK;AACjD;AAeO,SAASR,oBAAoBC,OAA2B;IAC7D,IAAI,EAACA,oBAAAA,8BAAAA,QAASC,IAAI,KAAI,OAAOD,QAAQC,IAAI,KAAK,YAAY;QACxD,OAAO;IACT;IAEA,yGAAyG;IACzG,MAAMC,UAAUC,OAAOC,qBAAqB,CAACJ,QAAQC,IAAI;IACzD,OAAOC,QAAQG,IAAI,CAACC,CAAAA,MAAOA,IAAIC,WAAW,KAAK;AACjD;AAqBO,SAASX,kBAAkBI,OAA2B;IAC3D,OAAOD,oBAAoBC,YAAYF,kBAAkBE;AAC3D;AAoBO,SAASH,mBAAmBG,OAA2B;IAC5D,OAAOD,oBAAoBC;AAC7B"}
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getStaggerTotalDuration
|
|
12
|
+
get getStaggerTotalDuration () {
|
|
13
13
|
return getStaggerTotalDuration;
|
|
14
14
|
},
|
|
15
|
-
staggerItemsVisibilityAtTime
|
|
15
|
+
get staggerItemsVisibilityAtTime () {
|
|
16
16
|
return staggerItemsVisibilityAtTime;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/choreography/Stagger/utils/stagger-calculations.ts"],"sourcesContent":["import type { StaggerProps } from '../stagger-types';\nimport { DEFAULT_ITEM_DELAY, DEFAULT_ITEM_DURATION } from './constants';\n\n/**\n * Calculate the total stagger duration — from the moment the stagger begins\n * until the final item's animation completes.\n *\n * Uses the formula:\n * max(0, itemDelay * (itemCount - 1) + itemDuration)\n *\n * @param params.itemCount Total number of items to stagger\n * @param params.itemDelay Milliseconds between the start of each item (default: DEFAULT_ITEM_DELAY)\n * @param params.itemDuration Milliseconds each item's animation lasts (default: DEFAULT_ITEM_DURATION)\n * @returns Total duration in milliseconds (never negative)\n */\nexport function getStaggerTotalDuration({\n itemCount,\n itemDelay = DEFAULT_ITEM_DELAY,\n itemDuration = DEFAULT_ITEM_DURATION,\n}: {\n itemCount: number;\n} & Pick<StaggerProps, 'itemDelay' | 'itemDuration'>): number {\n if (itemCount <= 0) {\n return 0;\n }\n if (itemCount <= 1) {\n return Math.max(0, itemDuration);\n }\n const staggerDuration = itemDelay * (itemCount - 1);\n return Math.max(0, staggerDuration + itemDuration);\n}\n\nexport interface StaggerItemsVisibilityAtTimeParams\n extends Pick<StaggerProps, 'itemDelay' | 'itemDuration' | 'reversed'> {\n itemCount: number;\n elapsed: number;\n direction?: 'enter' | 'exit';\n}\n\n/**\n * Returns visibility flags plus timing metrics for a stagger sequence.\n */\nexport function staggerItemsVisibilityAtTime({\n itemCount,\n elapsed,\n itemDelay = DEFAULT_ITEM_DELAY,\n itemDuration = DEFAULT_ITEM_DURATION,\n direction = 'enter',\n reversed = false,\n}: StaggerItemsVisibilityAtTimeParams): {\n itemsVisibility: boolean[];\n totalDuration: number;\n} {\n // If no items, return the empty state\n if (itemCount <= 0) {\n return { itemsVisibility: [], totalDuration: 0 };\n }\n\n const totalDuration = getStaggerTotalDuration({ itemCount, itemDelay, itemDuration });\n\n // Calculate progression through the stagger sequence\n let completedSteps: number;\n if (itemDelay <= 0) {\n // When itemDelay is 0 or negative, all steps complete immediately\n completedSteps = itemCount;\n } else {\n // Both enter and exit should start their first item immediately, but handle t=0 differently\n if (elapsed === 0) {\n // At exactly t=0, for enter we want first item visible, for exit we want all items visible\n completedSteps = direction === 'enter' ? 1 : 0;\n } else {\n // After t=0, both directions should progress at the same rate\n const stepsFromElapsedTime = Math.floor(elapsed / itemDelay) + 1;\n completedSteps = Math.min(itemCount, stepsFromElapsedTime);\n }\n }\n\n const itemsVisibility = Array.from({ length: itemCount }, (_, idx) => {\n // Calculate based on progression through the sequence (enter pattern)\n const fromStart = idx < completedSteps;\n const fromEnd = idx >= itemCount - completedSteps;\n\n let itemVisible = reversed ? fromEnd : fromStart;\n\n // For exit, invert the enter pattern\n if (direction === 'exit') {\n itemVisible = !itemVisible;\n }\n\n return itemVisible;\n });\n\n return { itemsVisibility, totalDuration };\n}\n"],"names":["getStaggerTotalDuration","staggerItemsVisibilityAtTime","itemCount","itemDelay","DEFAULT_ITEM_DELAY","itemDuration","DEFAULT_ITEM_DURATION","Math","max","staggerDuration","elapsed","direction","reversed","itemsVisibility","totalDuration","completedSteps","stepsFromElapsedTime","floor","min","Array","from","length","_","idx","fromStart","fromEnd","itemVisible"],"mappings":";;;;;;;;;;;QAegBA;eAAAA;;QA2BAC;eAAAA;;;2BAzC0C;AAcnD,SAASD,wBAAwB,EACtCE,SAAS,EACTC,YAAYC,6BAAkB,EAC9BC,eAAeC,gCAAqB,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
1
|
+
{"version":3,"sources":["../../../src/components/Blur/Blur.ts"],"sourcesContent":["import type { PresenceMotionFn } from '@fluentui/react-motion';\nimport { motionTokens, createPresenceComponent } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { blurAtom } from '../../atoms/blur-atom';\nimport type { 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":";;;;+BAuDaA;;;eAAAA;;;6BAtDyC;0BAC7B;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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"}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Collapse
|
|
12
|
+
get Collapse () {
|
|
13
13
|
return Collapse;
|
|
14
14
|
},
|
|
15
|
-
CollapseDelayed
|
|
15
|
+
get CollapseDelayed () {
|
|
16
16
|
return CollapseDelayed;
|
|
17
17
|
},
|
|
18
|
-
CollapseRelaxed
|
|
18
|
+
get CollapseRelaxed () {
|
|
19
19
|
return CollapseRelaxed;
|
|
20
20
|
},
|
|
21
|
-
CollapseSnappy
|
|
21
|
+
get CollapseSnappy () {
|
|
22
22
|
return CollapseSnappy;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Collapse/Collapse.ts"],"sourcesContent":["import type { PresenceMotionFn, AtomMotion } from '@fluentui/react-motion';\nimport { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';\nimport type { CollapseParams } from './collapse-types';\nimport { sizeEnterAtom, sizeExitAtom, whitespaceAtom } from './collapse-atoms';\nimport { fadeAtom } from '../../atoms/fade-atom';\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 delay - Time (ms) to delay the entire enter transition. Defaults to 0\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 exitDelay - Time (ms) to delay the entire exit transition. Defaults to the `delay` param for symmetry\n * @param staggerDelay - Time (ms) offset between the size and opacity animations. Defaults to 0\n * @param exitStaggerDelay - Time (ms) offset between the size and opacity animations on exit. Defaults to the `staggerDelay` param for symmetry\n * @param sizeDuration - Time (ms) for the size animation during enter. Defaults to `duration` for unified timing\n * @param opacityDuration - Time (ms) for the opacity animation during enter. Defaults to `sizeDuration` for synchronized timing\n * @param exitSizeDuration - Time (ms) for the size animation during exit. Defaults to `exitDuration` for unified timing\n * @param exitOpacityDuration - Time (ms) for the opacity animation during exit. Defaults to `exitSizeDuration` for synchronized timing\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 * @param outSize - Size for the out state (collapsed). Defaults to `'0px'`\n */\nconst collapsePresenceFn: PresenceMotionFn<CollapseParams> = ({\n element,\n // Primary duration controls (simple API)\n duration = motionTokens.durationNormal,\n exitDuration = duration,\n\n // Granular duration controls with smart defaults (advanced API)\n sizeDuration = duration,\n opacityDuration = sizeDuration,\n exitSizeDuration = exitDuration,\n exitOpacityDuration = exitSizeDuration,\n\n // Other timing controls\n easing = motionTokens.curveEasyEaseMax,\n delay = 0,\n exitEasing = easing,\n exitDelay = delay,\n staggerDelay = 0,\n exitStaggerDelay = staggerDelay,\n\n // Animation controls\n animateOpacity = true,\n orientation = 'vertical',\n outSize = '0px',\n}) => {\n // ----- ENTER -----\n // The enter transition is an array of up to 3 motion atoms: size, whitespace and opacity.\n // For enter: size expands first, then opacity fades in after staggerDelay\n const enterAtoms: AtomMotion[] = [\n // Apply global delay to size atom - size expansion starts first\n sizeEnterAtom({ orientation, duration: sizeDuration, easing, element, outSize, delay }),\n whitespaceAtom({ direction: 'enter', orientation, duration: sizeDuration, easing, delay }),\n ];\n // Fade in only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n enterAtoms.push(fadeAtom({ direction: 'enter', duration: opacityDuration, easing, delay: delay + staggerDelay }));\n }\n\n // ----- EXIT -----\n // The exit transition is an array of up to 3 motion atoms: opacity, size and whitespace.\n // For exit: opacity fades out first, then size collapses after exitStaggerDelay\n const exitAtoms: AtomMotion[] = [];\n // Fade out only if animateOpacity is true. Otherwise, leave opacity unaffected.\n if (animateOpacity) {\n exitAtoms.push(\n fadeAtom({ direction: 'exit', duration: exitOpacityDuration, easing: exitEasing, delay: exitDelay }),\n );\n }\n\n exitAtoms.push(\n sizeExitAtom({\n orientation,\n duration: exitSizeDuration,\n easing: exitEasing,\n element,\n delay: exitDelay + exitStaggerDelay,\n outSize,\n }),\n whitespaceAtom({\n direction: 'exit',\n orientation,\n duration: exitSizeDuration,\n easing: exitEasing,\n delay: exitDelay + exitStaggerDelay, // Size/whitespace collapse after opacity finishes fading out\n }),\n );\n\n return {\n enter: enterAtoms,\n exit: exitAtoms,\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 = createPresenceComponentVariant(Collapse, {\n // Enter timing per motion design spec\n sizeDuration: motionTokens.durationNormal, // 200ms\n opacityDuration: motionTokens.durationSlower, // 400ms\n staggerDelay: motionTokens.durationNormal, // 200ms\n\n // Exit timing per motion design spec\n exitSizeDuration: motionTokens.durationNormal, // 200ms\n exitOpacityDuration: motionTokens.durationSlower, // 400ms\n exitStaggerDelay: motionTokens.durationSlower, // 400ms\n\n // Easing per motion design spec\n easing: motionTokens.curveEasyEase,\n exitEasing: motionTokens.curveEasyEase,\n});\n"],"names":["Collapse","CollapseDelayed","CollapseRelaxed","CollapseSnappy","collapsePresenceFn","element","duration","motionTokens","durationNormal","exitDuration","sizeDuration","opacityDuration","exitSizeDuration","exitOpacityDuration","easing","curveEasyEaseMax","delay","exitEasing","exitDelay","staggerDelay","exitStaggerDelay","animateOpacity","orientation","outSize","enterAtoms","sizeEnterAtom","whitespaceAtom","direction","push","fadeAtom","exitAtoms","sizeExitAtom","enter","exit","createPresenceComponent","createPresenceComponentVariant","durationFast","durationSlower","curveEasyEase"],"mappings":";;;;;;;;;;;QAoGaA;eAAAA;;QAWAC;eAAAA;;QALAC;eAAAA;;QAJAC;eAAAA;;;6BArGyE;+BAE1B;0BACnC;AAEzB;;;;;;;;;;;;;;;;;;;CAmBC,GACD,MAAMC,qBAAuD,CAAC,EAC5DC,OAAO,EACP,yCAAyC;AACzCC,WAAWC,yBAAY,CAACC,cAAc,EACtCC,eAAeH,QAAQ,EAEvB,gEAAgE;AAChEI,eAAeJ,QAAQ,EACvBK,kBAAkBD,YAAY,EAC9BE,mBAAmBH,YAAY,EAC/BI,sBAAsBD,gBAAgB,EAEtC,wBAAwB;AACxBE,SAASP,yBAAY,CAACQ,gBAAgB,EACtCC,QAAQ,CAAC,EACTC,aAAaH,MAAM,EACnBI,YAAYF,KAAK,EACjBG,eAAe,CAAC,EAChBC,mBAAmBD,YAAY,EAE/B,qBAAqB;AACrBE,iBAAiB,IAAI,EACrBC,cAAc,UAAU,EACxBC,UAAU,KAAK,EAChB;IACC,oBAAoB;IACpB,0FAA0F;IAC1F,0EAA0E;IAC1E,MAAMC,aAA2B;QAC/B,gEAAgE;QAChEC,IAAAA,4BAAa,EAAC;YAAEH;YAAahB,UAAUI;YAAcI;YAAQT;YAASkB;YAASP;QAAM;QACrFU,IAAAA,6BAAc,EAAC;YAAEC,WAAW;YAASL;YAAahB,UAAUI;YAAcI;YAAQE;QAAM;KACzF;IACD,+EAA+E;IAC/E,IAAIK,gBAAgB;QAClBG,WAAWI,IAAI,CAACC,IA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
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
sizeEnterAtom
|
|
12
|
+
get sizeEnterAtom () {
|
|
13
13
|
return sizeEnterAtom;
|
|
14
14
|
},
|
|
15
|
-
sizeExitAtom
|
|
15
|
+
get sizeExitAtom () {
|
|
16
16
|
return sizeExitAtom;
|
|
17
17
|
},
|
|
18
|
-
whitespaceAtom
|
|
18
|
+
get whitespaceAtom () {
|
|
19
19
|
return whitespaceAtom;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Collapse/collapse-atoms.ts"],"sourcesContent":["import type { AtomMotion, PresenceDirection } from '@fluentui/react-motion';\nimport type { 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 /** Size for the out state (collapsed). Defaults to '0'. */\n outSize?: string;\n delay?: number;\n}\n\nexport const sizeEnterAtom = ({\n orientation,\n duration,\n easing,\n element,\n outSize = '0',\n delay = 0,\n}: SizeEnterAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: outSize, [overflowName]: 'hidden' },\n { [sizeName]: toSize, offset: 0.9999, [overflowName]: 'hidden' },\n { [sizeName]: 'unset', [overflowName]: 'unset' },\n ],\n duration,\n easing,\n delay,\n fill: 'both',\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 outSize = '0',\n}: SizeExitAtomParams): AtomMotion => {\n const { sizeName, overflowName, toSize } = sizeValuesForOrientation(orientation, element);\n\n return {\n keyframes: [\n { [sizeName]: toSize, [overflowName]: 'hidden' },\n { [sizeName]: outSize, [overflowName]: 'hidden' },\n ],\n duration,\n easing,\n delay,\n fill: 'both',\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 return {\n keyframes,\n duration,\n easing,\n delay,\n fill: 'both',\n };\n};\n"],"names":["sizeEnterAtom","sizeExitAtom","whitespaceAtom","sizeValuesForOrientation","orientation","element","sizeName","overflowName","measuredSize","scrollWidth","scrollHeight","toSize","duration","easing","outSize","delay","keyframes","offset","fill","whitespaceValuesForOrientation","paddingStart","paddingEnd","marginStart","marginEnd","direction"],"mappings":";;;;;;;;;;;QAuBaA;eAAAA;;QA2BAC;eAAAA;;QAyDAC;eAAAA;;;AAxGb,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;AAYO,MAAMX,gBAAgB,CAAC,EAC5BI,WAAW,EACXQ,QAAQ,EACRC,MAAM,EACNR,OAAO,EACPS,UAAU,GAAG,EACbC,QAAQ,CAAC,EACW;IACpB,MAAM,EAAET,QAAQ,EAAEC,YAAY,EAAEI,MAAM,EAAE,GAAGR,yBAAyBC,aAAaC;IAEjF,OAAO;QACLW,WAAW;YACT;gBAAE,CAACV,SAAS,EAAEQ;gBAAS,CAACP,aAAa,EAAE;YAAS;YAChD;gBAAE,CAACD,SAAS,EAAEK;gBAAQM,QAAQ;gBAAQ,CAACV,aAAa,EAAE;YAAS;YAC/D;gBAAE,CAACD,SAAS,EAAE;gBAAS,CAACC,aAAa,EAAE;YAAQ;SAChD;QACDK;QACAC;QACAE;QACAG,MAAM;IACR;AACF;AAMO,MAAMjB,eAAe,CAAC,EAC3BG,WAAW,EACXQ,QAAQ,EACRC,MAAM,EACNR,OAAO,EACPU,QAAQ,CAAC,EACTD,UAAU,GAAG,EACM;IACnB,MAAM,EAAER,QAAQ,EAAEC,YAAY,EAAEI,MAAM,EAAE,GAAGR,yBAAyBC,aAAaC;IAEjF,OAAO;QACLW,WAAW;YACT;gBAAE,CAACV,SAAS,EAAEK;gBAAQ,CAACJ,aAAa,EAAE;YAAS;YAC/C;gBAAE,CAACD,SAAS,EAAEQ;gBAAS,CAACP,aAAa,EAAE;YAAS;SACjD;QACDK;QACAC;QACAE;QACAG,MAAM;IACR;AACF;AAEA,yBAAyB;AAEzB,oDAAoD;AACpD,MAAMC,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,EACNE,QAAQ,CAAC,EACY;IACrB,MAAM,EAAEK,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGJ,+BAA+Bf;IAC5F,uFAAuF;IACvF,MAAMa,SAASO,cAAc,UAAU,IAAI;IAC3C,MAAMR,YAAY;QAAC;YAAE,CAACI,aAAa,EAAE;YAAK,CAACC,WAAW,EAAE;YAAK,CAACC,YAAY,EAAE;YAAK,CAACC,UAAU,EAAE;YAAKN;QAAO;KAAE;IAE5G,OAAO;QACLD;QACAJ;QACAC;QACAE;QACAG,MAAM;IACR;AACF"}
|
|
@@ -5,29 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getCollapseDurationInfo
|
|
12
|
+
get getCollapseDurationInfo () {
|
|
13
13
|
return getCollapseDurationInfo;
|
|
14
14
|
},
|
|
15
|
-
getCollapseMotionValidation
|
|
15
|
+
get getCollapseMotionValidation () {
|
|
16
16
|
return getCollapseMotionValidation;
|
|
17
17
|
},
|
|
18
|
-
getCollapseOrientationInfo
|
|
18
|
+
get getCollapseOrientationInfo () {
|
|
19
19
|
return getCollapseOrientationInfo;
|
|
20
20
|
},
|
|
21
|
-
getCollapseTimingInfo
|
|
21
|
+
get getCollapseTimingInfo () {
|
|
22
22
|
return getCollapseTimingInfo;
|
|
23
23
|
},
|
|
24
|
-
getOpacityComparisonInfo
|
|
24
|
+
get getOpacityComparisonInfo () {
|
|
25
25
|
return getOpacityComparisonInfo;
|
|
26
26
|
},
|
|
27
|
-
getSizeAtomInfo
|
|
27
|
+
get getSizeAtomInfo () {
|
|
28
28
|
return getSizeAtomInfo;
|
|
29
29
|
},
|
|
30
|
-
getWhitespaceAtomInfo
|
|
30
|
+
get getWhitespaceAtomInfo () {
|
|
31
31
|
return getWhitespaceAtomInfo;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -52,21 +52,20 @@ function getCollapseMotionValidation(motion) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
function getCollapseTimingInfo(motion, animateOpacity = true) {
|
|
55
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
|
|
55
56
|
var _motion_enter_, _motion_enter_1, _motion_enter_2, _motion_exit_, _motion_exit_1, _motion_exit_2, _motion_exit_3, _motion_exit_4;
|
|
56
|
-
var _motion_enter__delay, _motion_enter__delay1, _motion_enter__delay2;
|
|
57
57
|
const enterDelays = {
|
|
58
|
-
size: (
|
|
59
|
-
whitespace: (
|
|
60
|
-
opacity: animateOpacity ? (
|
|
58
|
+
size: (_ref = (_motion_enter_ = motion.enter[0]) === null || _motion_enter_ === void 0 ? void 0 : _motion_enter_.delay) !== null && _ref !== void 0 ? _ref : 0,
|
|
59
|
+
whitespace: (_ref1 = (_motion_enter_1 = motion.enter[1]) === null || _motion_enter_1 === void 0 ? void 0 : _motion_enter_1.delay) !== null && _ref1 !== void 0 ? _ref1 : 0,
|
|
60
|
+
opacity: animateOpacity ? (_ref2 = (_motion_enter_2 = motion.enter[2]) === null || _motion_enter_2 === void 0 ? void 0 : _motion_enter_2.delay) !== null && _ref2 !== void 0 ? _ref2 : 0 : undefined
|
|
61
61
|
};
|
|
62
|
-
var _motion_exit__delay, _motion_exit__delay1, _motion_exit__delay2, _motion_exit__delay3, _motion_exit__delay4;
|
|
63
62
|
const exitDelays = animateOpacity ? {
|
|
64
|
-
opacity: (
|
|
65
|
-
size: (
|
|
66
|
-
whitespace: (
|
|
63
|
+
opacity: (_ref3 = (_motion_exit_ = motion.exit[0]) === null || _motion_exit_ === void 0 ? void 0 : _motion_exit_.delay) !== null && _ref3 !== void 0 ? _ref3 : 0,
|
|
64
|
+
size: (_ref4 = (_motion_exit_1 = motion.exit[1]) === null || _motion_exit_1 === void 0 ? void 0 : _motion_exit_1.delay) !== null && _ref4 !== void 0 ? _ref4 : 0,
|
|
65
|
+
whitespace: (_ref5 = (_motion_exit_2 = motion.exit[2]) === null || _motion_exit_2 === void 0 ? void 0 : _motion_exit_2.delay) !== null && _ref5 !== void 0 ? _ref5 : 0
|
|
67
66
|
} : {
|
|
68
|
-
size: (
|
|
69
|
-
whitespace: (
|
|
67
|
+
size: (_ref6 = (_motion_exit_3 = motion.exit[0]) === null || _motion_exit_3 === void 0 ? void 0 : _motion_exit_3.delay) !== null && _ref6 !== void 0 ? _ref6 : 0,
|
|
68
|
+
whitespace: (_ref7 = (_motion_exit_4 = motion.exit[1]) === null || _motion_exit_4 === void 0 ? void 0 : _motion_exit_4.delay) !== null && _ref7 !== void 0 ? _ref7 : 0
|
|
70
69
|
};
|
|
71
70
|
return {
|
|
72
71
|
enter: enterDelays,
|
|
@@ -74,21 +73,20 @@ function getCollapseTimingInfo(motion, animateOpacity = true) {
|
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
75
|
function getCollapseDurationInfo(motion, animateOpacity = true) {
|
|
76
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
|
|
77
77
|
var _motion_enter_, _motion_enter_1, _motion_enter_2, _motion_exit_, _motion_exit_1, _motion_exit_2, _motion_exit_3, _motion_exit_4;
|
|
78
|
-
var _motion_enter__duration, _motion_enter__duration1, _motion_enter__duration2;
|
|
79
78
|
const enterDurations = {
|
|
80
|
-
size: (
|
|
81
|
-
whitespace: (
|
|
82
|
-
opacity: animateOpacity ? (
|
|
79
|
+
size: (_ref = (_motion_enter_ = motion.enter[0]) === null || _motion_enter_ === void 0 ? void 0 : _motion_enter_.duration) !== null && _ref !== void 0 ? _ref : 0,
|
|
80
|
+
whitespace: (_ref1 = (_motion_enter_1 = motion.enter[1]) === null || _motion_enter_1 === void 0 ? void 0 : _motion_enter_1.duration) !== null && _ref1 !== void 0 ? _ref1 : 0,
|
|
81
|
+
opacity: animateOpacity ? (_ref2 = (_motion_enter_2 = motion.enter[2]) === null || _motion_enter_2 === void 0 ? void 0 : _motion_enter_2.duration) !== null && _ref2 !== void 0 ? _ref2 : 0 : undefined
|
|
83
82
|
};
|
|
84
|
-
var _motion_exit__duration, _motion_exit__duration1, _motion_exit__duration2, _motion_exit__duration3, _motion_exit__duration4;
|
|
85
83
|
const exitDurations = animateOpacity ? {
|
|
86
|
-
opacity: (
|
|
87
|
-
size: (
|
|
88
|
-
whitespace: (
|
|
84
|
+
opacity: (_ref3 = (_motion_exit_ = motion.exit[0]) === null || _motion_exit_ === void 0 ? void 0 : _motion_exit_.duration) !== null && _ref3 !== void 0 ? _ref3 : 0,
|
|
85
|
+
size: (_ref4 = (_motion_exit_1 = motion.exit[1]) === null || _motion_exit_1 === void 0 ? void 0 : _motion_exit_1.duration) !== null && _ref4 !== void 0 ? _ref4 : 0,
|
|
86
|
+
whitespace: (_ref5 = (_motion_exit_2 = motion.exit[2]) === null || _motion_exit_2 === void 0 ? void 0 : _motion_exit_2.duration) !== null && _ref5 !== void 0 ? _ref5 : 0
|
|
89
87
|
} : {
|
|
90
|
-
size: (
|
|
91
|
-
whitespace: (
|
|
88
|
+
size: (_ref6 = (_motion_exit_3 = motion.exit[0]) === null || _motion_exit_3 === void 0 ? void 0 : _motion_exit_3.duration) !== null && _ref6 !== void 0 ? _ref6 : 0,
|
|
89
|
+
whitespace: (_ref7 = (_motion_exit_4 = motion.exit[1]) === null || _motion_exit_4 === void 0 ? void 0 : _motion_exit_4.duration) !== null && _ref7 !== void 0 ? _ref7 : 0
|
|
92
90
|
};
|
|
93
91
|
return {
|
|
94
92
|
enter: enterDurations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Collapse/collapse-test-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { AtomMotion } from '@fluentui/react-motion';\n\n/**\n * Collapse-specific test utilities for validating motion structure and behavior.\n * These utilities are meant to be used within Jest test files.\n */\n\nexport interface CollapseMotionCounts {\n enter: number;\n exit: number;\n}\n\nexport interface CollapseTimingExpectations {\n enter: { size: number; whitespace: number; opacity?: number };\n exit: { opacity?: number; size: number; whitespace: number };\n}\n\nexport interface CollapseDurationExpectations {\n enter: { size: number; whitespace: number; opacity?: number };\n exit: { opacity?: number; size: number; whitespace: number };\n}\n\n/**\n * Helper to validate the structure of a collapse motion object.\n * Returns validation data that can be used with Jest expectations.\n */\nexport function getCollapseMotionValidation(motion: { enter: AtomMotion[]; exit: AtomMotion[] }) {\n return {\n enterCount: motion.enter.length,\n exitCount: motion.exit.length,\n hasEnterOpacity: motion.enter.length === 3 && 'opacity' in (motion.enter[2].keyframes[0] || {}),\n hasExitOpacity: motion.exit.length === 3 && 'opacity' in (motion.exit[0].keyframes[0] || {}),\n enterStructure: motion.enter.map(atom => ({\n hasKeyframes: Array.isArray(atom.keyframes),\n hasDuration: typeof atom.duration === 'number',\n hasEasing: typeof atom.easing === 'string',\n hasDelay: typeof atom.delay === 'number',\n })),\n exitStructure: motion.exit.map(atom => ({\n hasKeyframes: Array.isArray(atom.keyframes),\n hasDuration: typeof atom.duration === 'number',\n hasEasing: typeof atom.easing === 'string',\n hasDelay: typeof atom.delay === 'number',\n })),\n };\n}\n\n/**\n * Helper to extract timing information from collapse motion atoms.\n */\nexport function getCollapseTimingInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterDelays = {\n size: motion.enter[0]?.delay ?? 0,\n whitespace: motion.enter[1]?.delay ?? 0,\n opacity: animateOpacity ? motion.enter[2]?.delay ?? 0 : undefined,\n };\n\n const exitDelays = animateOpacity\n ? {\n opacity: motion.exit[0]?.delay ?? 0,\n size: motion.exit[1]?.delay ?? 0,\n whitespace: motion.exit[2]?.delay ?? 0,\n }\n : {\n size: motion.exit[0]?.delay ?? 0,\n whitespace: motion.exit[1]?.delay ?? 0,\n };\n\n return { enter: enterDelays, exit: exitDelays };\n}\n\n/**\n * Helper to extract duration information from collapse motion atoms.\n */\nexport function getCollapseDurationInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterDurations = {\n size: motion.enter[0]?.duration ?? 0,\n whitespace: motion.enter[1]?.duration ?? 0,\n opacity: animateOpacity ? motion.enter[2]?.duration ?? 0 : undefined,\n };\n\n const exitDurations = animateOpacity\n ? {\n opacity: motion.exit[0]?.duration ?? 0,\n size: motion.exit[1]?.duration ?? 0,\n whitespace: motion.exit[2]?.duration ?? 0,\n }\n : {\n size: motion.exit[0]?.duration ?? 0,\n whitespace: motion.exit[1]?.duration ?? 0,\n };\n\n return { enter: enterDurations, exit: exitDurations };\n}\n\n/**\n * Helper to analyze orientation-specific properties in collapse atoms.\n */\nexport function getCollapseOrientationInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterSizeAtom = motion.enter[0];\n const enterWhitespaceAtom = motion.enter[1];\n\n const exitOffset = animateOpacity ? 1 : 0;\n const exitSizeAtom = motion.exit[exitOffset];\n const exitWhitespaceAtom = motion.exit[exitOffset + 1];\n\n return {\n enter: {\n sizeProperties: Object.keys(enterSizeAtom?.keyframes[0] || {}),\n whitespaceProperties: Object.keys(enterWhitespaceAtom?.keyframes[0] || {}),\n },\n exit: {\n sizeProperties: Object.keys(exitSizeAtom?.keyframes[0] || {}),\n whitespaceProperties: Object.keys(exitWhitespaceAtom?.keyframes[0] || {}),\n },\n };\n}\n\n/**\n * Helper to analyze size atom keyframes for validation.\n */\nexport function getSizeAtomInfo(sizeAtom: AtomMotion, direction: 'enter' | 'exit') {\n const keyframes = sizeAtom.keyframes;\n const properties = Object.keys(keyframes[0] || {});\n\n return {\n keyframeCount: keyframes.length,\n properties,\n hasOffset: direction === 'enter' ? 'offset' in (keyframes[1] || {}) : false,\n hasFill: 'fill' in sizeAtom,\n fillValue: sizeAtom.fill,\n firstFrameValues: keyframes[0] || {},\n lastFrameValues: keyframes[keyframes.length - 1] || {},\n };\n}\n\n/**\n * Helper to analyze whitespace atom keyframes for validation.\n */\nexport function getWhitespaceAtomInfo(whitespaceAtom: AtomMotion, direction: 'enter' | 'exit') {\n const keyframe = whitespaceAtom.keyframes[0] || {};\n\n return {\n properties: Object.keys(keyframe),\n offset: keyframe.offset,\n expectedOffset: direction === 'enter' ? 0 : 1,\n hasFill: 'fill' in whitespaceAtom,\n fillValue: whitespaceAtom.fill,\n isVertical: 'paddingBlockStart' in keyframe,\n isHorizontal: 'paddingInlineStart' in keyframe,\n };\n}\n\n/**\n * Helper to compare opacity handling between two motion objects.\n */\nexport function getOpacityComparisonInfo(\n withOpacity: { enter: AtomMotion[]; exit: AtomMotion[] },\n withoutOpacity: { enter: AtomMotion[]; exit: AtomMotion[] },\n) {\n return {\n withOpacity: {\n enterCount: withOpacity.enter.length,\n exitCount: withOpacity.exit.length,\n hasEnterOpacity: withOpacity.enter.length === 3,\n hasExitOpacity: withOpacity.exit.length === 3,\n },\n withoutOpacity: {\n enterCount: withoutOpacity.enter.length,\n exitCount: withoutOpacity.exit.length,\n hasEnterOpacity: false,\n hasExitOpacity: false,\n },\n };\n}\n"],"names":["getCollapseDurationInfo","getCollapseMotionValidation","getCollapseOrientationInfo","getCollapseTimingInfo","getOpacityComparisonInfo","getSizeAtomInfo","getWhitespaceAtomInfo","motion","enterCount","enter","length","exitCount","exit","hasEnterOpacity","keyframes","hasExitOpacity","enterStructure","map","atom","hasKeyframes","Array","isArray","hasDuration","duration","hasEasing","easing","hasDelay","delay","exitStructure","animateOpacity","enterDelays","size","whitespace","opacity","undefined","exitDelays","enterDurations","exitDurations","enterSizeAtom","enterWhitespaceAtom","exitOffset","exitSizeAtom","exitWhitespaceAtom","sizeProperties","Object","keys","whitespaceProperties","sizeAtom","direction","properties","keyframeCount","hasOffset","hasFill","fillValue","fill","firstFrameValues","lastFrameValues","whitespaceAtom","keyframe","offset","expectedOffset","isVertical","isHorizontal","withOpacity","withoutOpacity"],"mappings":"AAAA,oEAAoE;;;;;;;;;;;IA+EpDA,uBAAuB;eAAvBA;;IAnDAC,2BAA2B;eAA3BA;;IA8EAC,0BAA0B;eAA1BA;;IAtDAC,qBAAqB;eAArBA;;IAmHAC,wBAAwB;eAAxBA;;IAnCAC,eAAe;eAAfA;;IAkBAC,qBAAqB;eAArBA;;;AA1HT,SAASL,4BAA4BM,MAAmD;IAC7F,OAAO;QACLC,YAAYD,OAAOE,KAAK,CAACC,MAAM;QAC/BC,WAAWJ,OAAOK,IAAI,CAACF,MAAM;QAC7BG,iBAAiBN,OAAOE,KAAK,CAACC,MAAM,KAAK,KAAK,aAAcH,CAAAA,OAAOE,KAAK,CAAC,EAAE,CAACK,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;QAC7FC,gBAAgBR,OAAOK,IAAI,CAACF,MAAM,KAAK,KAAK,aA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F,MAAM;YAClCG,iBAAiBkD,YAAYtD,KAAK,CAACC,MAAM,KAAK;YAC9CK,gBAAgBgD,YAAYnD,IAAI,CAACF,MAAM,KAAK;QAC9C;QACAsD,gBAAgB;YACdxD,YAAYwD,eAAevD,KAAK,CAACC,MAAM;YACvCC,WAAWqD,eAAepD,IAAI,CAACF,MAAM;YACrCG,iBAAiB;YACjBE,gBAAgB;QAClB;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Collapse/collapse-test-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { AtomMotion } from '@fluentui/react-motion';\n\n/**\n * Collapse-specific test utilities for validating motion structure and behavior.\n * These utilities are meant to be used within Jest test files.\n */\n\nexport interface CollapseMotionCounts {\n enter: number;\n exit: number;\n}\n\nexport interface CollapseTimingExpectations {\n enter: { size: number; whitespace: number; opacity?: number };\n exit: { opacity?: number; size: number; whitespace: number };\n}\n\nexport interface CollapseDurationExpectations {\n enter: { size: number; whitespace: number; opacity?: number };\n exit: { opacity?: number; size: number; whitespace: number };\n}\n\n/**\n * Helper to validate the structure of a collapse motion object.\n * Returns validation data that can be used with Jest expectations.\n */\nexport function getCollapseMotionValidation(motion: { enter: AtomMotion[]; exit: AtomMotion[] }) {\n return {\n enterCount: motion.enter.length,\n exitCount: motion.exit.length,\n hasEnterOpacity: motion.enter.length === 3 && 'opacity' in (motion.enter[2].keyframes[0] || {}),\n hasExitOpacity: motion.exit.length === 3 && 'opacity' in (motion.exit[0].keyframes[0] || {}),\n enterStructure: motion.enter.map(atom => ({\n hasKeyframes: Array.isArray(atom.keyframes),\n hasDuration: typeof atom.duration === 'number',\n hasEasing: typeof atom.easing === 'string',\n hasDelay: typeof atom.delay === 'number',\n })),\n exitStructure: motion.exit.map(atom => ({\n hasKeyframes: Array.isArray(atom.keyframes),\n hasDuration: typeof atom.duration === 'number',\n hasEasing: typeof atom.easing === 'string',\n hasDelay: typeof atom.delay === 'number',\n })),\n };\n}\n\n/**\n * Helper to extract timing information from collapse motion atoms.\n */\nexport function getCollapseTimingInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterDelays = {\n size: motion.enter[0]?.delay ?? 0,\n whitespace: motion.enter[1]?.delay ?? 0,\n opacity: animateOpacity ? motion.enter[2]?.delay ?? 0 : undefined,\n };\n\n const exitDelays = animateOpacity\n ? {\n opacity: motion.exit[0]?.delay ?? 0,\n size: motion.exit[1]?.delay ?? 0,\n whitespace: motion.exit[2]?.delay ?? 0,\n }\n : {\n size: motion.exit[0]?.delay ?? 0,\n whitespace: motion.exit[1]?.delay ?? 0,\n };\n\n return { enter: enterDelays, exit: exitDelays };\n}\n\n/**\n * Helper to extract duration information from collapse motion atoms.\n */\nexport function getCollapseDurationInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterDurations = {\n size: motion.enter[0]?.duration ?? 0,\n whitespace: motion.enter[1]?.duration ?? 0,\n opacity: animateOpacity ? motion.enter[2]?.duration ?? 0 : undefined,\n };\n\n const exitDurations = animateOpacity\n ? {\n opacity: motion.exit[0]?.duration ?? 0,\n size: motion.exit[1]?.duration ?? 0,\n whitespace: motion.exit[2]?.duration ?? 0,\n }\n : {\n size: motion.exit[0]?.duration ?? 0,\n whitespace: motion.exit[1]?.duration ?? 0,\n };\n\n return { enter: enterDurations, exit: exitDurations };\n}\n\n/**\n * Helper to analyze orientation-specific properties in collapse atoms.\n */\nexport function getCollapseOrientationInfo(\n motion: { enter: AtomMotion[]; exit: AtomMotion[] },\n animateOpacity: boolean = true,\n) {\n const enterSizeAtom = motion.enter[0];\n const enterWhitespaceAtom = motion.enter[1];\n\n const exitOffset = animateOpacity ? 1 : 0;\n const exitSizeAtom = motion.exit[exitOffset];\n const exitWhitespaceAtom = motion.exit[exitOffset + 1];\n\n return {\n enter: {\n sizeProperties: Object.keys(enterSizeAtom?.keyframes[0] || {}),\n whitespaceProperties: Object.keys(enterWhitespaceAtom?.keyframes[0] || {}),\n },\n exit: {\n sizeProperties: Object.keys(exitSizeAtom?.keyframes[0] || {}),\n whitespaceProperties: Object.keys(exitWhitespaceAtom?.keyframes[0] || {}),\n },\n };\n}\n\n/**\n * Helper to analyze size atom keyframes for validation.\n */\nexport function getSizeAtomInfo(sizeAtom: AtomMotion, direction: 'enter' | 'exit') {\n const keyframes = sizeAtom.keyframes;\n const properties = Object.keys(keyframes[0] || {});\n\n return {\n keyframeCount: keyframes.length,\n properties,\n hasOffset: direction === 'enter' ? 'offset' in (keyframes[1] || {}) : false,\n hasFill: 'fill' in sizeAtom,\n fillValue: sizeAtom.fill,\n firstFrameValues: keyframes[0] || {},\n lastFrameValues: keyframes[keyframes.length - 1] || {},\n };\n}\n\n/**\n * Helper to analyze whitespace atom keyframes for validation.\n */\nexport function getWhitespaceAtomInfo(whitespaceAtom: AtomMotion, direction: 'enter' | 'exit') {\n const keyframe = whitespaceAtom.keyframes[0] || {};\n\n return {\n properties: Object.keys(keyframe),\n offset: keyframe.offset,\n expectedOffset: direction === 'enter' ? 0 : 1,\n hasFill: 'fill' in whitespaceAtom,\n fillValue: whitespaceAtom.fill,\n isVertical: 'paddingBlockStart' in keyframe,\n isHorizontal: 'paddingInlineStart' in keyframe,\n };\n}\n\n/**\n * Helper to compare opacity handling between two motion objects.\n */\nexport function getOpacityComparisonInfo(\n withOpacity: { enter: AtomMotion[]; exit: AtomMotion[] },\n withoutOpacity: { enter: AtomMotion[]; exit: AtomMotion[] },\n) {\n return {\n withOpacity: {\n enterCount: withOpacity.enter.length,\n exitCount: withOpacity.exit.length,\n hasEnterOpacity: withOpacity.enter.length === 3,\n hasExitOpacity: withOpacity.exit.length === 3,\n },\n withoutOpacity: {\n enterCount: withoutOpacity.enter.length,\n exitCount: withoutOpacity.exit.length,\n hasEnterOpacity: false,\n hasExitOpacity: false,\n },\n };\n}\n"],"names":["getCollapseDurationInfo","getCollapseMotionValidation","getCollapseOrientationInfo","getCollapseTimingInfo","getOpacityComparisonInfo","getSizeAtomInfo","getWhitespaceAtomInfo","motion","enterCount","enter","length","exitCount","exit","hasEnterOpacity","keyframes","hasExitOpacity","enterStructure","map","atom","hasKeyframes","Array","isArray","hasDuration","duration","hasEasing","easing","hasDelay","delay","exitStructure","animateOpacity","enterDelays","size","whitespace","opacity","undefined","exitDelays","enterDurations","exitDurations","enterSizeAtom","enterWhitespaceAtom","exitOffset","exitSizeAtom","exitWhitespaceAtom","sizeProperties","Object","keys","whitespaceProperties","sizeAtom","direction","properties","keyframeCount","hasOffset","hasFill","fillValue","fill","firstFrameValues","lastFrameValues","whitespaceAtom","keyframe","offset","expectedOffset","isVertical","isHorizontal","withOpacity","withoutOpacity"],"mappings":"AAAA,oEAAoE;;;;;;;;;;;QA+EpDA;eAAAA;;QAnDAC;eAAAA;;QA8EAC;eAAAA;;QAtDAC;eAAAA;;QAmHAC;eAAAA;;QAnCAC;eAAAA;;QAkBAC;eAAAA;;;AA1HT,SAASL,4BAA4BM,MAAmD;IAC7F,OAAO;QACLC,YAAYD,OAAOE,KAAK,CAACC,MAAM;QAC/BC,WAAWJ,OAAOK,IAAI,CAACF,MAAM;QAC7BG,iBAAiBN,OAAOE,KAAK,CAACC,MAAM,KAAK,KAAK,aAAcH,CAAAA,OAAOE,KAAK,CAAC,EAAE,CAACK,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;QAC7FC,gBAAgBR,OAAOK,IAAI,CAACF,MAAM,KAAK,KAAK,aAAcH,CAAAA,OAAOK,IAAI,CAAC,EAAE,CAACE,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;QAC1FE,gBAAgBT,OAAOE,KAAK,CAACQ,GAAG,CAACC,CAAAA,OAAS,CAAA;gBACxCC,cAAcC,MAAMC,OAAO,CAACH,KAAKJ,SAAS;gBAC1CQ,aAAa,OAAOJ,KAAKK,QAAQ,KAAK;gBACtCC,WAAW,OAAON,KAAKO,MAAM,KAAK;gBAClCC,UAAU,O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CAACa;QACxBC,QAAQD,SAASC,MAAM;QACvBC,gBAAgBZ,cAAc,UAAU,IAAI;QAC5CI,SAAS,UAAUK;QACnBJ,WAAWI,eAAeH,IAAI;QAC9BO,YAAY,uBAAuBH;QACnCI,cAAc,wBAAwBJ;IACxC;AACF;AAKO,SAAStD,yBACd2D,WAAwD,EACxDC,cAA2D;IAE3D,OAAO;QACLD,aAAa;YACXvD,YAAYuD,YAAYtD,KAAK,CAACC,MAAM;YACpCC,WAAWoD,YAAYnD,IAAI,CAACF,MAAM;YAClCG,iBAAiBkD,YAAYtD,KAAK,CAACC,MAAM,KAAK;YAC9CK,gBAAgBgD,YAAYnD,IAAI,CAACF,MAAM,KAAK;QAC9C;QACAsD,gBAAgB;YACdxD,YAAYwD,eAAevD,KAAK,CAACC,MAAM;YACvCC,WAAWqD,eAAepD,IAAI,CAACF,MAAM;YACrCG,iBAAiB;YACjBE,gBAAgB;QAClB;IACF;AACF"}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Collapse
|
|
12
|
+
get Collapse () {
|
|
13
13
|
return _Collapse.Collapse;
|
|
14
14
|
},
|
|
15
|
-
CollapseDelayed
|
|
15
|
+
get CollapseDelayed () {
|
|
16
16
|
return _Collapse.CollapseDelayed;
|
|
17
17
|
},
|
|
18
|
-
CollapseRelaxed
|
|
18
|
+
get CollapseRelaxed () {
|
|
19
19
|
return _Collapse.CollapseRelaxed;
|
|
20
20
|
},
|
|
21
|
-
CollapseSnappy
|
|
21
|
+
get CollapseSnappy () {
|
|
22
22
|
return _Collapse.CollapseSnappy;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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":";;;;;;;;;;;QAASA;eAAAA,kBAAQ;;QAAEC;eAAAA,yBAAe;;QAAEC;eAAAA,yBAAe;;QAAEC;eAAAA,wBAAc;;;0BAAQ"}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Fade
|
|
12
|
+
get Fade () {
|
|
13
13
|
return Fade;
|
|
14
14
|
},
|
|
15
|
-
FadeRelaxed
|
|
15
|
+
get FadeRelaxed () {
|
|
16
16
|
return FadeRelaxed;
|
|
17
17
|
},
|
|
18
|
-
FadeSnappy
|
|
18
|
+
get FadeSnappy () {
|
|
19
19
|
return FadeSnappy;
|
|
20
20
|
},
|
|
21
|
-
fadePresenceFn
|
|
21
|
+
get fadePresenceFn () {
|
|
22
22
|
return fadePresenceFn;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Fade/Fade.ts"],"sourcesContent":["import type { PresenceMotionFn } from '@fluentui/react-motion';\nimport { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport type { 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":";;;;;;;;;;;QAyCaA;eAAAA;;QAIAC;eAAAA;;QAFAC;eAAAA;;QA1BAC;eAAAA;;;6BAhByE;0BAC7D;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"}
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Fade
|
|
12
|
+
get Fade () {
|
|
13
13
|
return _Fade.Fade;
|
|
14
14
|
},
|
|
15
|
-
FadeRelaxed
|
|
15
|
+
get FadeRelaxed () {
|
|
16
16
|
return _Fade.FadeRelaxed;
|
|
17
17
|
},
|
|
18
|
-
FadeSnappy
|
|
18
|
+
get FadeSnappy () {
|
|
19
19
|
return _Fade.FadeSnappy;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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":";;;;;;;;;;;QAASA;eAAAA,UAAI;;QAAEC;eAAAA,iBAAW;;QAAEC;eAAAA,gBAAU;;;sBAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Rotate/Rotate.ts"],"sourcesContent":["import type { AtomMotion, PresenceMotionFn } from '@fluentui/react-motion';\nimport { createPresenceComponent, motionTokens } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { rotateAtom } from '../../atoms/rotate-atom';\nimport type { 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":";;;;+BAoEaA;;;eAAAA;;;6BAnEyC;0BAC7B;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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"}
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Scale
|
|
12
|
+
get Scale () {
|
|
13
13
|
return Scale;
|
|
14
14
|
},
|
|
15
|
-
ScaleRelaxed
|
|
15
|
+
get ScaleRelaxed () {
|
|
16
16
|
return ScaleRelaxed;
|
|
17
17
|
},
|
|
18
|
-
ScaleSnappy
|
|
18
|
+
get ScaleSnappy () {
|
|
19
19
|
return ScaleSnappy;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Scale/Scale.ts"],"sourcesContent":["import type { PresenceMotionFn } from '@fluentui/react-motion';\nimport { motionTokens, createPresenceComponent, createPresenceComponentVariant } from '@fluentui/react-motion';\nimport { fadeAtom } from '../../atoms/fade-atom';\nimport { scaleAtom } from '../../atoms/scale-atom';\nimport type { 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":";;;;;;;;;;;QAuDaA;eAAAA;;QAOAC;eAAAA;;QALAC;eAAAA;;;6BAxDyE;0BAC7D;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,MAA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