"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
const getSize = require("../../core/utils/get-size/get-size.cjs");
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 List_context = require("./List.context.cjs");
const ListItem = require("./ListItem/ListItem.cjs");
const List_module_css = require("./List.module.css.cjs");
const defaultProps = {
  type: "unordered"
};
const varsResolver = createVarsResolver.createVarsResolver((_, { size, spacing }) => ({
  root: {
    "--list-fz": getSize.getFontSize(size),
    "--list-lh": getSize.getLineHeight(size),
    "--list-spacing": getSize.getSpacing(spacing)
  }
}));
const List = factory.factory((_props, ref) => {
  const props = useProps.useProps("List", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    children,
    type,
    withPadding,
    icon,
    spacing,
    center,
    listStyleType,
    mod,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "List",
    classes: List_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  return /* @__PURE__ */ jsxRuntime.jsx(List_context.ListProvider, { value: { center, icon, getStyles }, children: /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      ...getStyles("root", { style: { listStyleType } }),
      component: type === "unordered" ? "ul" : "ol",
      mod: [{ "with-padding": withPadding }, mod],
      ref,
      ...others,
      children
    }
  ) });
});
List.classes = List_module_css.default;
List.displayName = "@mantine/core/List";
List.Item = ListItem.ListItem;
exports.List = List;
