function _extends() { _extends = Object.assign || 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); }

/*
Copyright (c) 2018-2019 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { withStyle } from '../styles/index.js';
import { StyledTable as FlexStyledTable, StyledHeadCell as FlexStyledHeadCell, StyledCell as FlexStyledBodyCell } from '../table/index.js';
var StyledTableElement = withStyle(FlexStyledTable, function (props) {
  return {
    display: 'grid',
    gridTemplateColumns: props.$gridTemplateColumns,
    flexDirection: 'unset'
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledTableElement.displayName = "StyledTableElement";
export var StyledTable = React.forwardRef(function (props, ref) {
  return (//$FlowFixMe
    React.createElement(StyledTableElement, _extends({
      ref: ref,
      "data-baseweb": "table-grid",
      role: "grid"
    }, props))
  ); // eslint-disable-next-line flowtype/no-weak-types
});
StyledTable.__STYLETRON__ = StyledTableElement.__STYLETRON__;
StyledTable.displayName = 'StyledTable';
export var StyledHeadCell = withStyle(FlexStyledHeadCell, function (_ref) {
  var _ref$$sticky = _ref.$sticky,
      $sticky = _ref$$sticky === void 0 ? true : _ref$$sticky,
      $theme = _ref.$theme;
  return {
    backgroundColor: $theme.colors.tableHeadBackgroundColor,
    boxShadow: $theme.lighting.shadow400,
    position: $sticky ? 'sticky' : null,
    top: $sticky ? 0 : null,
    width: 'unset'
  };
});
StyledHeadCell.displayName = "StyledHeadCell";
export var StyledBodyCell = withStyle(FlexStyledBodyCell, function (props) {
  return {
    display: 'block',
    flex: 'unset',
    gridColumn: props.$gridColumn || null,
    gridRow: props.$gridRow || null
  };
});
StyledBodyCell.displayName = "StyledBodyCell";