framer-motion 12.35.2 → 12.37.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.
Files changed (49) hide show
  1. package/README.md +12 -15
  2. package/dist/cjs/client.js +1 -1
  3. package/dist/cjs/dom.js +38 -6
  4. package/dist/cjs/dom.js.map +1 -1
  5. package/dist/cjs/{feature-bundle-DqHxNjy5.js → feature-bundle-CBfLWgGA.js} +47 -6
  6. package/dist/cjs/feature-bundle-CBfLWgGA.js.map +1 -0
  7. package/dist/cjs/index.js +41 -8
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/m.js +7 -1
  10. package/dist/cjs/m.js.map +1 -1
  11. package/dist/dom-mini.js +1 -1
  12. package/dist/dom.js +1 -1
  13. package/dist/es/components/AnimatePresence/PopChild.mjs +1 -0
  14. package/dist/es/components/AnimatePresence/PopChild.mjs.map +1 -1
  15. package/dist/es/components/AnimatePresence/index.mjs +1 -1
  16. package/dist/es/components/AnimatePresence/index.mjs.map +1 -1
  17. package/dist/es/gestures/drag/VisualElementDragControls.mjs +2 -1
  18. package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -1
  19. package/dist/es/gestures/pan/PanSession.mjs.map +1 -1
  20. package/dist/es/motion/features/animation/exit.mjs +31 -1
  21. package/dist/es/motion/features/animation/exit.mjs.map +1 -1
  22. package/dist/es/motion/features/viewport/index.mjs +7 -3
  23. package/dist/es/motion/features/viewport/index.mjs.map +1 -1
  24. package/dist/es/render/dom/scroll/utils/offset-to-range.mjs +38 -6
  25. package/dist/es/render/dom/scroll/utils/offset-to-range.mjs.map +1 -1
  26. package/dist/es/render/dom/utils/filter-props.mjs +8 -1
  27. package/dist/es/render/dom/utils/filter-props.mjs.map +1 -1
  28. package/dist/es/value/use-spring.mjs.map +1 -1
  29. package/dist/framer-motion.dev.js +272 -88
  30. package/dist/framer-motion.js +1 -1
  31. package/dist/mini.js +1 -1
  32. package/dist/size-rollup-animate.js +1 -1
  33. package/dist/size-rollup-animate.js.map +1 -1
  34. package/dist/size-rollup-dom-animation-assets.js +1 -1
  35. package/dist/size-rollup-dom-animation-m.js +1 -1
  36. package/dist/size-rollup-dom-animation.js +1 -1
  37. package/dist/size-rollup-dom-max-assets.js +1 -1
  38. package/dist/size-rollup-dom-max.js +1 -1
  39. package/dist/size-rollup-m.js +1 -1
  40. package/dist/size-rollup-m.js.map +1 -1
  41. package/dist/size-rollup-motion.js +1 -1
  42. package/dist/size-rollup-motion.js.map +1 -1
  43. package/dist/size-rollup-scroll.js +1 -1
  44. package/dist/size-rollup-scroll.js.map +1 -1
  45. package/dist/size-rollup-waapi-animate.js +1 -1
  46. package/dist/size-rollup-waapi-animate.js.map +1 -1
  47. package/dist/types/index.d.ts +5 -4
  48. package/package.json +4 -4
  49. package/dist/cjs/feature-bundle-DqHxNjy5.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"offset-to-range.mjs","sources":["../../../../../../src/render/dom/scroll/utils/offset-to-range.ts"],"sourcesContent":["import { ScrollOffset as ScrollOffsetPresets } from \"../offsets/presets\"\nimport { ProgressIntersection, ScrollOffset } from \"../types\"\n\ninterface ViewTimelineRange {\n rangeStart: string\n rangeEnd: string\n}\n\n/**\n * Maps from ProgressIntersection pairs used by Motion's preset offsets to\n * ViewTimeline named ranges. Returns undefined for unrecognised patterns,\n * which signals the caller to fall back to JS-based scroll tracking.\n */\nconst presets: [ProgressIntersection[], string][] = [\n [ScrollOffsetPresets.Enter, \"entry\"],\n [ScrollOffsetPresets.Exit, \"exit\"],\n [ScrollOffsetPresets.Any, \"cover\"],\n [ScrollOffsetPresets.All, \"contain\"],\n]\n\nfunction matchesPreset(\n offset: ScrollOffset,\n preset: ProgressIntersection[]\n): boolean {\n if (offset.length !== 2) return false\n\n for (let i = 0; i < 2; i++) {\n const o = offset[i]\n const p = preset[i]\n if (\n !Array.isArray(o) ||\n o.length !== 2 ||\n o[0] !== p[0] ||\n o[1] !== p[1]\n )\n return false\n }\n return true\n}\n\nexport function offsetToViewTimelineRange(\n offset?: ScrollOffset\n): ViewTimelineRange | undefined {\n if (!offset) {\n return { rangeStart: \"contain 0%\", rangeEnd: \"contain 100%\" }\n }\n\n for (const [preset, name] of presets) {\n if (matchesPreset(offset, preset)) {\n return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }\n }\n }\n\n return undefined\n}\n"],"names":["ScrollOffsetPresets"],"mappings":";;AAQA;;;;AAIG;AACH,MAAM,OAAO,GAAuC;AAChD,IAAA,CAACA,YAAmB,CAAC,KAAK,EAAE,OAAO,CAAC;AACpC,IAAA,CAACA,YAAmB,CAAC,IAAI,EAAE,MAAM,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,OAAO,CAAC;AAClC,IAAA,CAACA,YAAmB,CAAC,GAAG,EAAE,SAAS,CAAC;CACvC;AAED,SAAS,aAAa,CAClB,MAAoB,EACpB,MAA8B,EAAA;AAE9B,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;AAErC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACxB,QAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AACnB,QAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AACnB,QAAA,IACI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,MAAM,KAAK,CAAC;AACd,YAAA,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACb,YAAA,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEb,YAAA,OAAO,KAAK;IACpB;AACA,IAAA,OAAO,IAAI;AACf;AAEM,SAAU,yBAAyB,CACrC,MAAqB,EAAA;IAErB,IAAI,CAAC,MAAM,EAAE;QACT,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE;IACjE;IAEA,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE;AAClC,QAAA,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;AAC/B,YAAA,OAAO,EAAE,UAAU,EAAE,CAAA,EAAG,IAAI,CAAA,GAAA,CAAK,EAAE,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,EAAE;QACjE;IACJ;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"}
