UNPKG

@progress/kendo-react-indicators

Version:

React Indicators offer an interface to represent a visual indication for their UI elements. KendoReact Indicators package

9 lines (8 loc) 1.71 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),o=require("prop-types"),k=require("@progress/kendo-react-common");function y(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=y(p),u=t.forwardRef((e,a)=>{const{className:n,style:c}=e,l=t.useRef(null),f=t.useCallback(()=>{l.current&&l.current.focus()},[]);t.useImperativeHandle(a,()=>({element:l.current,focus:f}));const r=t.useMemo(()=>e.shape||i.shape,[e.shape]),s=t.useMemo(()=>e.animation===!1?!1:e.animation||i.animation,[e.animation]),m=t.useMemo(()=>k.classNames("k-skeleton",{"k-skeleton-circle":r==="circle","k-skeleton-rect":r==="rectangle","k-skeleton-text":r==="text","k-skeleton-pulse":typeof s=="object"&&s.type==="pulse","k-skeleton-wave":typeof s=="object"&&s.type==="wave"||s===!0},n),[r,s,n]);return t.createElement("span",{ref:l,className:m,style:c})});u.propTypes={className:o.string,style:o.object,animation:o.shape({type:o.oneOf(["wave","pulse"])}),shape:o.oneOf(["circle","rectangle","text"])};const i={shape:"text",animation:{type:"pulse"}};u.displayName="KendoSkeleton";exports.Skeleton=u;