@cerberus-design/react
Version:
The Cerberus Design React component library.
35 lines (33 loc) • 855 B
JavaScript
import {
ProgressBarBar,
ProgressBarRoot
} from "./chunk-4SOUI4NF.js";
// src/components/progress/progress-bar.tsx
import { jsx } from "react/jsx-runtime";
function ProgressBar(props) {
const { indeterminate, now, label, ...nativeProps } = props;
const nowClamped = Math.min(100, Math.max(0, now || 0));
const width = {
width: indeterminate ? "50%" : `${nowClamped}%`
};
return /* @__PURE__ */ jsx(
ProgressBarRoot,
{
...nativeProps,
"aria-label": label,
"aria-valuenow": indeterminate ? 0 : nowClamped,
children: /* @__PURE__ */ jsx(
ProgressBarBar,
{
...indeterminate && { "data-state": "indeterminate" },
"data-complete": nowClamped === 100,
style: width
}
)
}
);
}
export {
ProgressBar
};
//# sourceMappingURL=chunk-BHZN6P2K.js.map