1
+ {"version":3,"file":"offset-to-range.mjs","sources":["../../../../../../src/render/dom/scroll/utils/offset-to-range.ts"],"sourcesContent":["import { ScrollOffset as ScrollOffsetPresets } from \"../offsets/presets\"\nimport { ProgressIntersection, ScrollOffset } from \"../types\"\n\ninterface ViewTimelineRange {\n rangeStart: string\n rangeEnd: string\n}\n\n/**\n * Maps from ProgressIntersection pairs used by Motion's preset offsets to\n * ViewTimeline named ranges. Returns undefined for unrecognised patterns,\n * which signals the caller to fall back to JS-based scroll tracking.\n */\nconst presets: [ProgressIntersection[], string][] = [\n [ScrollOffsetPresets.Enter, \"entry\"],\n [ScrollOffsetPresets.Exit, \"exit\"],\n [ScrollOffsetPresets.Any, \"cover\"],\n [ScrollOffsetPresets.All, \"contain\"],\n]\n\nconst stringToProgress: Record<string, number> = {\n start: 0,\n end: 1,\n}\n\nfunction parseStringOffset(\n s: string\n): ProgressIntersection | undefined {\n const parts = s.trim().split(/\\s+/)\n if (parts.length !== 2) return undefined\n const a = stringToProgress[parts[0]]\n const b = stringToProgress[parts[1]]\n if (a === undefined || b === undefined) return undefined\n return [a, b]\n}\n\nfunction normaliseOffset(offset: ScrollOffset): ProgressIntersection[] | undefined {\n if (offset.length !== 2) return undefined\n const result: ProgressIntersection[] = []\n for (const item of offset) {\n if (Array.isArray(item)) {\n result.push(item as ProgressIntersection)\n } else if (typeof item === \"string\") {\n const parsed = parseStringOffset(item)\n if (!parsed) return undefined\n result.push(parsed)\n } else {\n return undefined\n }\n }\n return result\n}\n\nfunction matchesPreset(\n offset: ScrollOffset,\n preset: ProgressIntersection[]\n): boolean {\n const normalised = normaliseOffset(offset)\n if (!normalised) return false\n\n for (let i = 0; i < 2; i++) {\n const o = normalised[i]\n const p = preset[i]\n if (o[0] !== p[0] || o[1] !== p[1]) return false\n }\n return true\n}\n\nexport function offsetToViewTimelineRange(\n offset?: ScrollOffset\n): ViewTimelineRange | undefined {\n if (!offset) {\n return { rangeStart: \"contain 0%\", rangeEnd: \"contain 100%\" }\n }\n\n for (const [preset, name] of presets) {\n if (matchesPreset(offset, preset)) {\n return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }\n }\n }\n\n return undefined\n}\n"],"names":["ScrollOffsetPresets"],"mappings":"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"}
@@ -1,3 +1,4 @@
1
+ import { isMotionValue } from 'motion-dom';
1
2
  import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';
