framer-motion 6.1.0 → 6.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-motion",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "A simple and powerful React animation library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -71,32 +71,32 @@
71
71
  "bundlesize": [
72
72
  {
73
73
  "path": "./dist/framer-motion.js",
74
- "maxSize": "35.3 kB"
74
+ "maxSize": "35.5 kB"
75
75
  },
76
76
  {
77
77
  "path": "./dist/size-rollup-m.js",
78
- "maxSize": "6.1 kB"
78
+ "maxSize": "6.4 kB"
79
79
  },
80
80
  {
81
81
  "path": "./dist/size-rollup-dom-animation.js",
82
- "maxSize": "16.95 kB"
82
+ "maxSize": "17 kB"
83
83
  },
84
84
  {
85
85
  "path": "./dist/size-rollup-dom-max.js",
86
- "maxSize": "28 kB"
86
+ "maxSize": "28.1 kB"
87
87
  },
88
88
  {
89
89
  "path": "./dist/size-webpack-m.js",
90
- "maxSize": "6.4 kB"
90
+ "maxSize": "6.7 kB"
91
91
  },
92
92
  {
93
93
  "path": "./dist/size-webpack-dom-animation.js",
94
- "maxSize": "19.4 kB"
94
+ "maxSize": "19.5 kB"
95
95
  },
96
96
  {
97
97
  "path": "./dist/size-webpack-dom-max.js",
98
98
  "maxSize": "31.5 kB"
99
99
  }
100
100
  ],
101
- "gitHead": "16034a645d20f5d5cffd059cb11ce852235cadef"
101
+ "gitHead": "fef9ea7beab4157a29926cafa9399b99e12ba83b"
102
102
  }
@@ -22,6 +22,13 @@ export interface MotionConfigContext {
22
22
  * @public
23
23
  */
24
24
  transition?: Transition;
25
+ /**
26
+ * If true, will respect the device prefersReducedMotion setting by switching
27
+ * transform animations off.
28
+ *
29
+ * @public
30
+ */
31
+ reducedMotion?: "always" | "never" | "user";
25
32
  }
26
33
  /**
27
34
  * @public
@@ -3,4 +3,4 @@ import { VisualElementConfig } from "../types";
3
3
  import { DOMVisualElementOptions } from "../dom/types";
4
4
  export declare function getComputedStyle(element: HTMLElement): CSSStyleDeclaration;
5
5
  export declare const htmlConfig: VisualElementConfig<HTMLElement, HTMLRenderState, DOMVisualElementOptions>;
6
- export declare const htmlVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, }: import("../types").VisualElementOptions<HTMLElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<HTMLElement, any>;
6
+ export declare const htmlVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: import("../types").VisualElementOptions<HTMLElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<HTMLElement, any>;
@@ -1,2 +1,2 @@
1
1
  import { VisualElement, VisualElementConfig, VisualElementOptions } from "./types";
2
- export declare const visualElement: <Instance, MutableState, Options>({ treeType, build, getBaseTarget, makeTargetAnimatable, measureViewportBox, render: renderInstance, readValueFromInstance, removeValueFromRenderState, sortNodePosition, scrapeMotionValuesFromProps, }: VisualElementConfig<Instance, MutableState, Options>) => ({ parent, props, presenceId, blockInitialAnimation, visualState, }: VisualElementOptions<Instance, any>, options?: Options) => VisualElement<Instance, any>;
2
+ export declare const visualElement: <Instance, MutableState, Options>({ treeType, build, getBaseTarget, makeTargetAnimatable, measureViewportBox, render: renderInstance, readValueFromInstance, removeValueFromRenderState, sortNodePosition, scrapeMotionValuesFromProps, }: VisualElementConfig<Instance, MutableState, Options>) => ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: VisualElementOptions<Instance, any>, options?: Options) => VisualElement<Instance, any>;
@@ -1,2 +1,2 @@
1
1
  import { DOMVisualElementOptions } from "../dom/types";
2
- export declare const svgVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, }: import("../types").VisualElementOptions<SVGElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<SVGElement, any>;
2
+ export declare const svgVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: import("../types").VisualElementOptions<SVGElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<SVGElement, any>;
@@ -32,6 +32,7 @@ export interface VisualElement<Instance = any, RenderState = any> extends Lifecy
32
32
  measureViewportBox(withTransform?: boolean): Box;
33
33
  addVariantChild(child: VisualElement): undefined | (() => void);
34
34
  getClosestVariantNode(): VisualElement | undefined;
35
+ shouldReduceMotion?: boolean | null;
35
36
  animateMotionValue?: typeof startAnimation;
36
37
  projection?: IProjectionNode;
37
38
  /**
@@ -101,6 +102,7 @@ export declare type VisualElementOptions<Instance, RenderState = any> = {
101
102
  presenceId?: number | undefined;
102
103
  props: MotionProps;
103
104
  blockInitialAnimation?: boolean;
105
+ shouldReduceMotion?: boolean | null;
104
106
  };
105
107
  export declare type CreateVisualElement<Instance> = (Component: string | React.ComponentType, options: VisualElementOptions<Instance>) => VisualElement<Instance>;
106
108
  /**
@@ -25,3 +25,4 @@
25
25
  * @public
26
26
  */
27
27
  export declare function useReducedMotion(): boolean | null;
28
+ export declare function useReducedMotionConfig(): boolean | null;