carbon-react
Version:
A library of reusable React components for easily building user interfaces.
2 lines (1 loc) • 786 B
JavaScript
import{jsxs as a,Fragment as e,jsx as r}from"react/jsx-runtime";import"react";import{OuterBar as i,InnerBar as o,StyledLoaderLabel as n}from"../loader.style.js";import l from"../../../../hooks/__internal__/useLocale/useLocale.js";const t=({size:t,variant:s,inverse:d,loaderLabel:m,showLabel:c,animationTime:p,hasMotion:v})=>{const u=l(),h="typical"===s||"ai"===s?s:"typical",b="small"===t||"large"===t?t:"medium";return a(e,{children:[r(i,{"data-role":"outer-bar",size:b,variant:h,inverse:!!d,children:r(o,{"data-role":"inner-bar",size:b,variant:h,inverse:!!d,animationTime:(a=>a||2)(p),hasMotion:v})}),c&&r(n,{inverse:d,"data-role":"loader-label",variant:"span",loaderVariant:s,loaderType:"standalone",size:t,children:m||(null==u?void 0:u.loader.loading())})]})};export{t as default};