2
3
 
3
4
  let shouldForward = (key) => !isValidMotionProp(key);
@@ -25,8 +26,12 @@ try {
25
26
  * We attempt to import this package but require won't be defined in esm environments, in that case
26
27
  * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
27
28
  * in favour of explicit injection.
29
+ *
30
+ * String concatenation prevents bundlers like webpack (e.g. Storybook)
31
+ * from statically resolving this optional dependency at build time.
28
32
  */
29
- loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
33
+ const emotionPkg = "@emotion/is-prop-" + "valid";
34
+ loadExternalIsValidProp(require(emotionPkg).default);
30
35
  }
31
36
  catch {
32
37
  // We don't need to actually do anything here - the fallback is the existing `isPropValid`.
@@ -43,6 +48,8 @@ function filterProps(props, isDom, forwardMotionProps) {
43
48
  */
44
49
  if (key === "values" && typeof props.values === "object")
45
50
  continue;
51
+ if (isMotionValue(props[key]))
52
+ continue;
46
53
  if (shouldForward(key) ||
47
54
  (forwardMotionProps === true && isValidMotionProp(key)) ||
48
55
  (!isDom && !isValidMotionProp(key)) ||
@@ -1 +1 @@
1
- {"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;AAGA,IAAI,aAAa,GAAG,CAAC,GAAW,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;AAItD,SAAU,uBAAuB,CAAC,WAAyB,EAAA;IAC7D,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE;;IAGvC,aAAa,GAAG,CAAC,GAAW,KACxB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;AACzE;AAEA;;;;;;;;;;;;AAYG;AACH,IAAI;AACA;;;;AAIG;IACH,uBAAuB,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC;AACtE;AAAE,MAAM;;AAER;SAEgB,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAAA;IAE3B,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;QAE1D,IACI,aAAa,CAAC,GAAG,CAAC;aACjB,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"}
1
+ {"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import { isMotionValue } from \"motion-dom\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n *\n * String concatenation prevents bundlers like webpack (e.g. Storybook)\n * from statically resolving this optional dependency at build time.\n */\n const emotionPkg = \"@emotion/is-prop-\" + \"valid\"\n loadExternalIsValidProp(require(emotionPkg).default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;;AAIA,IAAI,aAAa,GAAG,CAAC,GAAW,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;AAItD,SAAU,uBAAuB,CAAC,WAAyB,EAAA;IAC7D,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE;;IAGvC,aAAa,GAAG,CAAC,GAAW,KACxB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;AACzE;AAEA;;;;;;;;;;;;AAYG;AACH,IAAI;AACA;;;;;;;AAOG;AACH,IAAA,MAAM,UAAU,GAAG,mBAAmB,GAAG,OAAO;IAChD,uBAAuB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;AACxD;AAAE,MAAM;;AAER;SAEgB,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAAA;IAE3B,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;AAE1D,QAAA,IAAI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;YAAE;QAErD,IACI,aAAa,CAAC,GAAG,CAAC;aACjB,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue<string>,\n options?: SpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: string,\n options?: SpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: MotionValue<number>,\n options?: SpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: number,\n options?: SpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: MotionValue<string> | MotionValue<number> | string | number,\n options: SpringOptions = {}\n): MotionValue<string> | MotionValue<number> {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA4CI;AACJ;;"}
1
+ {"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick<FollowValueOptions, \"skipInitialAnimation\">\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue<string>,\n options?: UseSpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: MotionValue<number>,\n options?: UseSpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: MotionValue<string> | MotionValue<number> | string | number,\n options: UseSpringOptions = {}\n): MotionValue<string> | MotionValue<number> {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA+CI;AACJ;;"}