motion-v 0.2.6 → 0.3.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 (244) hide show
  1. package/dist/cjs/index.js +1 -0
  2. package/dist/es/animation/use-animate.mjs +21 -0
  3. package/dist/es/components/AnimatePresence.vue.mjs +53 -0
  4. package/dist/es/components/AnimatePresence.vue2.mjs +4 -0
  5. package/dist/es/components/Motion.vue.mjs +98 -0
  6. package/dist/es/components/Motion.vue2.mjs +4 -0
  7. package/dist/es/components/Primitive.mjs +23 -0
  8. package/dist/es/components/Slot.mjs +27 -0
  9. package/dist/es/components/context.mjs +6 -0
  10. package/dist/es/components/presence.mjs +13 -0
  11. package/dist/es/components/renderSlotFragments.mjs +7 -0
  12. package/dist/es/constants/index.mjs +19 -0
  13. package/dist/es/features/events.mjs +53 -0
  14. package/dist/es/features/feature-manager.mjs +28 -0
  15. package/dist/es/features/feature.mjs +10 -0
  16. package/dist/es/features/gestures/base.mjs +14 -0
  17. package/dist/es/features/gestures/hover.mjs +33 -0
  18. package/dist/es/features/gestures/in-view.mjs +29 -0
  19. package/dist/es/features/gestures/press.mjs +28 -0
  20. package/dist/es/features/svg.mjs +30 -0
  21. package/dist/es/index.mjs +104 -0
  22. package/dist/es/node_modules/.pnpm/@vueuse_shared@11.1.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/shared/index.mjs +6 -0
  23. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +66 -0
  24. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/index.mjs +20 -0
  25. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +8 -0
  26. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs +12 -0
  27. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/single-value.mjs +10 -0
  28. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animate/subject.mjs +30 -0
  29. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +202 -0
  30. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +79 -0
  31. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +148 -0
  32. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +17 -0
  33. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +12 -0
  34. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +23 -0
  35. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +106 -0
  36. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +24 -0
  37. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +12 -0
  38. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs +27 -0
  39. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs +17 -0
  40. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +6 -0
  41. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +8 -0
  42. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +11 -0
  43. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +12 -0
  44. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +10 -0
  45. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +6 -0
  46. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +12 -0
  47. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +12 -0
  48. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +5 -0
  49. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/inertia.mjs +37 -0
  50. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs +30 -0
  51. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs +55 -0
  52. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs +67 -0
  53. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +13 -0
  54. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +6 -0
  55. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs +9 -0
  56. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs +46 -0
  57. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +45 -0
  58. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +6 -0
  59. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +7 -0
  60. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/create.mjs +106 -0
  61. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +7 -0
  62. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs +22 -0
  63. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs +6 -0
  64. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs +39 -0
  65. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs +22 -0
  66. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/get-value-transition.mjs +6 -0
  67. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs +7 -0
  68. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +6 -0
  69. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +6 -0
  70. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +4 -0
  71. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-none.mjs +7 -0
  72. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +6 -0
  73. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/animation/utils/stagger.mjs +24 -0
  74. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/anticipate.mjs +5 -0
  75. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/back.mjs +9 -0
  76. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/circ.mjs +8 -0
  77. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs +18 -0
  78. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/ease.mjs +7 -0
  79. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs +4 -0
  80. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs +4 -0
  81. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/steps.mjs +11 -0
  82. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +13 -0
  83. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +8 -0
  84. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +4 -0
  85. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs +4 -0
  86. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/easing/utils/map.mjs +32 -0
  87. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/batcher.mjs +39 -0
  88. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/frame.mjs +9 -0
  89. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/index-legacy.mjs +7 -0
  90. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/render-step.mjs +41 -0
  91. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/frameloop/sync-time.mjs +15 -0
  92. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/motion/features/definitions.mjs +27 -0
  93. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +8 -0
  94. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs +21 -0
  95. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/geometry/models.mjs +8 -0
  96. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs +4 -0
  97. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/projection/utils/measure.mjs +7 -0
  98. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/VisualElement.mjs +226 -0
  99. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +65 -0
  100. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +19 -0
  101. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/handle-element.mjs +46 -0
  102. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/handle-window.mjs +23 -0
  103. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/resize/index.mjs +8 -0
  104. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs +46 -0
  105. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs +38 -0
  106. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/observe.mjs +12 -0
  107. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +17 -0
  108. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +26 -0
  109. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +25 -0
  110. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +9 -0
  111. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +21 -0
  112. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +23 -0
  113. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/supports.mjs +5 -0
  114. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs +40 -0
  115. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +4 -0
  116. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +31 -0
  117. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +5 -0
  118. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +6 -0
  119. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +12 -0
  120. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +52 -0
  121. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +10 -0
  122. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs +24 -0
  123. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +9 -0
  124. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs +8 -0
  125. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +4 -0
  126. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +41 -0
  127. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs +18 -0
  128. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs +4 -0
  129. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs +31 -0
  130. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +7 -0
  131. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs +8 -0
  132. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs +25 -0
  133. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +46 -0
  134. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs +29 -0
  135. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs +31 -0
  136. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +16 -0
  137. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/render.mjs +8 -0
  138. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +12 -0
  139. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/html/utils/transform.mjs +23 -0
  140. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +37 -0
  141. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/store.mjs +4 -0
  142. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +40 -0
  143. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +26 -0
  144. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +28 -0
  145. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +4 -0
  146. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs +18 -0
  147. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/render.mjs +11 -0
  148. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +15 -0
  149. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +11 -0
  150. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +76 -0
  151. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +13 -0
  152. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs +6 -0
  153. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs +26 -0
  154. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +8 -0
  155. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs +20 -0
  156. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/setters.mjs +18 -0
  157. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/render/utils/variant-props.mjs +13 -0
  158. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs +7 -0
  159. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/array.mjs +11 -0
  160. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/clamp.mjs +4 -0
  161. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/delay.mjs +17 -0
  162. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/distance.mjs +9 -0
  163. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/errors.mjs +12 -0
  164. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs +22 -0
  165. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/interpolate.mjs +38 -0
  166. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-browser.mjs +4 -0
  167. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs +4 -0
  168. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs +4 -0
  169. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/memo.mjs +7 -0
  170. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/color.mjs +29 -0
  171. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/complex.mjs +52 -0
  172. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/immediate.mjs +6 -0
  173. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/index.mjs +8 -0
  174. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/number.mjs +4 -0
  175. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/mix/visibility.mjs +8 -0
  176. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/noop.mjs +4 -0
  177. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/default.mjs +8 -0
  178. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/fill.mjs +12 -0
  179. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/offsets/time.mjs +6 -0
  180. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/pipe.mjs +4 -0
  181. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/progress.mjs +7 -0
  182. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs +13 -0
  183. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs +5 -0
  184. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/resolve-value.mjs +5 -0
  185. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/subscription-manager.mjs +29 -0
  186. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/time-conversion.mjs +5 -0
  187. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/transform.mjs +12 -0
  188. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs +6 -0
  189. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/warn-once.mjs +7 -0
  190. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/utils/wrap.mjs +7 -0
  191. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/index.mjs +210 -0
  192. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/hex.mjs +19 -0
  193. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/hsla.mjs +12 -0
  194. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/index.mjs +11 -0
  195. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/rgba.mjs +16 -0
  196. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/color/utils.mjs +18 -0
  197. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/complex/filter.mjs +24 -0
  198. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/complex/index.mjs +49 -0
  199. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/numbers/index.mjs +17 -0
  200. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/numbers/units.mjs +17 -0
  201. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs +4 -0
  202. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs +4 -0
  203. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs +6 -0
  204. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs +4 -0
  205. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +4 -0
  206. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +9 -0
  207. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/use-will-change/is.mjs +7 -0
  208. package/dist/es/node_modules/.pnpm/framer-motion@11.11.11/node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs +4 -0
  209. package/dist/es/node_modules/.pnpm/hey-listen@1.0.8/node_modules/hey-listen/dist/hey-listen.es.mjs +13 -0
  210. package/dist/es/state/event.mjs +6 -0
  211. package/dist/es/state/motion-state.mjs +134 -0
  212. package/dist/es/state/schedule.mjs +22 -0
  213. package/dist/es/state/style.mjs +93 -0
  214. package/dist/es/state/transform.mjs +59 -0
  215. package/dist/es/state/utils.mjs +113 -0
  216. package/dist/es/utils/createContext.mjs +17 -0
  217. package/dist/es/utils/events.mjs +8 -0
  218. package/dist/es/utils/motion-value.mjs +6 -0
  219. package/dist/es/utils/use-animation-frame.mjs +14 -0
  220. package/dist/es/utils/use-in-view.mjs +19 -0
  221. package/dist/es/value/use-combine-values.mjs +22 -0
  222. package/dist/es/value/use-computed.mjs +13 -0
  223. package/dist/es/value/use-motion-template.mjs +19 -0
  224. package/dist/es/value/use-scroll.mjs +47 -0
  225. package/dist/es/value/use-spring.mjs +39 -0
  226. package/dist/es/value/use-time.mjs +9 -0
  227. package/dist/es/value/use-transform.mjs +25 -0
  228. package/dist/src/animation/index.d.ts +1 -0
  229. package/dist/src/animation/use-animate.d.ts +8 -0
  230. package/dist/src/components/Motion.d.ts +3 -3
  231. package/dist/src/features/events.d.ts +1 -1
  232. package/dist/src/features/feature-manager.d.ts +9 -0
  233. package/dist/src/features/feature.d.ts +0 -7
  234. package/dist/src/features/index.d.ts +2 -1
  235. package/dist/src/index.d.ts +3 -0
  236. package/dist/src/state/motion-state.d.ts +1 -1
  237. package/dist/src/state/utils.d.ts +1 -1
  238. package/dist/src/types/state.d.ts +3 -2
  239. package/dist/src/utils/index.d.ts +2 -0
  240. package/dist/src/utils/use-dom-ref.d.ts +1 -0
  241. package/dist/src/utils/use-in-view.d.ts +3 -0
  242. package/package.json +7 -7
  243. package/dist/index.js +0 -4011
  244. package/dist/index.umd.cjs +0 -1
