UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

33 lines (32 loc) 1.16 kB
import { t as n } from "../../utils-COaoD3PI.js"; import { progressBarFillVariants as p, progressBarTrackVariants as x } from "./ProgressBar.variants.js"; import { jsx as s, jsxs as i } from "react/jsx-runtime"; var w = ({ className: l, fillClassName: r, leftContent: a, percent: c, rightContent: e, status: m, theme: d, trackClassName: t }) => { const h = Math.min(Math.max(c, 0), 100), o = a || e; return /* @__PURE__ */ i("div", { className: n("flex flex-col gap-1 w-full", l), "data-theme": d, children: [o && /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [a && /* @__PURE__ */ s("div", { className: "overflow-hidden text-ellipsis whitespace-nowrap", children: a }), e && /* @__PURE__ */ s("div", { className: "text-right shrink-0", children: e })] }), /* @__PURE__ */ s("div", { className: x({ className: t }), children: /* @__PURE__ */ s("div", { className: p({ status: r ? null : m, className: r }), style: { width: `${h}%` } }) })] }); }; export { w as ProgressBar };