package.dist.emotion-react.umd.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
> Simple styling in React.
The newest version!
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).emotionReact={},e.React)}(this,(function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(t);var a=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?g(_,--O):0,k--,10===E&&(k=1,C--),E}function T(){return E=O2||z(E)>3?"":" "}function L(e,t){for(;--t&&T()&&!(E<48||E>102||E>57&&E<65||E>70&&E<97););return R(e,M()+(t<6&&32==N()&&32==T()))}function W(e){for(;T();)switch(E){case e:return O;case 34:case 39:34!==e&&39!==e&&W(E);break;case 40:41===e&&W(e);break;case 92:T()}return O}function q(e,t){for(;T()&&e+E!==57&&(e+E!==84||47!==N()););return"/*"+R(t,O-1)+"*"+d(47===e?e:T())}function H(e){for(;!z(N());)T();return R(e,O)}function B(e){return D(U("",null,null,null,[""],e=F(e),0,[0],e))}function U(e,t,r,n,a,o,c,s,i){for(var u=0,f=0,l=c,p=0,h=0,y=0,b=1,x=1,C=1,k=0,S="",O=a,E=o,_=n,A=S;x;)switch(y=k,k=T()){case 40:if(108!=y&&58==g(A,l-1)){-1!=v(A+=m(I(k),"&","&\f"),"&\f")&&(C=-1);break}case 34:case 39:case 91:A+=I(k);break;case 9:case 10:case 13:case 32:A+=G(y);break;case 92:A+=L(M()-1,7);continue;case 47:switch(N()){case 42:case 47:$(Y(q(T(),M()),t,r),i);break;default:A+="/"}break;case 123*b:s[u++]=w(A)*C;case 125*b:case 59:case 0:switch(k){case 0:case 125:x=0;case 59+f:-1==C&&(A=m(A,/\f/g,"")),h>0&&w(A)-l&&$(h>32?Z(A+";",n,r,l-1):Z(m(A," ","")+";",n,r,l-2),i);break;case 59:A+=";";default:if($(_=V(A,t,r,u,f,a,s,S,O=[],E=[],l),o),123===k)if(0===f)U(A,t,_,_,O,o,l,s,E);else switch(99===p&&110===g(A,3)?100:p){case 100:case 108:case 109:case 115:U(e,_,_,n&&$(V(e,_,_,0,0,a,s,S,a,O=[],l),E),a,E,l,s,n?O:E);break;default:U(A,_,_,_,[""],E,0,s,E)}}u=f=h=0,b=C=1,S=A="",l=c;break;case 58:l=1+w(A),h=y;default:if(b<1)if(123==k)--b;else if(125==k&&0==b++&&125==j())continue;switch(A+=d(k),k*b){case 38:C=f>0?1:(A+="\f",-1);break;case 44:s[u++]=(w(A)-1)*C,C=1;break;case 64:45===N()&&(A+=I(T())),p=N(),f=l=w(S=A+=H(M())),k++;break;case 45:45===y&&2==w(A)&&(b=0)}}return o}function V(e,t,r,n,a,o,c,s,i,f,l){for(var d=a-1,h=0===a?o:[""],v=x(h),g=0,w=0,$=0;g0?h[C]+" "+k:m(k,/&\f/g,h[C])))&&(i[$++]=S);return A(e,t,r,0===a?u:s,i,f,l)}function Y(e,t,r){return A(e,t,r,i,d(E),b(e,2,-2),0)}function Z(e,t,r,n){return A(e,t,r,f,b(e,0,n),b(e,n+1,-1),n)}function J(e,t){for(var r="",n=x(e),a=0;a6)switch(g(e,t+1)){case 109:if(45!==g(e,t+4))break;case 102:return m(e,/(.+:)(.+)-([^]+)/,"$1"+s+"$2-$3$1"+c+(108==g(e,t+3)?"$3":"$2-$3"))+e;case 115:return~v(e,"stretch")?oe(m(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==g(e,t+1))break;case 6444:switch(g(e,w(e)-3-(~v(e,"!important")&&10))){case 107:return m(e,":",":"+s)+e;case 101:return m(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+s+(45===g(e,14)?"inline-":"")+"box$3$1"+s+"$2$3$1"+o+"$2box$3")+e}break;case 5936:switch(g(e,t+11)){case 114:return s+e+o+m(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return s+e+o+m(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return s+e+o+m(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return s+e+o+e+e}return e}var ce=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case f:e.return=oe(e.value,e.length);break;case l:return J([P(e,{value:m(e.value,"@","@"+s)})],n);case u:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return J([P(e,{props:[m(t,/:(read-\w+)/,":"+c+"$1")]})],n);case"::placeholder":return J([P(e,{props:[m(t,/:(plac\w+)/,":"+s+"input-$1")]}),P(e,{props:[m(t,/:(plac\w+)/,":"+c+"$1")]}),P(e,{props:[m(t,/:(plac\w+)/,o+"input-$1")]})],n)}return""}))}}],se=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,o,c=e.stylisPlugins||ce,s={},i=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++n,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(a){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(a)+i;return{name:u,styles:a,next:He}}var Ve=!!n.useInsertionEffect&&n.useInsertionEffect,Ye=Ve||function(e){return e()},Ze=Ve||n.useLayoutEffect,Je="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ke=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return je(t,r,n),Ye((function(){return Te(t,r,n)})),null},Qe=fe((function(e,t,r){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var o=e[Je],c=[a],s="";"string"==typeof e.className?s=Pe(t.registered,c,e.className):null!=e.className&&(s=e.className+" ");var i=Ue(c,void 0,n.useContext(_e));s+=t.key+"-"+i.name;var u={};for(var f in e)Ne.call(e,f)&&"css"!==f&&f!==Je&&(u[f]=e[f]);return u.className=s,r&&(u.ref=r),n.createElement(n.Fragment,null,n.createElement(Ke,{cache:t,serialized:i,isStringTag:"string"==typeof o}),n.createElement(o,u))})),Xe=function(e,t){var r=arguments;if(null==t||!Ne.call(t,"css"))return n.createElement.apply(void 0,r);var a=r.length,o=new Array(a);o[0]=Qe,o[1]=function(e,t){var r={};for(var n in t)Ne.call(t,n)&&(r[n]=t[n]);return r[Je]=e,r}(e,t);for(var c=2;c