import { t as Icon_default } from "./Icon.js";
import { t as Button_default } from "./Button.js";
import { t as ChevronDown_default } from "./ChevronDown.js";
import { t as ChevronUp_default } from "./ChevronUp.js";
import { t as ModeType } from "./Table.js";
import React from "react";
import classNames from "classnames";
import { jsx, jsxs } from "react/jsx-runtime";
import tableStyles from "./components/Table/styles.module.scss";
var TableExpanderCellMobile = ({ expanded, onClick, hideDetailsText, showDetailsText, mode = ModeType.normal }) => {
	return /* @__PURE__ */ jsx("td", {
		className: classNames(tableStyles.table__cell, tableStyles["table__expander-cell-mobile"], {
			[tableStyles["table__expander-cell-mobile--expanded"]]: expanded,
			[tableStyles["table__cell--compact"]]: mode === ModeType.compact
		}),
		children: /* @__PURE__ */ jsxs(Button_default, {
			"aria-expanded": expanded,
			variant: "borderless",
			onClick,
			children: [
				/* @__PURE__ */ jsx(Icon_default, { svgIcon: expanded ? ChevronUp_default : ChevronDown_default }),
				" ",
				expanded ? hideDetailsText : showDetailsText
			]
		})
	});
};
var TableExpanderCellMobile_default = TableExpanderCellMobile;
const TableRow = ({ rowKey, hideDetailsText, showDetailsText, expandable, expanded, onClick, className, children, mode = ModeType.normal, ...rest }) => {
	return /* @__PURE__ */ jsxs("tr", {
		className: classNames(tableStyles["table-row"], { [tableStyles["table__row--expandable"]]: expandable }, className),
		onClick,
		...rest,
		children: [React.Children.map(children, (child) => React.isValidElement(child) && React.cloneElement(child, { mode })), expandable && /* @__PURE__ */ jsx(TableExpanderCellMobile_default, {
			expanded,
			onClick,
			hideDetailsText,
			showDetailsText,
			mode
		})]
	}, rowKey);
};
var TableRow_default$1 = TableRow;
export { TableRow as n, TableRow_default$1 as t };

//# sourceMappingURL=TableRow.js.map