"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useScaleAnimation = void 0;
var _reactNativeReanimated = require("react-native-reanimated");
var _core = require("../core");
var _hooks = require("../utils/hooks");
const useScaleAnimation = (magnitude = "slight") => {
  const {
    progress,
    onPressIn,
    onPressOut
  } = (0, _hooks.useSpringPressProgressValue)("button");

  // Scaling transformation applied when the button is pressed
  const animationScaleValue = _core.IOScaleEffect[magnitude];
  const scaleAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
    // Scale down button slightly when pressed
    const scale = (0, _reactNativeReanimated.interpolate)(progress.value, [0, 1], [1, animationScaleValue], _reactNativeReanimated.Extrapolation.CLAMP);
    return {
      transform: [{
        scale
      }]
    };
  });
  return {
    progress,
    onPressIn,
    onPressOut,
    scaleAnimatedStyle
  };
};
exports.useScaleAnimation = useScaleAnimation;
//# sourceMappingURL=useScaleAnimation.js.map