import styled from "@emotion/styled";
import { css } from "@emotion/react";
import { component, mergeConfig } from "../../engines";
import { checkboxConfig, checkboxTokens } from "../Checkbox";
import { dividerConfig, dividerTokens } from "../Divider";
import { buttonConfig, buttonTokens } from "../Button";
import { linkButtonConfig, linkButtonTokens } from "../LinkButton";
import { tableTokens as tokens } from "./Table.tokens";
const mergedCheckboxConfig = mergeConfig(checkboxConfig);
const Checkbox = component(mergedCheckboxConfig);
const mergedButtonConfig = mergeConfig(buttonConfig);
const ButtonBase = component(mergedButtonConfig);
const mergedDividerConfig = mergeConfig(dividerConfig);
const Divider = component(mergedDividerConfig);
const mergedLinkButtonConfig = mergeConfig(linkButtonConfig);
const LinkButtonBase = component(mergedLinkButtonConfig);
export const base = /*#__PURE__*/ css("display:inline-flex;flex-direction:column;align-items:flex-start;", "base");
export const ScrollableWrapper = /*#__PURE__*/ styled("div", {
    target: "e1319rer0",
    label: "ScrollableWrapper"
})("overflow-y:auto;max-height:", ({ maxHeight })=>maxHeight || 'none', ";");
export const Table = /*#__PURE__*/ styled("table", {
    target: "e1319rer1",
    label: "Table"
})("width:fit-content;font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");border-collapse:collapse;border-width:0;border-style:solid;border-color:", ({ borderVariant })=>borderVariant === 'all' ? `var(${tokens.borderColor})` : 'transparent', ";");
export const Tr = /*#__PURE__*/ styled("tr", {
    target: "e1319rer2",
    label: "Tr"
})("box-sizing:content-box;width:fit-content;background-color:", ({ selected })=>selected ? 'var(--surface-transparent-accent)' : 'transparent', ";");
export const Thead = /*#__PURE__*/ styled("thead", {
    target: "e1319rer3",
    label: "Thead"
})("position:", ({ stickyHeader })=>stickyHeader ? 'sticky' : 'static', ";top:0;background:", ({ stickyHeader })=>stickyHeader ? 'var(--background-primary)' : 'transparent', ";z-index:10;box-shadow:", ({ view, borderVariant })=>// eslint-disable-next-line no-nested-ternary
    view === 'clear' ? 'none' : borderVariant === 'header' || borderVariant === 'rows' ? `inset 0 -1px 0 0 var(${tokens.borderColor})` : `inset 0 1px 0 0 var(${tokens.borderColor}), inset 0 -1px 0 0 var(${tokens.borderColor})`, ";", Tr, "{background:transparent;}");
