import './Table.styles_w271lb.css';
import { styled } from '@linaria/react';
import { tableTokens } from './Table.tokens.js';
import { component, mergeConfig } from '../../engines/common.js';
import { checkboxConfig } from '../Checkbox/Checkbox.js';
import { linkButtonConfig } from '../LinkButton/LinkButton.js';
import { buttonConfig } from '../Button/Button.js';
import { dividerConfig } from '../Divider/Divider.js';

var mergedCheckboxConfig = /*#__PURE__*/mergeConfig(checkboxConfig);
var Checkbox = /*#__PURE__*/component(mergedCheckboxConfig);
var mergedButtonConfig = /*#__PURE__*/mergeConfig(buttonConfig);
var ButtonBase = /*#__PURE__*/component(mergedButtonConfig);
var mergedDividerConfig = /*#__PURE__*/mergeConfig(dividerConfig);
var Divider = /*#__PURE__*/component(mergedDividerConfig);
var mergedLinkButtonConfig = /*#__PURE__*/mergeConfig(linkButtonConfig);
var LinkButtonBase = /*#__PURE__*/component(mergedLinkButtonConfig);
var base = "bdg5k54";
var _exp = function _exp() {
  return function (_ref) {
    var maxHeight = _ref.maxHeight;
    return maxHeight || 'none';
  };
};
var ScrollableWrapper = /*#__PURE__*/styled('div')({
  name: "ScrollableWrapper",
  "class": "s1ks68yx",
  propsAsIs: false,
  vars: {
    "s1ks68yx-0": [/*#__PURE__*/_exp()]
  }
});
var _exp8 = function _exp8() {
  return function (_ref2) {
    var borderVariant = _ref2.borderVariant;
    return borderVariant === 'all' ? "var(".concat(tableTokens.borderColor, ")") : 'transparent';
  };
};
var Table = /*#__PURE__*/styled('table')({
  name: "Table",
  "class": "t3jc518",
  propsAsIs: false,
  vars: {
    "t3jc518-0": [/*#__PURE__*/_exp8()]
  }
});
var _exp9 = function _exp9() {
  return function (_ref3) {
    var selected = _ref3.selected;
    return selected ? 'var(--surface-transparent-accent)' : 'transparent';
  };
};
var Tr = /*#__PURE__*/styled('tr')({
  name: "Tr",
  "class": "tc5umjj",
  propsAsIs: false,
  vars: {
    "tc5umjj-0": [/*#__PURE__*/_exp9()]
  }
});
var _exp0 = function _exp0() {
  return function (_ref4) {
    var stickyHeader = _ref4.stickyHeader;
    return stickyHeader ? 'sticky' : 'static';
  };
};
var _exp1 = function _exp1() {
  return function (_ref5) {
    var stickyHeader = _ref5.stickyHeader;
    return stickyHeader ? 'var(--background-primary)' : 'transparent';
  };
};
var _exp10 = function _exp10() {
  return function (_ref6) {
    var view = _ref6.view,
      borderVariant = _ref6.borderVariant;
    return (
      // eslint-disable-next-line no-nested-ternary
      view === 'clear' ? 'none' : borderVariant === 'header' || borderVariant === 'rows' ? "inset 0 -1px 0 0 var(".concat(tableTokens.borderColor, ")") : "inset 0 1px 0 0 var(".concat(tableTokens.borderColor, "), inset 0 -1px 0 0 var(").concat(tableTokens.borderColor, ")")
    );
  };
};
var Thead = /*#__PURE__*/styled('thead')({
  name: "Thead",
  "class": "t4abfbn",
  propsAsIs: false,
  vars: {
    "t4abfbn-0": [/*#__PURE__*/_exp0()],
    "t4abfbn-1": [/*#__PURE__*/_exp1()],
    "t4abfbn-2": [/*#__PURE__*/_exp10()]
  }
});
var Tbody = /*#__PURE__*/styled('tbody')({
  name: "Tbody",
  "class": "tjbd66p",
  propsAsIs: false
});
var _exp12 = function _exp12() {
  return function (_ref7) {
    var isResizing = _ref7.isResizing;
    return isResizing ? 'block' : 'none';
  };
};
var Resizer = /*#__PURE__*/styled('div')({
  name: "Resizer",
  "class": "r1517kog",
  propsAsIs: false,
  vars: {
    "r1517kog-0": [/*#__PURE__*/_exp12()]
  }
});
var _exp13 = function _exp13() {
  return function (_ref8) {
    var selectionCell = _ref8.selectionCell;
    return selectionCell ? "var(".concat(tableTokens.checkboxCellPadding, ")") : "var(".concat(tableTokens.cellPadding, ")");
  };
};
var _exp15 = function _exp15() {
  return function (_ref9) {
    var borderVariant = _ref9.borderVariant;
    return borderVariant === 'all' ? "var(".concat(tableTokens.borderColor, ")") : 'transparent';
  };
};
var Th = /*#__PURE__*/styled('th')({
  name: "Th",
  "class": "trp23jz",
  propsAsIs: false,
  vars: {
    "trp23jz-0": [/*#__PURE__*/_exp13()],
    "trp23jz-1": [/*#__PURE__*/_exp15()]
  }
});
var _exp17 = function _exp17() {
  return Checkbox;
};
var StyledCheckbox = /*#__PURE__*/styled(_exp17())({
  name: "StyledCheckbox",
  "class": "sz9n7nt",
  propsAsIs: true
});
var _exp32 = function _exp32() {
  return Divider;
};
var StyledDivider = /*#__PURE__*/styled(_exp32())({
  name: "StyledDivider",
  "class": "su0zpxc",
  propsAsIs: true
});
var _exp36 = function _exp36() {
  return ButtonBase;
};
var Button = /*#__PURE__*/styled(_exp36())({
  name: "Button",
  "class": "bcgjuxx",
  propsAsIs: true
});
var _exp52 = function _exp52() {
  return Button;
};
var ButtonAccent = /*#__PURE__*/styled(_exp52())({
  name: "ButtonAccent",
  "class": "bngqsow",
  propsAsIs: true
});
var _exp58 = function _exp58() {
  return LinkButtonBase;
};
var LinkButton = /*#__PURE__*/styled(_exp58())({
  name: "LinkButton",
  "class": "l12ld1fb",
  propsAsIs: true
});

export { Button, ButtonAccent, LinkButton, Resizer, ScrollableWrapper, StyledCheckbox, StyledDivider, Table, Tbody, Th, Thead, Tr, base };
