import{j as p}from"./jsx-runtime-5BUNAZ9W.js";import{c as w}from"./cn-466VSCev.js";import{$ as x,_ as b}from"./index-VfKohXEB.js";import{r as d}from"./index-4g5l5LRQ.js";import{$ as I}from"./index-tktZLsKA.js";import"./extends-dGVwEr9R.js";import"./index-zaNpaTzt.js";import"./_commonjsHelpers-4gQjN7DL.js";import"./index-dNGI4_9C.js";const _="Progress",$=100,[M,H]=I(_),[R,S]=M(_),P=d.forwardRef((e,r)=>{const{__scopeProgress:t,value:a,max:s,getValueLabel:n=L,...E}=e,l=m(s)?s:$,o=h(a,l)?a:null,V=c(o)?n(o,l):void 0;return d.createElement(R,{scope:t,value:o,max:l},d.createElement(x.div,b({"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":c(o)?o:void 0,"aria-valuetext":V,role:"progressbar","data-state":N(o,l),"data-value":o??void 0,"data-max":l},E,{ref:r})))});P.propTypes={max(e,r,t){const a=e[r],s=String(a);return a&&!m(a)?new Error(T(s,t)):null},value(e,r,t){const a=e[r],s=String(a),n=m(e.max)?e.max:$;return a!=null&&!h(a,n)?new Error(D(s,t)):null}};const A="ProgressIndicator",C=d.forwardRef((e,r)=>{var t;const{__scopeProgress:a,...s}=e,n=S(A,a);return d.createElement(x.div,b({"data-state":N(n.value,n.max),"data-value":(t=n.value)!==null&&t!==void 0?t:void 0,"data-max":n.max},s,{ref:r}))});function L(e,r){return`${Math.round(e/r*100)}%`}function N(e,r){return e==null?"indeterminate":e===r?"complete":"loading"}function c(e){return typeof e=="number"}function m(e){return c(e)&&!isNaN(e)&&e>0}function h(e,r){return c(e)&&!isNaN(e)&&e<=r&&e>=0}function T(e,r){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${$}\`.`}function D(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${$} if no \`max\` prop is set)
  - \`null\` if the progress is indeterminate.

Defaulting to \`null\`.`}const y=P,O=C,u=d.forwardRef(({className:e,value:r,...t},a)=>p(y,{ref:a,className:w("relative h-4 w-full overflow-hidden rounded-full bg-background-strong",e),...t,children:p(O,{className:"h-full w-full flex-1 bg-background-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));u.displayName=y.displayName;try{u.displayName="Progress",u.__docgenInfo={description:"",displayName:"Progress",props:{asChild:{defaultValue:null,description:"",name:"asChild",required:!1,type:{name:"boolean"}}}}}catch{}const J={title:"ui/Progress",component:u,tags:["autodocs"],argTypes:{}},i={render:e=>p(u,{value:33}),args:{}};var f,v,g;i.parameters={...i.parameters,docs:{...(f=i.parameters)==null?void 0:f.docs,source:{originalSource:`{
  render: args => <Progress value={33} />,
  args: {}
}`,...(g=(v=i.parameters)==null?void 0:v.docs)==null?void 0:g.source}}};const K=["Base"];export{i as Base,K as __namedExportsOrder,J as default};