export const Tbody = /*#__PURE__*/ styled("tbody", {
    target: "e1319rer4",
    label: "Tbody"
})();
export const Resizer = /*#__PURE__*/ styled("div", {
    target: "e1319rer5",
    label: "Resizer"
})("display:", ({ isResizing })=>isResizing ? 'block' : 'none', ";position:absolute;z-index:1;top:-0.0625rem;bottom:0;right:-0.125rem;width:0.1875rem;background:var(--outline-accent);cursor:col-resize;user-select:none;touch-action:none;");
export const Th = /*#__PURE__*/ styled("th", {
    target: "e1319rer6",
    label: "Th"
})("padding:", ({ selectionCell })=>selectionCell ? `var(${tokens.checkboxCellPadding})` : `var(${tokens.cellPadding})`, ";position:relative;font-weight:600;text-align:left;height:var(", tokens.headerRowHeight, ");background-color:transparent;color:inherit;box-sizing:content-box;border-width:0.0625rem;border-top-width:0;border-bottom-width:0;border-style:solid;border-color:", ({ borderVariant })=>borderVariant === 'all' ? `var(${tokens.borderColor})` : 'transparent', ";box-sizing:border-box;&:hover{", Resizer, "{display:block;}}");
export const StyledCheckbox = /*#__PURE__*/ styled(Checkbox, {
    target: "e1319rer7",
    label: "StyledCheckbox"
})(checkboxTokens.triggerSize, ":var(", tokens.checkboxTriggerSize, ");", checkboxTokens.triggerBorderRadius, ":var(", tokens.checkboxTriggerBorderRadius, ");", checkboxTokens.fillColor, ":var(", tokens.checkboxFillColor, ");", checkboxTokens.iconColor, ":var(", tokens.checkboxTriggerIconColor, ");", checkboxTokens.triggerBorderCheckedColor, ":var(", tokens.checkboxTriggerBorderCheckedColor, ");", checkboxTokens.triggerBorderWidth, ":var(", tokens.checkboxTriggerBorderWidth, ");", checkboxTokens.triggerBorderColor, ":var(", tokens.checkboxTriggerBorderColor, ");");
export const StyledDivider = /*#__PURE__*/ styled(Divider, {
    target: "e1319rer8",
    label: "StyledDivider"
})(dividerTokens.baseSideSize, ":0.0625rem;", dividerTokens.background, ":var(--surface-transparent-tertiary);", dividerTokens.borderRadius, ":0.0625rem;");
export const Button = /*#__PURE__*/ styled(ButtonBase, {
    target: "e1319rer9",
    label: "Button"
})(buttonTokens.buttonHeight, ":var(", tokens.buttonHeight, ");", buttonTokens.buttonDisabledOpacity, ":0.4;", buttonTokens.buttonFontFamily, ":var(", tokens.buttonFontFamily, ");", buttonTokens.buttonFontSize, ":var(", tokens.buttonFontSize, ");", buttonTokens.buttonFontStyle, ":var(", tokens.buttonFontStyle, ");", buttonTokens.buttonFontWeight, ":var(", tokens.buttonFontWeight, ");", buttonTokens.buttonLetterSpacing, ":var(", tokens.buttonLetterSpacing, ");", buttonTokens.buttonLineHeight, ":var(", tokens.buttonLineHeight, ");");
export const ButtonAccent = /*#__PURE__*/ styled(Button, {
    target: "e1319rer10",
    label: "ButtonAccent"
})(buttonTokens.buttonColor, ":var(--on-dark-text-primary);", buttonTokens.buttonValueColor, ":var(--on-dark-text-secondary);", buttonTokens.buttonBackgroundColor, ":var(--surface-accent);", buttonTokens.buttonBackgroundColorHover, ":var(--surface-accent-hover);", buttonTokens.buttonBackgroundColorActive, ":var(--surface-accent-active);");
export const LinkButton = /*#__PURE__*/ styled(LinkButtonBase, {
    target: "e1319rer11",
    label: "LinkButton"
})(linkButtonTokens.linkButtonIconColor, ":var(--text-primary);", linkButtonTokens.linkButtonTextColor, ":var(--text-primary);", linkButtonTokens.linkButtonBackgroundColor, ":var(--surface-transparent-clear);", linkButtonTokens.linkButtonIconColorHover, ":var(--text-primary-hover);", linkButtonTokens.linkButtonIconColorActive, ":var(--text-primary-active);", linkButtonTokens.linkButtonTextColorHover, ":var(--text-primary-hover);", linkButtonTokens.linkButtonTextColorActive, ":var(--text-primary-active);", linkButtonTokens.linkButtonFocusColor, ":var(--surface-accent);", linkButtonTokens.linkButtonFontFamily, ":var(", tokens.linkButtonFontFamily, ");", linkButtonTokens.linkButtonFontSize, ":var(", tokens.linkButtonFontSize, ");", linkButtonTokens.linkButtonFontStyle, ":var(", tokens.linkButtonFontStyle, ");", linkButtonTokens.linkButtonFontWeight, ":var(", tokens.linkButtonFontWeight, ");", linkButtonTokens.linkButtonLetterSpacing, ":var(", tokens.linkButtonLetterSpacing, ");", linkButtonTokens.linkButtonLineHeight, ":var(", tokens.linkButtonLineHeight, ");");
