'use client';
"use strict";var e=require("tslib"),t=require("react"),r=require("tailwind-merge"),l=require("../../../lib/constants.cjs"),a=require("../../../lib/shape.cjs"),s=require("../../../lib/sizing.cjs"),o=require("../../../lib/spacing.cjs"),i=require("../../../lib/font.cjs"),c=require("../../../lib/theme.cjs"),n=require("../../../lib/utils.cjs"),u=require("../../util-elements/Tooltip/Tooltip.cjs");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=g(t);const f=n.makeClassName("ProgressBar"),d=m.default.forwardRef(((t,g)=>{const{percentageValue:d,label:p,color:b=l.BaseColors.Blue,tooltip:w,showAnimation:h=!0,className:j}=t,C=e.__rest(t,["percentageValue","label","color","tooltip","showAnimation","className"]),N=n.getColorClassNames(b,c.colorPalette.background).bgColor,q=n.getColorClassNames(b,c.colorPalette.lightBackground).bgColor,{tooltipProps:x,getReferenceProps:E}=u.useTooltip();return m.default.createElement(m.default.Fragment,null,m.default.createElement(u.default,Object.assign({text:w},x)),m.default.createElement("div",Object.assign({ref:g,className:r.twMerge(f("root"),"flex items-center w-full",j)},C),m.default.createElement("div",Object.assign({ref:x.refs.setReference,className:r.twMerge(f("progressBarWrapper"),"relative flex items-center w-full",q,s.sizing.xs.height,a.borderRadius.lg.all)},E),m.default.createElement("div",{className:r.twMerge(f("progressBar"),N,"flex-col h-full",a.borderRadius.lg.all),style:{width:`${d}%`,transition:h?"all 2s":""}})),p?m.default.createElement("div",{className:r.twMerge(f("labelWrapper"),"w-16 truncate text-right",n.getColorClassNames(c.DEFAULT_COLOR,c.colorPalette.darkText).textColor,o.spacing.sm.marginLeft)},m.default.createElement("p",{className:r.twMerge(f("label"),"shrink-0 whitespace-nowrap truncate",i.fontSize.sm,i.fontWeight.sm)},p)):null))}));d.displayName="ProgressBar",module.exports=d;
