"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
require("clsx");
const getThemeColor = require("../../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
const getContrastColor = require("../../../core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs");
const getAutoContrastValue = require("../../../core/MantineProvider/color-functions/get-auto-contrast-value/get-auto-contrast-value.cjs");
const MantineThemeProvider = require("../../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
const useProps = require("../../../core/MantineProvider/use-props/use-props.cjs");
const Box = require("../../../core/Box/Box.cjs");
const factory = require("../../../core/factory/factory.cjs");
const Progress_context = require("../Progress.context.cjs");
const Progress_module_css = require("../Progress.module.css.cjs");
const defaultProps = {
  withAria: true
};
const ProgressSection = factory.factory((props, ref) => {
  const {
    classNames,
    className,
    style,
    styles,
    vars,
    value,
    withAria,
    color,
    striped,
    animated,
    mod,
    ...others
  } = useProps.useProps("ProgressSection", defaultProps, props);
  const ctx = Progress_context.useProgressContext();
  const theme = MantineThemeProvider.useMantineTheme();
  const ariaAttributes = withAria ? {
    role: "progressbar",
    "aria-valuemax": 100,
    "aria-valuemin": 0,
    "aria-valuenow": value,
    "aria-valuetext": `${value}%`
  } : {};
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      ref,
      ...ctx.getStyles("section", { className, classNames, styles, style }),
      ...others,
      ...ariaAttributes,
      mod: [{ striped: striped || animated, animated }, mod],
      __vars: {
        "--progress-section-width": `${value}%`,
        "--progress-section-color": getThemeColor.getThemeColor(color, theme),
        "--progress-label-color": getAutoContrastValue.getAutoContrastValue(ctx.autoContrast, theme) ? getContrastColor.getContrastColor({ color, theme, autoContrast: ctx.autoContrast }) : void 0
      }
    }
  );
});
ProgressSection.classes = Progress_module_css.default;
ProgressSection.displayName = "@mantine/core/ProgressSection";
exports.ProgressSection = ProgressSection;
