"use client";
const require_rem = require("../../core/utils/units-converters/rem.cjs");
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
const require_create_vars_resolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
const require_get_theme_color = require("../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
const require_use_props = require("../../core/MantineProvider/use-props/use-props.cjs");
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_Box = require("../../core/Box/Box.cjs");
const require_Table_context = require("./Table.context.cjs");
const require_Table_module = require("./Table.module.cjs");
const require_Table_components = require("./Table.components.cjs");
const require_TableDataRenderer = require("./TableDataRenderer.cjs");
const require_TableScrollContainer = require("./TableScrollContainer.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Table/Table.tsx
const defaultProps = {
	withRowBorders: true,
	verticalSpacing: 7
};
const varsResolver = require_create_vars_resolver.createVarsResolver((theme, { layout, captionSide, horizontalSpacing, verticalSpacing, borderColor, stripedColor, highlightOnHoverColor, striped, highlightOnHover, stickyHeaderOffset, stickyHeader }) => ({ table: {
	"--table-layout": layout,
	"--table-caption-side": captionSide,
	"--table-horizontal-spacing": require_get_size.getSpacing(horizontalSpacing),
	"--table-vertical-spacing": require_get_size.getSpacing(verticalSpacing),
	"--table-border-color": borderColor ? require_get_theme_color.getThemeColor(borderColor, theme) : void 0,
	"--table-striped-color": striped && stripedColor ? require_get_theme_color.getThemeColor(stripedColor, theme) : void 0,
	"--table-highlight-on-hover-color": highlightOnHover && highlightOnHoverColor ? require_get_theme_color.getThemeColor(highlightOnHoverColor, theme) : void 0,
	"--table-sticky-header-offset": stickyHeader ? require_rem.rem(stickyHeaderOffset) : void 0
} }));
const Table = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Table", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, horizontalSpacing, verticalSpacing, captionSide, stripedColor, highlightOnHoverColor, striped, highlightOnHover, withColumnBorders, withRowBorders, withTableBorder, borderColor, layout, data, children, stickyHeader, stickyHeaderOffset, mod, tabularNums, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Table",
		props,
		className,
		style,
		classes: require_Table_module.default,
		classNames,
		styles,
		unstyled,
		attributes,
		rootSelector: "table",
		vars,
		varsResolver
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Table_context.TableProvider, {
		value: {
			getStyles,
			stickyHeader,
			striped: striped === true ? "odd" : striped || void 0,
			highlightOnHover,
			withColumnBorders,
			withRowBorders,
			captionSide: captionSide || "bottom"
		},
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
			component: "table",
			mod: [{
				"data-with-table-border": withTableBorder,
				"data-tabular-nums": tabularNums
			}, mod],
			...getStyles("table"),
			...others,
			children: children || !!data && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TableDataRenderer.TableDataRenderer, { data })
		})
	});
});
Table.classes = require_Table_module.default;
Table.varsResolver = varsResolver;
Table.displayName = "@mantine/core/Table";
Table.Td = require_Table_components.TableTd;
Table.Th = require_Table_components.TableTh;
Table.Tr = require_Table_components.TableTr;
Table.Thead = require_Table_components.TableThead;
Table.Tbody = require_Table_components.TableTbody;
Table.Tfoot = require_Table_components.TableTfoot;
Table.Caption = require_Table_components.TableCaption;
Table.ScrollContainer = require_TableScrollContainer.TableScrollContainer;
Table.DataRenderer = require_TableDataRenderer.TableDataRenderer;
//#endregion
exports.Table = Table;

//# sourceMappingURL=Table.cjs.map