UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 2.35 kB
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import"react";import n from"../../__internal__/utils/helpers/tags/tags.js";import{StyledLabel as o,StyledLoaderStarWrapper as a,StyledStars as i}from"./loader-star.style.js";import l from"../../hooks/__internal__/useLocale/useLocale.js";import s from"../../hooks/useMediaQuery/useMediaQuery.js";import c from"./internal/star.component.js";import{Typography as p}from"../typography/typography.component.js";function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const u=u=>{var{loaderStarLabel:f}=u,b=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(u,["loaderStarLabel"]);const y=l(),m=s("screen and (prefers-reduced-motion: no-preference)");if(void 0===m)return null;const O=e(o,{"data-role":"visible-label",variant:"span",fontWeight:"400",children:f||y.loaderStar.loading()});return e(a,(g=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){d(e,r,t[r])}))}return e}({role:"status"},n("loader-star",b)),j=null!=(j={children:m?r(t,{children:[r(i,{children:[e(c,{starContainerClassName:"star-1",gradientId:"gradient1"}),e(c,{starContainerClassName:"star-2",gradientId:"gradient2"}),e(c,{starContainerClassName:"star-3",gradientId:"gradient3"})]}),e(p,{"data-role":"hidden-label",variant:"span",screenReaderOnly:!0,children:f||y.loaderStar.loading()})]}):O})?j:{},Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(j)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(j)).forEach((function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(j,e))})),g));var g,j};u.displayName="LoaderStar";export{u as default};