"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useInteractionState = useInteractionState;
exports.useInteractionStates = useInteractionStates;
var _react = require("react");
function useInteractionState() {
  const [state, setState] = (0, _react.useState)(false);
  const onIn = (0, _react.useCallback)(() => {
    setState(true);
  }, []);
  const onOut = (0, _react.useCallback)(() => {
    setState(false);
  }, []);
  return {
    state,
    onIn,
    onOut
  };
}

/**
 * Tracks multiple interaction states (hovered, focused, pressed) in one hook.
 *
 * Returns stable handler objects suitable for spreading onto Pressable-like components.
 * On web, `hoverHandlers` can be spread as `onMouseEnter`/`onMouseLeave`.
 */
function useInteractionStates() {
  const {
    state: hovered,
    onIn: onHoverIn,
    onOut: onHoverOut
  } = useInteractionState();
  const {
    state: focused,
    onIn: onFocus,
    onOut: onBlur
  } = useInteractionState();
  const {
    state: pressed,
    onIn: onPressIn,
    onOut: onPressOut
  } = useInteractionState();
  return {
    hovered,
    focused,
    pressed,
    hoverHandlers: {
      onHoverIn,
      onHoverOut
    },
    focusHandlers: {
      onFocus,
      onBlur
    },
    pressHandlers: {
      onPressIn,
      onPressOut
    }
  };
}
//# sourceMappingURL=useInteractionState.js.map