"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const rem = require("../../core/utils/units-converters/rem.cjs");
require("react");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../core/Box/Box.cjs");
const factory = require("../../core/factory/factory.cjs");
const ScrollArea = require("../ScrollArea/ScrollArea.cjs");
const Table_module_css = require("./Table.module.css.cjs");
const defaultProps = {
  type: "scrollarea"
};
const varsResolver = createVarsResolver.createVarsResolver((_, { minWidth, type }) => ({
  scrollContainer: {
    "--table-min-width": rem.rem(minWidth),
    "--table-overflow": type === "native" ? "auto" : void 0
  }
}));
const TableScrollContainer = factory.factory((_props, ref) => {
  const props = useProps.useProps("TableScrollContainer", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    children,
    minWidth,
    type,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "TableScrollContainer",
    classes: Table_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver,
    rootSelector: "scrollContainer"
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      component: type === "scrollarea" ? ScrollArea.ScrollArea : "div",
      ...type === "scrollarea" ? { offsetScrollbars: "x" } : {},
      ref,
      ...getStyles("scrollContainer"),
      ...others,
      children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...getStyles("scrollContainerInner"), children })
    }
  );
});
TableScrollContainer.classes = Table_module_css.default;
TableScrollContainer.displayName = "@mantine/core/TableScrollContainer";
exports.TableScrollContainer = TableScrollContainer;
