UNPKG

@konstructio/ui

Version:

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

31 lines (30 loc) 967 B
import { jsxs as i, jsx as a } from "react/jsx-runtime"; import { cn as o } from "../../utils/index.js"; import { progressBarProgress as l, progressBarVariants as d } from "./ProgressBar.variants.js"; const f = ({ label: r, theme: e, percent: s, status: t }) => /* @__PURE__ */ i("div", { className: "w-full", "data-theme": e, children: [ /* @__PURE__ */ i("div", { className: o("flex", r ? "justify-between" : "justify-end"), children: [ r ? /* @__PURE__ */ a("label", { className: "font-semibold", children: r }) : null, /* @__PURE__ */ i("span", { className: "font-semibold", children: [ s, "%" ] }) ] }), /* @__PURE__ */ a("div", { className: o(d()), children: /* @__PURE__ */ a( "div", { className: o( l({ status: t }), s > 0 && s < 99 ? "transition-width duration-500" : "transition-colors duration-0" ), style: { width: `${s}%` } } ) }) ] }); export { f as ProgressBar };