UNPKG

@visa/nova-react

Version:

Visa Product Design System Nova React library. Compatible with React ^19.

2 lines (1 loc) 924 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("react/jsx-runtime"),e=require("clsx");const s="v-progress",a={large:72,small:48},l=({className:l,children:c,indeterminate:i=!1,paused:t=!1,progressSize:o="large",style:u,value:n,...d})=>{const m="string"==typeof o?a[o]:o,p=2*Math.PI*(m/2-2);return r.jsxs("div",{className:e(s,`${s}-circular`,"small"===o&&`${s}-circular-small`,i&&`${s}-indeterminate`,l),role:i?void 0:"progressbar",style:{animationPlayState:t?"paused":"running","--v-progress-circular-size":`${m}px`,...u},...d,children:[r.jsxs("svg",{className:`${s}-circular-track`,children:[r.jsx("circle",{className:`${s}-circular-background`,style:i?{strokeDasharray:""+(p-p/5)}:void 0}),r.jsx("circle",{className:`${s}-circular-bar`,style:{strokeDasharray:i?""+(p-p/5):`${p*(n||0)/100}, ${p}`,strokeDashoffset:i?null:"0"}})]}),c]})};l.displayName="ProgressCircular",exports.default=l;