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 { styled } from '../styles/index.js';
const StyledTableElement = styled('div', ({
  $theme
}) => {
  return { ...$theme.borders.border300,
    backgroundColor: $theme.colors.tableBackground,
    borderTopLeftRadius: $theme.borders.radius200,
    borderTopRightRadius: $theme.borders.radius200,
    borderBottomRightRadius: $theme.borders.radius200,
    borderBottomLeftRadius: $theme.borders.radius200,
    display: 'flex',
    flexDirection: 'column',
    height: '100%',
    overflowX: 'scroll'
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledTableElement.displayName = "StyledTableElement";
export const StyledTable = React.forwardRef((props, ref) => {
  return React.createElement(StyledTableElement, _extends({
    ref: ref,
    "data-baseweb": "table-custom",
    role: "grid"
  }, props)); // eslint-disable-next-line flowtype/no-weak-types
});
StyledTable.__STYLETRON__ = StyledTableElement.__STYLETRON__;
StyledTable.displayName = 'StyledTable';
const StyledHeadElement = styled('div', ({
  $theme,
  $width
}) => {
  return {
    backgroundColor: $theme.colors.tableHeadBackgroundColor,
    boxShadow: $theme.lighting.shadow400,
    display: 'flex',
    flexGrow: 0,
    width: $width ? $width : '100%'
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledHeadElement.displayName = "StyledHeadElement";
export const StyledHead = React.forwardRef((props, ref) => React.createElement(StyledHeadElement, _extends({
  ref: ref,
  role: "row"
}, props)) // eslint-disable-next-line flowtype/no-weak-types
);
StyledHead.__STYLETRON__ = StyledHeadElement.__STYLETRON__;
StyledHead.displayName = 'StyledHead';
const StyledHeadCellElement = styled('div', ({
  $theme,
  $cursor
}) => {
  return { ...$theme.typography.font350,
    ...$theme.borders.border300,
    borderTop: 'none',
    borderBottom: 'none',
    borderLeft: 'none',
    color: $theme.colors.colorPrimary,
    display: 'flex',
    justifyContent: 'space-between',
    paddingTop: $theme.sizing.scale500,
    paddingRight: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale500,
    paddingLeft: $theme.sizing.scale600,
    cursor: $cursor ? $cursor : 'inherit',
    width: '100%',
    ':last-of-type': {
      borderRight: 'none'
    }
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledHeadCellElement.displayName = "StyledHeadCellElement";
export const StyledHeadCell = React.forwardRef((props, ref) => React.createElement(StyledHeadCellElement, _extends({
  ref: ref,
  role: "columnheader"
}, props)) // eslint-disable-next-line flowtype/no-weak-types
);
StyledHeadCell.__STYLETRON__ = StyledHeadCellElement.__STYLETRON__;
StyledHeadCell.displayName = 'StyledHeadCell';
export const StyledSortableLabel = styled('button', ({
  $theme
}) => {
  return { ...$theme.typography.font250,
    alignItems: 'center',
    backgroundColor: 'transparent',
    border: 'none',
    color: $theme.colors.colorPrimary,
    display: 'flex',
    padding: 0,
    ':hover:enabled': {
      cursor: 'pointer'
    },
    ':disabled': {
      color: $theme.colors.mono500
    }
  };
});
StyledSortableLabel.displayName = "StyledSortableLabel";
const StyledBodyElement = styled('div', ({
  $width
}) => {
  return {
    width: $width ? $width : '100%',
    overflowX: 'hidden',
    overflowY: 'overlay',
    flex: 1
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledBodyElement.displayName = "StyledBodyElement";
export const StyledBody = React.forwardRef((props, ref) => React.createElement(StyledBodyElement, _extends({
  ref: ref,
  role: "rowgroup"
}, props)) // eslint-disable-next-line flowtype/no-weak-types
);
StyledBody.__STYLETRON__ = StyledBodyElement.__STYLETRON__;
StyledBody.displayName = 'StyledBody';
const StyledRowElement = styled('div', {
  display: 'flex',
  alignItems: 'center'
}); // eslint-disable-next-line flowtype/no-weak-types

StyledRowElement.displayName = "StyledRowElement";
export const StyledRow = React.forwardRef((props, ref) => React.createElement(StyledRowElement, _extends({
  ref: ref,
  role: "row"
}, props)) // eslint-disable-next-line flowtype/no-weak-types
);
StyledRow.__STYLETRON__ = StyledRowElement.__STYLETRON__;
StyledRow.displayName = 'StyledRow';
const StyledCellElement = styled('div', ({
  $theme,
  $striped
}) => {
  return { ...$theme.typography.font200,
    backgroundColor: $striped ? $theme.colors.tableStripedBackground : null,
    color: $theme.colors.colorPrimary,
    display: 'flex',
    flex: 1,
    paddingTop: $theme.sizing.scale300,
    paddingRight: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale300,
    paddingLeft: $theme.sizing.scale600
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledCellElement.displayName = "StyledCellElement";
export const StyledCell = React.forwardRef((props, ref) => React.createElement(StyledCellElement, _extends({
  ref: ref,
  role: "gridcell"
}, props)) // eslint-disable-next-line flowtype/no-weak-types
);
StyledCell.__STYLETRON__ = StyledCellElement.__STYLETRON__;
StyledCell.displayName = 'StyledCell';
export const StyledFilterButton = styled('button', {
  backgroundColor: 'transparent',
  border: 'none',
  paddingTop: 'none',
  paddingRight: 'none',
  paddingBottom: 'none',
  paddingLeft: 'none'
});
StyledFilterButton.displayName = "StyledFilterButton";
export const StyledFilterContent = styled('div', ({
  $theme
}) => ({ ...$theme.borders.border300,
  backgroundColor: $theme.colors.tableFilterBackground,
  borderRight: 'none',
  borderLeft: 'none',
  maxHeight: '196px',
  paddingRight: $theme.sizing.scale600,
  paddingLeft: $theme.sizing.scale600,
  overflow: 'auto'
}));
StyledFilterContent.displayName = "StyledFilterContent";
export const StyledFilterHeading = styled('div', ({
  $theme
}) => ({ ...$theme.typography.font250,
  color: $theme.colors.tableFilterHeading,
  paddingTop: $theme.sizing.scale500,
  paddingRight: $theme.sizing.scale600,
  paddingBottom: $theme.sizing.scale500,
  paddingLeft: $theme.sizing.scale600
}));
StyledFilterHeading.displayName = "StyledFilterHeading";
export const StyledFilterFooter = styled('div', ({
  $theme
}) => ({
  backgroundColor: $theme.colors.tableFilterFooterBackground,
  paddingTop: $theme.sizing.scale300,
  paddingRight: $theme.sizing.scale100,
  paddingBottom: $theme.sizing.scale300,
  paddingLeft: $theme.sizing.scale100,
  display: 'flex',
  justifyContent: 'space-between',
  minWidth: '216px'
}));
StyledFilterFooter.displayName = "StyledFilterFooter";
export const StyledAction = styled('button', ({
  $theme
}) => {
  return {
    backgroundColor: 'transparent',
    border: 'none',
    color: $theme.colors.primary,
    paddingTop: 0,
    paddingRight: 0,
    paddingBottom: 0,
    paddingLeft: 0,
    marginRight: $theme.sizing.scale100,
    marginLeft: $theme.sizing.scale100,
    ':hover:enabled': {
      cursor: 'pointer'
    }
  };
});
StyledAction.displayName = "StyledAction";