@@ -0,0 +1,29 @@
1
+ import { mixNumber as p } from "./number.mjs";
2
+ import { warning as f } from "../errors.mjs";
3
+ import { hslaToRgba as c } from "../hsla-to-rgba.mjs";
4
+ import { hex as u } from "../../value/types/color/hex.mjs";
5
+ import { rgba as s } from "../../value/types/color/rgba.mjs";
6
+ import { hsla as l } from "../../value/types/color/hsla.mjs";
7
+ import { mixImmediate as d } from "./immediate.mjs";
8
+ const m = (o, e, r) => {
9
+ const t = o * o, n = r * (e * e - t) + t;
10
+ return n < 0 ? 0 : Math.sqrt(n);
11
+ }, b = [u, s, l], h = (o) => b.find((e) => e.test(o));
12
+ function i(o) {
13
+ const e = h(o);
14
+ if (f(!!e, `'${o}' is not an animatable color. Use the equivalent color code instead.`), !e)
15
+ return !1;
16
+ let r = e.parse(o);
17
+ return e === l && (r = c(r)), r;
18
+ }
19
+ const G = (o, e) => {
20
+ const r = i(o), t = i(e);
21
+ if (!r || !t)
22
+ return d(o, e);
23
+ const n = { ...r };
24
+ return (a) => (n.red = m(r.red, t.red, a), n.green = m(r.green, t.green, a), n.blue = m(r.blue, t.blue, a), n.alpha = p(r.alpha, t.alpha, a), s.transform(n));
25
+ };
26
+ export {
27
+ G as mixColor,
28
+ m as mixLinearColor
29
+ };
@@ -0,0 +1,52 @@
1
+ import { mixNumber as h } from "./number.mjs";
2
+ import { mixColor as u } from "./color.mjs";
3
+ import { pipe as b } from "../pipe.mjs";
4
+ import { warning as y } from "../errors.mjs";
5
+ import { color as m } from "../../value/types/color/index.mjs";
6
+ import { complex as v, analyseComplexValue as a } from "../../value/types/complex/index.mjs";
7
+ import { isCSSVariableToken as g } from "../../render/dom/utils/is-css-variable.mjs";
8
+ import { invisibleValues as c, mixVisibility as V } from "./visibility.mjs";
9
+ import { mixImmediate as l } from "./immediate.mjs";
10
+ function C(e, t) {
11
+ return (r) => h(e, t, r);
12
+ }
13
+ function f(e) {
14
+ return typeof e == "number" ? C : typeof e == "string" ? g(e) ? l : m.test(e) ? u : S : Array.isArray(e) ? p : typeof e == "object" ? m.test(e) ? u : k : l;
15
+ }
16
+ function p(e, t) {
17
+ const r = [...e], o = r.length, n = e.map((i, s) => f(i)(i, t[s]));
18
+ return (i) => {
19
+ for (let s = 0; s < o; s++)
20
+ r[s] = n[s](i);
21
+ return r;
22
+ };
23
+ }
24
+ function k(e, t) {
25
+ const r = { ...e, ...t }, o = {};
26
+ for (const n in r)
27
+ e[n] !== void 0 && t[n] !== void 0 && (o[n] = f(e[n])(e[n], t[n]));
28
+ return (n) => {
29
+ for (const i in o)
30
+ r[i] = o[i](n);
31
+ return r;
32
+ };
33
+ }
34
+ function I(e, t) {
35
+ var r;
36
+ const o = [], n = { color: 0, var: 0, number: 0 };
37
+ for (let i = 0; i < t.values.length; i++) {
38
+ const s = t.types[i], x = e.indexes[s][n[s]], d = (r = e.values[x]) !== null && r !== void 0 ? r : 0;
39
+ o[i] = d, n[s]++;
40
+ }
41
+ return o;
42
+ }
43
+ const S = (e, t) => {
44
+ const r = v.createTransformer(t), o = a(e), n = a(t);
45
+ return o.indexes.var.length === n.indexes.var.length && o.indexes.color.length === n.indexes.color.length && o.indexes.number.length >= n.indexes.number.length ? c.has(e) && !n.values.length || c.has(t) && !o.values.length ? V(e, t) : b(p(I(o, n), n.values), r) : (y(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), l(e, t));
46
+ };
47
+ export {
48
+ f as getMixer,
49
+ p as mixArray,
50
+ S as mixComplex,
51
+ k as mixObject
52
+ };
@@ -0,0 +1,6 @@
1
+ function m(e, t) {
2
+ return (i) => i > 0 ? t : e;
3
+ }
4
+ export {
5
+ m as mixImmediate
6
+ };
@@ -0,0 +1,8 @@
1
+ import { getMixer as m } from "./complex.mjs";
2
+ import { mixNumber as t } from "./number.mjs";
3
+ function o(e, r, i) {
4
+ return typeof e == "number" && typeof r == "number" && typeof i == "number" ? t(e, r, i) : m(e)(e, r);
5
+ }
6
+ export {
7
+ o as mix
8
+ };
@@ -0,0 +1,4 @@
1
+ const n = (e, r, t) => e + (r - e) * t;
2
+ export {
3
+ n as mixNumber
4
+ };
@@ -0,0 +1,8 @@
1
+ const s = /* @__PURE__ */ new Set(["none", "hidden"]);
2
+ function t(e, i) {
3
+ return s.has(e) ? (n) => n <= 0 ? e : i : (n) => n >= 1 ? i : e;
4
+ }
5
+ export {
6
+ s as invisibleValues,
7
+ t as mixVisibility
8
+ };
@@ -0,0 +1,8 @@
1
+ import { fillOffset as e } from "./fill.mjs";
2
+ function n(t) {
3
+ const f = [0];
4
+ return e(f, t.length - 1), f;
5
+ }
6
+ export {
7
+ n as defaultOffset
8
+ };
@@ -0,0 +1,12 @@
1
+ import { mixNumber as e } from "../mix/number.mjs";
2
+ import { progress as f } from "../progress.mjs";
3
+ function l(o, t) {
4
+ const s = o[o.length - 1];
5
+ for (let r = 1; r <= t; r++) {
6
+ const m = f(0, t, r);
7
+ o.push(e(s, 1, m));
8
+ }
9
+ }
10
+ export {
11
+ l as fillOffset
12
+ };
@@ -0,0 +1,6 @@
1
+ function o(e, t) {
2
+ return e.map((n) => n * t);
3
+ }
4
+ export {
5
+ o as convertOffsetToTimes
6
+ };
@@ -0,0 +1,4 @@
1
+ const o = (c, e) => (n) => e(c(n)), t = (...c) => c.reduce(o);
2
+ export {
3
+ t as pipe
4
+ };
@@ -0,0 +1,7 @@
1
+ const n = (e, o, t) => {
2
+ const r = o - e;
3
+ return r === 0 ? 1 : (t - e) / r;
4
+ };
5
+ export {
6
+ n as progress
7
+ };
@@ -0,0 +1,13 @@
1
+ import { isBrowser as o } from "../is-browser.mjs";
2
+ import { hasReducedMotionListener as i, prefersReducedMotion as t } from "./state.mjs";
3
+ function c() {
4
+ if (i.current = !0, !!o)
5
+ if (window.matchMedia) {
6
+ const e = window.matchMedia("(prefers-reduced-motion)"), r = () => t.current = e.matches;
7
+ e.addListener(r), r();
8
+ } else
9
+ t.current = !1;
10
+ }
11
+ export {
12
+ c as initPrefersReducedMotion
13
+ };
@@ -0,0 +1,5 @@
1
+ const e = { current: null }, n = { current: !1 };
2
+ export {
3
+ n as hasReducedMotionListener,
4
+ e as prefersReducedMotion
5
+ };
@@ -0,0 +1,5 @@
1
+ import { isKeyframesTarget as r } from "../animation/utils/is-keyframes-target.mjs";
2
+ const a = (e) => r(e) ? e[e.length - 1] || 0 : e;
3
+ export {
4
+ a as resolveFinalValueInKeyframes
5
+ };
@@ -0,0 +1,29 @@
1
+ import { addUniqueItem as e, removeItem as u } from "./array.mjs";
2
+ class h {
3
+ constructor() {
4
+ this.subscriptions = [];
5
+ }
6
+ add(s) {
7
+ return e(this.subscriptions, s), () => u(this.subscriptions, s);
8
+ }
9
+ notify(s, r, n) {
10
+ const i = this.subscriptions.length;
11
+ if (i)
12
+ if (i === 1)
13
+ this.subscriptions[0](s, r, n);
14
+ else
15
+ for (let t = 0; t < i; t++) {
16
+ const o = this.subscriptions[t];
17
+ o && o(s, r, n);
18
+ }
19
+ }
20
+ getSize() {
21
+ return this.subscriptions.length;
22
+ }
23
+ clear() {
24
+ this.subscriptions.length = 0;
25
+ }
26
+ }
27
+ export {
28
+ h as SubscriptionManager
29
+ };
@@ -0,0 +1,5 @@
1
+ const s = (o) => o * 1e3, c = (o) => o / 1e3;
2
+ export {
3
+ c as millisecondsToSeconds,
4
+ s as secondsToMilliseconds
5
+ };
@@ -0,0 +1,12 @@
1
+ import { interpolate as c } from "./interpolate.mjs";
2
+ const p = (t) => t && typeof t == "object" && t.mix, m = (t) => p(t) ? t.mix : void 0;
3
+ function f(...t) {
4
+ const o = !Array.isArray(t[0]), n = o ? 0 : -1, r = t[0 + n], s = t[1 + n], e = t[2 + n], u = t[3 + n], i = c(s, e, {
5
+ mixer: m(e[0]),
6
+ ...u
7
+ });
8
+ return o ? i(r) : i;
9
+ }
10
+ export {
11
+ f as transform
12
+ };
@@ -0,0 +1,6 @@
1
+ function n(c, e) {
2
+ return e ? c * (1e3 / e) : 0;
3
+ }
4
+ export {
5
+ n as velocityPerSecond
6
+ };
@@ -0,0 +1,7 @@
1
+ const e = /* @__PURE__ */ new Set();
2
+ function o(r, n, t) {
3
+ r || e.has(n) || (console.warn(n), e.add(n));
4
+ }
5
+ export {
6
+ o as warnOnce
7
+ };
@@ -0,0 +1,7 @@
1
+ const a = (r, t, o) => {
2
+ const e = t - r;
3
+ return ((o - r) % e + e) % e + r;
4
+ };
5
+ export {
6
+ a as wrap
7
+ };
@@ -0,0 +1,210 @@
1
+ import { SubscriptionManager as c } from "../utils/subscription-manager.mjs";
2
+ import { velocityPerSecond as u } from "../utils/velocity-per-second.mjs";
3
+ import { warnOnce as p } from "../utils/warn-once.mjs";
4
+ import { time as n } from "../frameloop/sync-time.mjs";
5
+ import { frame as f } from "../frameloop/frame.mjs";
6
+ const r = 30, d = (s) => !isNaN(parseFloat(s)), a = {
7
+ current: void 0
8
+ };
9
+ class l {
10
+ /**
11
+ * @param init - The initiating value
12
+ * @param config - Optional configuration options
13
+ *
14
+ * - `transformer`: A function to transform incoming values with.
15
+ *
16
+ * @internal
17
+ */
18
+ constructor(t, e = {}) {
19
+ this.version = "11.11.11", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, h = !0) => {
20
+ const o = n.now();
21
+ this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), h && this.events.renderRequest && this.events.renderRequest.notify(this.current);
22
+ }, this.hasAnimated = !1, this.setCurrent(t), this.owner = e.owner;
23
+ }
24
+ setCurrent(t) {
25
+ this.current = t, this.updatedAt = n.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = d(this.current));
26
+ }
27
+ setPrevFrameValue(t = this.current) {
28
+ this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
29
+ }
30
+ /**
31
+ * Adds a function that will be notified when the `MotionValue` is updated.
32
+ *
33
+ * It returns a function that, when called, will cancel the subscription.
34
+ *
35
+ * When calling `onChange` inside a React component, it should be wrapped with the
36
+ * `useEffect` hook. As it returns an unsubscribe function, this should be returned
37
+ * from the `useEffect` function to ensure you don't add duplicate subscribers..
38
+ *
39
+ * ```jsx
40
+ * export const MyComponent = () => {
41
+ * const x = useMotionValue(0)
42
+ * const y = useMotionValue(0)
43
+ * const opacity = useMotionValue(1)
44
+ *
45
+ * useEffect(() => {
46
+ * function updateOpacity() {
47
+ * const maxXY = Math.max(x.get(), y.get())
48
+ * const newOpacity = transform(maxXY, [0, 100], [1, 0])
49
+ * opacity.set(newOpacity)
50
+ * }
51
+ *
52
+ * const unsubscribeX = x.on("change", updateOpacity)
53
+ * const unsubscribeY = y.on("change", updateOpacity)
54
+ *
55
+ * return () => {
56
+ * unsubscribeX()
57
+ * unsubscribeY()
58
+ * }
59
+ * }, [])
60
+ *
61
+ * return <motion.div style={{ x }} />
62
+ * }
63
+ * ```
64
+ *
65
+ * @param subscriber - A function that receives the latest value.
66
+ * @returns A function that, when called, will cancel this subscription.
67
+ *
68
+ * @deprecated
69
+ */
70
+ onChange(t) {
71
+ return process.env.NODE_ENV !== "production" && p(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
72
+ }
73
+ on(t, e) {
74
+ this.events[t] || (this.events[t] = new c());
75
+ const i = this.events[t].add(e);
76
+ return t === "change" ? () => {
77
+ i(), f.read(() => {
78
+ this.events.change.getSize() || this.stop();
79
+ });
80
+ } : i;
81
+ }
82
+ clearListeners() {
83
+ for (const t in this.events)
84
+ this.events[t].clear();
85
+ }
86
+ /**
87
+ * Attaches a passive effect to the `MotionValue`.
88
+ *
89
+ * @internal
90
+ */
91
+ attach(t, e) {
92
+ this.passiveEffect = t, this.stopPassiveEffect = e;
93
+ }
94
+ /**
95
+ * Sets the state of the `MotionValue`.
96
+ *
97
+ * @remarks
98
+ *
99
+ * ```jsx
100
+ * const x = useMotionValue(0)
101
+ * x.set(10)
102
+ * ```
103
+ *
104
+ * @param latest - Latest value to set.
105
+ * @param render - Whether to notify render subscribers. Defaults to `true`
106
+ *
107
+ * @public
108
+ */
109
+ set(t, e = !0) {
110
+ !e || !this.passiveEffect ? this.updateAndNotify(t, e) : this.passiveEffect(t, this.updateAndNotify);
111
+ }
112
+ setWithVelocity(t, e, i) {
113
+ this.set(e), this.prev = void 0, this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt - i;
114
+ }
115
+ /**
116
+ * Set the state of the `MotionValue`, stopping any active animations,
117
+ * effects, and resets velocity to `0`.
118
+ */
119
+ jump(t, e = !0) {
120
+ this.updateAndNotify(t), this.prev = t, this.prevUpdatedAt = this.prevFrameValue = void 0, e && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
121
+ }
122
+ /**
123
+ * Returns the latest state of `MotionValue`
124
+ *
125
+ * @returns - The latest state of `MotionValue`
126
+ *
127
+ * @public
128
+ */
129
+ get() {
130
+ return a.current && a.current.push(this), this.current;
131
+ }
132
+ /**
133
+ * @public
134
+ */
135
+ getPrevious() {
136
+ return this.prev;
137
+ }
138
+ /**
139
+ * Returns the latest velocity of `MotionValue`
140
+ *
141
+ * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
142
+ *
143
+ * @public
144
+ */
145
+ getVelocity() {
146
+ const t = n.now();
147
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > r)
148
+ return 0;
149
+ const e = Math.min(this.updatedAt - this.prevUpdatedAt, r);
150
+ return u(parseFloat(this.current) - parseFloat(this.prevFrameValue), e);
151
+ }
152
+ /**
153
+ * Registers a new animation to control this `MotionValue`. Only one
154
+ * animation can drive a `MotionValue` at one time.
155
+ *
156
+ * ```jsx
157
+ * value.start()
158
+ * ```
159
+ *
160
+ * @param animation - A function that starts the provided animation
161
+ *
162
+ * @internal
163
+ */
164
+ start(t) {
165
+ return this.stop(), new Promise((e) => {
166
+ this.hasAnimated = !0, this.animation = t(e), this.events.animationStart && this.events.animationStart.notify();
167
+ }).then(() => {
168
+ this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
169
+ });
170
+ }
171
+ /**
172
+ * Stop the currently active animation.
173
+ *
174
+ * @public
175
+ */
176
+ stop() {
177
+ this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
178
+ }
179
+ /**
180
+ * Returns `true` if this value is currently animating.
181
+ *
182
+ * @public
183
+ */
184
+ isAnimating() {
185
+ return !!this.animation;
186
+ }
187
+ clearAnimation() {
188
+ delete this.animation;
189
+ }
190
+ /**
191
+ * Destroy and clean up subscribers to this `MotionValue`.
192
+ *
193
+ * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
194
+ * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
195
+ * created a `MotionValue` via the `motionValue` function.
196
+ *
197
+ * @public
198
+ */
199
+ destroy() {
200
+ this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
201
+ }
202
+ }
203
+ function g(s, t) {
204
+ return new l(s, t);
205
+ }
206
+ export {
207
+ l as MotionValue,
208
+ a as collectMotionValues,
209
+ g as motionValue
210
+ };
@@ -0,0 +1,19 @@
1
+ import { rgba as i } from "./rgba.mjs";
2
+ import { isColorString as g } from "./utils.mjs";
3
+ function a(r) {
4
+ let t = "", e = "", n = "", s = "";
5
+ return r.length > 5 ? (t = r.substring(1, 3), e = r.substring(3, 5), n = r.substring(5, 7), s = r.substring(7, 9)) : (t = r.substring(1, 2), e = r.substring(2, 3), n = r.substring(3, 4), s = r.substring(4, 5), t += t, e += e, n += n, s += s), {
6
+ red: parseInt(t, 16),
7
+ green: parseInt(e, 16),
8
+ blue: parseInt(n, 16),
9
+ alpha: s ? parseInt(s, 16) / 255 : 1
10
+ };
11
+ }
12
+ const u = {
13
+ test: /* @__PURE__ */ g("#"),
14
+ parse: a,
15
+ transform: i.transform
16
+ };
17
+ export {
18
+ u as hex
19
+ };
@@ -0,0 +1,12 @@
1
+ import { alpha as n } from "../numbers/index.mjs";
2
+ import { percent as t } from "../numbers/units.mjs";
3
+ import { sanitize as r } from "../utils/sanitize.mjs";
4
+ import { isColorString as i, splitColor as e } from "./utils.mjs";
5
+ const u = {
6
+ test: /* @__PURE__ */ i("hsl", "hue"),
7
+ parse: /* @__PURE__ */ e("hue", "saturation", "lightness"),
8
+ transform: ({ hue: o, saturation: s, lightness: a, alpha: m = 1 }) => "hsla(" + Math.round(o) + ", " + t.transform(r(s)) + ", " + t.transform(r(a)) + ", " + r(n.transform(m)) + ")"
9
+ };
10
+ export {
11
+ u as hsla
12
+ };
@@ -0,0 +1,11 @@
1
+ import { hex as s } from "./hex.mjs";
2
+ import { hsla as t } from "./hsla.mjs";
3
+ import { rgba as e } from "./rgba.mjs";
4
+ const p = {
5
+ test: (r) => e.test(r) || s.test(r) || t.test(r),
6
+ parse: (r) => e.test(r) ? e.parse(r) : t.test(r) ? t.parse(r) : s.parse(r),
7
+ transform: (r) => typeof r == "string" ? r : r.hasOwnProperty("red") ? e.transform(r) : t.transform(r)
8
+ };
9
+ export {
10
+ p as color
11
+ };
@@ -0,0 +1,16 @@
1
+ import { clamp as n } from "../../../utils/clamp.mjs";
2
+ import { number as s, alpha as i } from "../numbers/index.mjs";
3
+ import { sanitize as p } from "../utils/sanitize.mjs";
4
+ import { isColorString as e, splitColor as f } from "./utils.mjs";
5
+ const l = (r) => n(0, 255, r), o = {
6
+ ...s,
7
+ transform: (r) => Math.round(l(r))
8
+ }, h = {
9
+ test: /* @__PURE__ */ e("rgb", "red"),
10
+ parse: /* @__PURE__ */ f("red", "green", "blue"),
11
+ transform: ({ red: r, green: t, blue: a, alpha: m = 1 }) => "rgba(" + o.transform(r) + ", " + o.transform(t) + ", " + o.transform(a) + ", " + p(i.transform(m)) + ")"
12
+ };
13
+ export {
14
+ o as rgbUnit,
15
+ h as rgba
16
+ };
@@ -0,0 +1,18 @@
1
+ import { floatRegex as i } from "../utils/float-regex.mjs";
2
+ import { isNullish as n } from "../utils/is-nullish.mjs";
3
+ import { singleColorRegex as f } from "../utils/single-color-regex.mjs";
4
+ const h = (r, o) => (t) => !!(typeof t == "string" && f.test(t) && t.startsWith(r) || o && !n(t) && Object.prototype.hasOwnProperty.call(t, o)), u = (r, o, t) => (e) => {
5
+ if (typeof e != "string")
6
+ return e;
7
+ const [l, s, p, a] = e.match(i);
8
+ return {
9
+ [r]: parseFloat(l),
10
+ [o]: parseFloat(s),
11
+ [t]: parseFloat(p),
12
+ alpha: a !== void 0 ? parseFloat(a) : 1
13
+ };
14
+ };
15
+ export {
16
+ h as isColorString,
17
+ u as splitColor
18
+ };
@@ -0,0 +1,24 @@
1
+ import { complex as c } from "./index.mjs";
2
+ import { floatRegex as i } from "../utils/float-regex.mjs";
3
+ const s = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
4
+ function u(t) {
5
+ const [e, n] = t.slice(0, -1).split("(");
6
+ if (e === "drop-shadow")
7
+ return t;
8
+ const [o] = n.match(i) || [];
9
+ if (!o)
10
+ return t;
11
+ const r = n.replace(o, "");
12
+ let a = s.has(e) ? 1 : 0;
13
+ return o !== n && (a *= 100), e + "(" + a + r + ")";
14
+ }
15
+ const l = /\b([a-z-]*)\(.*?\)/gu, p = {
16
+ ...c,
17
+ getAnimatableNone: (t) => {
18
+ const e = t.match(l);
19
+ return e ? e.map(u).join(" ") : t;
20
+ }
21
+ };
22
+ export {
23
+ p as filter
24
+ };
@@ -0,0 +1,49 @@
1
+ import { color as u } from "../color/index.mjs";
2
+ import { colorRegex as g } from "../utils/color-regex.mjs";
3
+ import { floatRegex as N } from "../utils/float-regex.mjs";
4
+ import { sanitize as b } from "../utils/sanitize.mjs";
5
+ function x(t) {
6
+ var e, o;
7
+ return isNaN(t) && typeof t == "string" && (((e = t.match(N)) === null || e === void 0 ? void 0 : e.length) || 0) + (((o = t.match(g)) === null || o === void 0 ? void 0 : o.length) || 0) > 0;
8
+ }
9
+ const p = "number", m = "color", T = "var", O = "var(", a = "${}", _ = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
10
+ function f(t) {
11
+ const e = t.toString(), o = [], i = {
12
+ color: [],
13
+ number: [],
14
+ var: []
15
+ }, n = [];
16
+ let s = 0;
17
+ const l = e.replace(_, (c) => (u.test(c) ? (i.color.push(s), n.push(m), o.push(u.parse(c))) : c.startsWith(O) ? (i.var.push(s), n.push(T), o.push(c)) : (i.number.push(s), n.push(p), o.push(parseFloat(c))), ++s, a)).split(a);
18
+ return { values: o, split: l, indexes: i, types: n };
19
+ }
20
+ function h(t) {
21
+ return f(t).values;
22
+ }
23
+ function d(t) {
24
+ const { split: e, types: o } = f(t), i = e.length;
25
+ return (n) => {
26
+ let s = "";
27
+ for (let r = 0; r < i; r++)
28
+ if (s += e[r], n[r] !== void 0) {
29
+ const l = o[r];
30
+ l === p ? s += b(n[r]) : l === m ? s += u.transform(n[r]) : s += n[r];
31
+ }
32
+ return s;
33
+ };
34
+ }
35
+ const R = (t) => typeof t == "number" ? 0 : t;
36
+ function y(t) {
37
+ const e = h(t);
38
+ return d(t)(e.map(R));
39
+ }
40
+ const A = {
41
+ test: x,
42
+ parse: h,
43
+ createTransformer: d,
44
+ getAnimatableNone: y
45
+ };
46
+ export {
47
+ f as analyseComplexValue,
48
+ A as complex
49
+ };
@@ -0,0 +1,17 @@
1
+ import { clamp as a } from "../../../utils/clamp.mjs";
2
+ const r = {
3
+ test: (t) => typeof t == "number",
4
+ parse: parseFloat,
5
+ transform: (t) => t
6
+ }, e = {
7
+ ...r,
8
+ transform: (t) => a(0, 1, t)
9
+ }, s = {
10
+ ...r,
11
+ default: 1
12
+ };
13
+ export {
14
+ e as alpha,
15
+ r as number,
16
+ s as scale
17
+ };