@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
51 lines (50 loc) • 1.95 kB
JavaScript
"use client";
import { getRadius, getSize } from "../../../core/utils/get-size/get-size.mjs";
import { createVarsResolver } from "../../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs";
import { useStyles } from "../../../core/styles-api/use-styles/use-styles.mjs";
import { factory } from "../../../core/factory/factory.mjs";
import { Box } from "../../../core/Box/Box.mjs";
import { ProgressProvider } from "../Progress.context.mjs";
import Progress_module_default from "../Progress.module.mjs";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Progress/ProgressRoot/ProgressRoot.tsx
const varsResolver = createVarsResolver((_, { size, radius, transitionDuration }) => ({ root: {
"--progress-size": getSize(size, "progress-size"),
"--progress-radius": radius === void 0 ? void 0 : getRadius(radius),
"--progress-transition-duration": typeof transitionDuration === "number" ? `${transitionDuration}ms` : void 0
} }));
const ProgressRoot = factory((_props) => {
const props = useProps("ProgressRoot", null, _props);
const { classNames, className, style, styles, unstyled, vars, autoContrast, transitionDuration, orientation, attributes, mod, ...others } = props;
const getStyles = useStyles({
name: "Progress",
classes: Progress_module_default,
props,
className,
style,
classNames,
styles,
unstyled,
attributes,
vars,
varsResolver
});
return /* @__PURE__ */ jsx(ProgressProvider, {
value: {
getStyles,
autoContrast
},
children: /* @__PURE__ */ jsx(Box, {
mod: [{ orientation }, mod],
...getStyles("root"),
...others
})
});
});
ProgressRoot.classes = Progress_module_default;
ProgressRoot.varsResolver = varsResolver;
ProgressRoot.displayName = "@mantine/core/ProgressRoot";
//#endregion
export { ProgressRoot };
//# sourceMappingURL=ProgressRoot.mjs.map