UNPKG

@aplus-frontend/ui

Version:

18 lines (15 loc) 1.3 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@emotion/css"),c=require("../../utils/cssinjs/index.js"),l={loadingBarAnimateDuration:250};function t(){const e=r.keyframes` 0% { opacity: 0; } 100% { opacity: 1; } `,a=r.keyframes` 0% { opacity: 1; } 100% { opacity: 0; } `;return[e,a]}const i=e=>{const[a,s]=t(),{componentCls:n,loadingBarAnimateDuration:o}=e;return{[n]:{position:"absolute",insetInlineStart:0,width:"100%",zIndex:1,[`${n}__bar`]:{width:"100%",height:"100%",pointerEvents:"none",transition:"background-color .25s ease, transform .25s ease",willChange:"transform"},"&--default":{[`${e.componentCls}__bar`]:{background:e.colorPrimary}},"&--success":{[`${e.componentCls}__bar`]:{background:e.colorSuccess}},"&--warning":{[`${e.componentCls}__bar`]:{background:e.colorWarn}},"&--error":{[`${e.componentCls}__bar`]:{background:e.colorError}},"&-fade":{"&-enter-active":{animationName:a,animationDuration:`${o}ms`},"&-leave-active":{animationName:s,animationDuration:`${o}ms`}}}}},u=c.genComponentStyleHook("LoadingBar",e=>[i(e)],l,{skipUnit:["loadingBarAnimateDuration"]});exports.default=u;exports.genFadeKeyFrames=t;exports.genLoadingBarStyle=i;