UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 2.21 kB
var l=(...n)=>n.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((r,o)=>e[o]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var f=(n,e)=>l({[`${n}-xs`]:e.size==="xsmall",[`${n}-sm`]:e.size==="small",[`${n}-md`]:e.size==="medium",[`${n}-lg`]:e.size==="large",[`${n}-xl`]:e.size==="xlarge",[`${n}-xxl`]:e.size==="xxlarge",[`${n}-xxxl`]:e.size==="xxxlarge"},{[`${n}-${e.fillMode}`]:e.fillMode},{[`${n}-${e.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"});var s={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var a={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"};var u="loader",x=u;import{Fragment as c,jsx as p,jsxs as d}from"react/jsx-runtime";var m="k-loader",k={pulsing:"pulsing-2","infinite-spinner":"spinner-3","converging-spinner":"spinner-4"},v=[],y={size:[s.undefined,s.small,s.medium,s.large],themeColor:[a.undefined,a.base,a.primary,a.secondary,a.tertiary]},h={animation:"pulsing"},i=n=>{let{size:e,themeColor:r,animation:o=h.animation,...g}=n,t=p("span",{className:"k-loader-segment"});return p("div",{...g,className:l(n.className,m,{[`k-loader-${k[o]||o}`]:o},f(m,{size:e,themeColor:r})),role:"status","aria-label":g["aria-label"]||"Loading",children:d("div",{className:"k-loader-canvas",children:[o==="pulsing"&&d(c,{children:[t,t]}),o==="infinite-spinner"&&d(c,{children:[t,t,t]}),o==="converging-spinner"&&d(c,{children:[t,t,t,t]})]})})};i.states=v;i.options=y;i.className=m;i.defaultOptions=h;i.moduleName=u;i.folderName=x;i.ariaSpec={selector:".k-loader",rules:[{selector:".k-loader",attribute:"role=status",usage:"Live region that announces loading state."},{selector:".k-loader",attribute:"aria-label",usage:"Accessible name for the loader."}]};var K=i;export{m as LOADER_CLASSNAME,i as Loader,k as LoaderAnimationMap,K as default};