@stratakit/react
Version:
A React component library for StrataKit
38 lines (37 loc) • 1.09 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import * as React from "react";
import {
ProgressBar as SkProgressBar,
VisuallyHidden
} from "@stratakit/bricks";
import { useCompatProps } from "./~utils.js";
const ProgressLinear = React.forwardRef((props, forwardedRef) => {
const {
value,
indeterminate,
labels,
// biome-ignore-start lint/correctness/noUnusedVariables: NOT IMPLEMENTED
isAnimated,
// NO-OP
status,
labelGroupProps,
// biome-ignore-end lint/correctness/noUnusedVariables: NOT IMPLEMENTED
...rest
} = useCompatProps(props);
const labelledBy = React.useId();
const fallbackLoadingText = value !== 100 ? "Loading\u2026" : void 0;
return /* @__PURE__ */ jsx(
SkProgressBar,
{
...rest,
value: indeterminate === true ? void 0 : value,
ref: forwardedRef,
"aria-labelledby": labelledBy,
children: /* @__PURE__ */ jsx(VisuallyHidden, { id: labelledBy, children: labels?.join(" ") ?? fallbackLoadingText })
}
);
});
DEV: ProgressLinear.displayName = "ProgressLinear";
export {
ProgressLinear
};