function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from "react";
import { Animated, StyleSheet } from "react-native";
import shadow from "../styles/shadow";
import { withTheme } from "../core/theming";
import overlay from "../styles/overlay";
const Surface = /*#__PURE__*/React.forwardRef((props, ref) => {
  const {
    style,
    theme,
    ...rest
  } = props;
  const {
    elevation = 0
  } = StyleSheet.flatten(style) || {};
  const {
    dark: isDarkTheme,
    mode,
    colors
  } = theme;
  return /*#__PURE__*/React.createElement(Animated.View, _extends({
    ref: ref
  }, rest, {
    style: [{
      backgroundColor: isDarkTheme && mode === "adaptive" ? overlay(elevation, colors.surface) : colors.surface
    }, elevation ? shadow(elevation) : null, style]
  }));
});
export default withTheme(Surface);
//# sourceMappingURL=Surface.js.map