import _defineProperty from "@babel/runtime/helpers/defineProperty";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

import makeStyles from "../../styles/makeStyles";

var styles = function styles(_ref) {
  var _ref$cleverUI = _ref.cleverUI,
      colors = _ref$cleverUI.colors,
      typography = _ref$cleverUI.typography,
      borderRadius = _ref$cleverUI.borderRadius;
  return {
    selected: {},
    sortable: {},
    checkCell: {
      width: 0
    },
    sortIcon: {
      verticalAlign: "middle",
      marginLeft: 4,
      position: "absolute",
      top: "50%",
      transform: "translateY(-50%)"
    },
    container: {
      width: "100%",
      overflow: "auto hidden",
      minHeight: 0
    },
    table: function table(_ref2) {
      var disableSelection = _ref2.disableSelection;
      return {
        width: "100%",
        borderCollapse: "separate",
        backgroundColor: colors.white[500],
        borderSpacing: 0,
        borderRadius: borderRadius.normal,
        overflow: "hidden",
        border: "2px solid ".concat(colors.neutral[300]),
        "& td:first-child, & th:first-child": {
          paddingLeft: 24
        },
        "& td": _objectSpread({
          padding: "10px 16px",
          textAlign: "var(--body-text-align, left)",
          color: colors.neutral[700]
        }, typography.variants.inputText),
        "& tr": {
          cursor: !disableSelection ? "pointer" : "default",
          "&:not(:last-child) td": {
            borderBottom: "1px solid ".concat(colors.neutral[100])
          }
        },
        "& th": _objectSpread(_objectSpread({}, typography.variants.small), {}, {
          padding: "12px 16px",
          verticalAlign: "middle",
          textAlign: "var(--header-text-align, left)",
          color: colors.neutral[400],
          whiteSpace: "nowrap",
          borderBottom: "1px solid ".concat(colors.neutral[300]),
          position: "relative"
        }),
        "& $selected": {
          backgroundColor: colors.neutral[100]
        },
        "& $sortable": {
          paddingRight: 36
        }
      };
    }
  };
};

export default makeStyles(styles);