pretty-lights
Advanced tools
Comparing version 0.0.12-alpha.3 to 0.0.12-alpha.4
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@emotion/stylis")),r=e(require("@emotion/hash")),n=e(require("stylis-rule-sheet")),o=e(require("@emotion/memoize")),i=e(require("@emotion/unitless")),c=e(require("@emotion/is-prop-valid")),s=e(require("@emotion/weak-memoize")),a=e(require("hoist-non-react-statics")),u=e(require("react"));function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b="undefined"!=typeof document;function _(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(r):n+="".concat(r," ")}),n}var E=/[A-Z]|^ms/g,w=o(function(e){return e.replace(E,"-$&").toLowerCase()}),O=function(e,t){return null==t||"boolean"==typeof t?"":1===i[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var N=/(attr|calc|counters?|url)\(/,P=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],j=O;O=function(e,t){return"content"===e&&("string"!=typeof t||-1===P.indexOf(t)&&!N.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`")),j(e,t)}}var S=function(){function e(t){f(this,e),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}return h(e,[{key:"insert",value:function(e,t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(r,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e+(t||"")));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}]),e}(),x="undefined"!=typeof document;function A(e,t,r,n){var o=[],i=_(e,o,r);return o.length<2?r:i+t(o,n)}var C=u.createContext({}),k=c,T=function(e){return"theme"!==e&&"innerRef"!==e},D=function(){return!0},R=function(e,t){for(var r=arguments,n=2,o=arguments.length;n<o;n+=1){var i=r[n],c=void 0;for(c in i)e(c)&&(t[c]=i[c])}return t},q=s(function(e){return s(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==l(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})});function V(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function L(e,t){return function(r){return V(e,r,t)}}L.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&V(e,n,o)}};var I=function(e,o){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;void 0===o&&(o={});var i=function(e){void 0===e&&(e={});var t=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(t))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(t,'" was passed'));var r,n={};if(x){r=e.container||document.head;var o=document.querySelectorAll("style[data-lights-".concat(t,"]"));Array.prototype.forEach.call(o,function(e){e.getAttribute("data-lights-".concat(t)).split(" ").forEach(function(e){n[e]=!0}),e.parentNode!==r&&r.appendChild(e)})}return{key:t,sheet:new S({key:t,container:r,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:n,registered:{}}}(o);i.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e};var c,s,a="",u=n(function(e){c+=e,b&&i.sheet.insert(e,a)});void 0!==o.prefix&&(s={prefix:o.prefix});var f=new t(s);function p(e,t){if(null==e)return"";switch(l(e)){case"boolean":return"";case"function":if(void 0!==e.__lights_styles){var r=e.toString();if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return r}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),p.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(y.has(e))return y.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=p.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==l(e[r]))t+=void 0!==i.registered[e[r]]?"".concat(r,"{").concat(i.registered[e[r]],"}"):"".concat(w(r),":").concat(O(r,e[r]),";");else{if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");Array.isArray(e[r])&&"string"==typeof e[r][0]&&void 0===i.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(w(r),":").concat(O(r,e),";")}):t+="".concat(r,"{").concat(p.call(this,e[r],!1),"}")}},this),y.set(e,t),t}.call(this,e);default:var n=i.registered[e];return!1===t&&void 0!==n?n:e}}f.use(o.stylisPlugins)(u);var h,d,y=new WeakMap,v=/label:\s*([^\s;\n{]+)\s*;/g,g=function(e,t){return r(e+t)+t};if("production"!==process.env.NODE_ENV){var m=g,E=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;g=function(e,t){return m(e.replace(E,function(e){return a=e,""}),t)}}var N=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=p.call(this,e,!1)):n+=e[0];for(var i=arguments.length,c=new Array(i>1?i-1:0),s=1;s<i;s++)c[s-1]=t[s];return c.forEach(function(t,o){n+=p.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),d=n,n=n.replace(v,function(e,t){return o+="-".concat(t),""}),h=g(n,o),n};if("production"!==process.env.NODE_ENV){var P=f;f=function(e,t){P(e,t),a=""}}function j(e,t){void 0===i.inserted[h]&&(c="",f(e,t),i.inserted[h]=c)}var C=function(){var e=N.apply(this,arguments),t="".concat(i.key,"-").concat(h);return void 0===i.registered[t]&&(i.registered[t]=d),j(".".concat(t),e),t},k={css:C,cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return A(i.registered,C,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var c in i="",o)o[c]&&c&&(i&&(i+=" "),i+=c);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r}(r))},injectGlobal:function(){j("",N.apply(this,arguments))},keyframes:function(){var e=N.apply(this,arguments),t="animation-".concat(h);return j("","@keyframes ".concat(t,"{").concat(e,"}")),t},hydrate:function(e){e.forEach(function(e){i.inserted[e]=!0})},flush:function(){i.inserted={},i.registered={},i.sheet.flush()},sheet:i.sheet,caches:i,getRegisteredStyles:_,merge:A.bind(null,i.registered,C)};return e.__SECRET_LIGHTS__=k,k}("undefined"!=typeof global?global:{}),G=function(e){var t=function(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,c,s;void 0!==n&&(o=n.e,i=n.label,c=n.target,s=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=r.__lights_real===r,l=void 0===o&&a&&r.__lights_base||r;return"function"!=typeof s&&(s="string"==typeof l&&l.charAt(0)===l.charAt(0).toLowerCase()?k:T),function(){var p=arguments,d=a&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==i&&d.push("label:".concat(i,";")),void 0===o)if(null==p[0]||void 0===p[0].raw)d.push.apply(d,p);else{d.push(p[0][0]);for(var y=p.length,v=1;v<y;v+=1)d.push(p[v],p[0][v])}var b=function(t){function r(){return f(this,r),!(e=g(r).apply(this,arguments))||"object"!=typeof e&&"function"!=typeof e?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this):e;var e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(r,u.Component),h(r,[{key:"render",value:function(){var t=this;return u.createElement(C.Consumer,null,function(r){var n=t.props;t.mergedProps=R(D,{},n,{theme:n.theme||r});var i="",a=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(e.caches.registered,a,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(a)):o,void 0!==c&&(i+=" ".concat(c)),u.createElement(l,R(s,{},n,{className:i,ref:n.innerRef}))})}}]),r}();return b.displayName=void 0!==i?i:"Styled(".concat("string"==typeof l?l:l.displayName||l.name||"Component",")"),void 0!==r.defaultProps&&(b.defaultProps=r.defaultProps),b.__lights_styles=d,b.__lights_base=l,b.__lights_real=b,b.__lights_forwardProp=s,Object.defineProperty(b,"toString",{value:function(){return"production"!==process.env.NODE_ENV&&void 0===c?"NO_COMPONENT_SELECTOR":".".concat(c)}}),b.withComponent=function(e,r){return t(e,void 0!==r?R(D,{},n,r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},b}};return"production"!==process.env.NODE_ENV&&"undefined"!=typeof Proxy&&(t=new Proxy(t,{get:function(e,t){switch(t){case"__proto__":case"name":case"prototype":case"displayName":return e[t];default:throw new Error("You're trying to use the styled shorthand without the pretty-lights/babel plugin."+"\nPlease add pretty-lights/babel to your Babel config or use the function call syntax(`styled('".concat(t,"')` instead of `styled.").concat(t,"`)"))}}})),t}(I),M=I.hydrate,F=I.cx,Y=I.merge,z=I.getRegisteredStyles,H=I.injectGlobal,$=I.keyframes,B=I.css,W=I.sheet,U=I.caches;exports.flush=I.flush,exports.hydrate=M,exports.cx=F,exports.merge=Y,exports.getRegisteredStyles=z,exports.injectGlobal=H,exports.keyframes=$,exports.css=B,exports.sheet=W,exports.caches=U,exports.ThemeContext=C,exports.ThemeProvider=function(e){return u.createElement(C.Consumer,null,function(t){return e.theme!==t&&(t=q(t)(e.theme)),u.createElement(C.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(C)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=u.forwardRef(function(t,r){return u.createElement(C.Consumer,null,function(n){return u.createElement(e,y({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),a(r,e)},exports.themeFn=L,exports.styled=G; | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@emotion/stylis")),r=e(require("stylis-rule-sheet")),n=e(require("@emotion/hash")),o=e(require("@emotion/memoize")),i=e(require("@emotion/unitless")),a=e(require("@emotion/is-prop-valid")),s=e(require("@emotion/weak-memoize")),c=e(require("hoist-non-react-statics")),u=e(require("react"));function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(){function e(t){f(this,e),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}return h(e,[{key:"insert",value:function(e,t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(r,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e+(t||"")));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}]),e}(),_="undefined"!=typeof document,E="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",w="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",O=/[A-Z]|^ms/g,N=function(e){return null!=e&&"boolean"!=typeof e},S=o(function(e){return 45===e.charCodeAt(1)?e:e.replace(O,"-$&").toLowerCase()}),j=function(e,t){return null==t||"boolean"==typeof t?"":1===i[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var P=/(attr|calc|counters?|url)\(/,x=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],A=j;j=function(e,t){return"content"===e&&("string"!=typeof t||-1===x.indexOf(t)&&!P.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`")),A(e,t)}}function C(e,t,r){if(null==t)return"";switch(l(t)){case"boolean":return"";case"function":if(void 0!==t.__lights_styles){var n=t.toString();if("NO_COMPONENT_SELECTOR"===n&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return n}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),C.call(this,e,void 0===this?t():t(this.mergedProps),r);case"object":return function(e,t){var r=this;if(T.has(t))return T.get(t);var n="";if(Array.isArray(t))for(var o=0;o<t.length;o+=1)n+=C.call(this,e,t[o],!1);else Object.keys(t).forEach(function(o){var i=t[o];if("object"!==l(i))null!=e&&void 0!==e[i]?n+="".concat(o,"{").concat(e[i],"}"):N(i)&&(n+="".concat(S(o),":").concat(j(o,i),";"));else{if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(i)||"string"!=typeof i[0]||null!=e&&void 0!==e[i[0]]){var a=C.call(r,e,i,!1);switch(o){case"animation":case"animationName":n+="".concat(S(o),":").concat(a,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===o&&console.error(w),n+="".concat(o,"{").concat(a,"}")}}else for(var s=0;s<i.length;s+=1)N(i[s])&&(n+="".concat(S(o),":").concat(j(o,i[s]),";"))}});return T.set(t,n),n}.call(this,e,t)}if(null==e)return t;var o=e[t];return!1===r&&void 0!==o?o:t}var k,T=new WeakMap,D=/label:\s*([^\s;\n{]+)\s*;/g;function V(e,t){var r,o=!0,i="",a=e[0];null==a||void 0===a.raw?(o=!1,i+=C.call(this,t,a,!1)):("production"!==process.env.NODE_ENV&&void 0===a[0]&&console.error(E),i+=a[0]);for(var s=1;s<e.length;s+=1)i+=C.call(this,t,e[s],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===a[s]&&console.error(E),i+=a[s]);"production"!==process.env.NODE_ENV&&(i=i.replace(k,function(e){return r=e,""})),D.lastIndex=0;var c="",u=i;return i=i.replace(D,function(e,t){return c+="-".concat(t),""}),{name:n(i+c)+c,styles:i,stylesWithLabel:u,map:r}}function R(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(r):n+="".concat(r," ")}),n}function q(e,t){if(void 0===e.inserted[t.name])return e.insert("",t)}function L(e,t,r,n){var o=[],i=R(e,o,r);return o.length<2?r:i+t(o,n)}"production"!==process.env.NODE_ENV&&(k=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var I=u.createContext({}),Y=a,G=function(e){return"theme"!==e&&"innerRef"!==e},M=function(){return!0},W=function(e,t){for(var r=arguments,n=2,o=arguments.length;n<o;n+=1){var i=r[n],a=void 0;for(a in i)e(a)&&(t[a]=i[a])}return t},z=s(function(e){return s(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==l(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})});function F(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function B(e,t){return function(r){return F(e,r,t)}}B.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&F(e,n,o)}};var H=function(e,n){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;var o=function(e){void 0===e&&(e={});var n,o=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));var i,a,s="",c=r(function(e){i+=e,_&&n.sheet.insert(e,s)});void 0!==e.prefix&&(a={prefix:e.prefix});var u=new t(a);if(u.use(e.stylisPlugins)(c),"production"!==process.env.NODE_ENV){var l=u;u=function(e,t){l(e,t),s=""}}var f,p={};if(_){f=e.container||document.head;var h=document.querySelectorAll("style[data-lights-".concat(o,"]"));Array.prototype.forEach.call(h,function(e){(e.getAttribute("data-lights-".concat(o))||"").split(" ").forEach(function(e){p[e]=!0}),e.parentNode!==f&&f.appendChild(e)})}return n={key:o,sheet:new b({key:o,container:f,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:p,registered:{},insert:function(e,t){s=t.map,void 0===n.inserted[t.name]&&(i="",u(e,t.styles),n.inserted[t.name]=i)}}}(void 0);o.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e};var i=function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=V.call(this,r,o.registered),a="".concat(o.key,"-").concat(i.name);return function(e,t){var r="".concat(e.key,"-").concat(t.name);void 0===e.registered[r]&&(e.registered[r]=t.stylesWithLabel||""),e.insert(".".concat(r),t)}(o,i),a},a={css:i,cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return L(o.registered,i,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var a in i="",o)o[a]&&a&&(i&&(i+=" "),i+=a);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r}(r))},injectGlobal:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=V.call(this,r,o.registered);q(o,i)},keyframes:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=V.call(this,r,o.registered),a="animation-".concat(i.name);return q(o,{name:i.name,styles:"@keyframes ".concat(a,"{").concat(i.styles,"}")}),a},hydrate:function(e){e.forEach(function(e){o.inserted[e]=!0})},flush:function(){o.inserted={},o.registered={},o.sheet.flush()},sheet:o.sheet,caches:o,getRegisteredStyles:R,merge:L.bind(null,o.registered,i)};return e.__SECRET_LIGHTS__=a,a}("undefined"!=typeof global?global:{}),$=function(e){var t=function(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,a,s;void 0!==n&&(o=n.e,i=n.label,a=n.target,s=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var c=r.__lights_real===r,l=void 0===o&&c&&r.__lights_base||r;return"function"!=typeof s&&(s="string"==typeof l&&l.charAt(0)===l.charAt(0).toLowerCase()?Y:G),function(){var p=arguments,d=c&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==i&&d.push("label:".concat(i,";")),void 0===o){for(var y=arguments.length,v=new Array(y),b=0;b<y;b++)v[b]=p[b];if(null==v[0]||void 0===v[0].raw)d.push.apply(d,v);else{d.push(v[0][0]);for(var _=v.length,E=1;E<_;E+=1)d.push(v[E],v[0][E])}}var w=function(t){function r(){return f(this,r),!(e=m(r).apply(this,arguments))||"object"!=typeof e&&"function"!=typeof e?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this):e;var e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(r,u.Component),h(r,[{key:"render",value:function(){var t=this;return u.createElement(I.Consumer,null,function(r){var n=t.props;t.mergedProps=W(M,{},n,{theme:n.theme||r});var i="",c=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(e.caches.registered,c,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(c)):o,void 0!==a&&(i+=" ".concat(a)),u.createElement(l,W(s,{},n,{className:i,ref:n.innerRef}))})}}]),r}();return w.displayName=void 0!==i?i:"Styled(".concat("string"==typeof l?l:l.displayName||l.name||"Component",")"),void 0!==r.defaultProps&&(w.defaultProps=r.defaultProps),w.__lights_styles=d,w.__lights_base=l,w.__lights_real=w,w.__lights_forwardProp=s,Object.defineProperty(w,"toString",{value:function(){return"production"!==process.env.NODE_ENV&&void 0===a?"NO_COMPONENT_SELECTOR":".".concat(a)}}),w.withComponent=function(e,r){return t(e,void 0!==r?W(M,{},n,r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},w}};return"production"!==process.env.NODE_ENV&&"undefined"!=typeof Proxy&&(t=new Proxy(t,{get:function(e,t){switch(t){case"__proto__":case"name":case"prototype":case"displayName":return e[t];default:throw new Error("You're trying to use the styled shorthand without the pretty-lights/babel plugin."+"\nPlease add pretty-lights/babel to your Babel config or use the function call syntax(`styled('".concat(t,"')` instead of `styled.").concat(t,"`)"))}}})),t}(H),J=H.hydrate,U=H.cx,Z=H.merge,K=H.getRegisteredStyles,Q=H.injectGlobal,X=H.keyframes,ee=H.css,te=H.sheet,re=H.caches;exports.flush=H.flush,exports.hydrate=J,exports.cx=U,exports.merge=Z,exports.getRegisteredStyles=K,exports.injectGlobal=Q,exports.keyframes=X,exports.css=ee,exports.sheet=te,exports.caches=re,exports.ThemeContext=I,exports.ThemeProvider=function(e){return u.createElement(I.Consumer,null,function(t){return e.theme!==t&&(t=z(t)(e.theme)),u.createElement(I.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(I)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=u.forwardRef(function(t,r){return u.createElement(I.Consumer,null,function(n){return u.createElement(e,y({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),c(r,e)},exports.themeFn=B,exports.styled=$; | ||
//# sourceMappingURL=pretty-lights.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"@emotion/stylis";import t from"@emotion/hash";import r from"stylis-rule-sheet";import n from"@emotion/memoize";import o from"@emotion/unitless";import i from"@emotion/is-prop-valid";import c from"@emotion/weak-memoize";import a from"hoist-non-react-statics";import s from"react";function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g="undefined"!=typeof document;function b(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(r):n+="".concat(r," ")}),n}var _=/[A-Z]|^ms/g,E=n(function(e){return e.replace(_,"-$&").toLowerCase()}),w=function(e,t){return null==t||"boolean"==typeof t?"":1===o[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var O=/(attr|calc|counters?|url)\(/,N=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],P=w;w=function(e,t){return"content"===e&&("string"!=typeof t||-1===N.indexOf(t)&&!O.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`")),P(e,t)}}var S=function(){function e(t){l(this,e),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}return p(e,[{key:"insert",value:function(e,t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(r,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e+(t||"")));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}]),e}(),j="undefined"!=typeof document;function A(e,t,r,n){var o=[],i=b(e,o,r);return o.length<2?r:i+t(o,n)}var C=s.createContext({}),k=i,T=function(e){return"theme"!==e&&"innerRef"!==e},D=function(){return!0},x=function(e,t){for(var r=arguments,n=2,o=arguments.length;n<o;n+=1){var i=r[n],c=void 0;for(c in i)e(c)&&(t[c]=i[c])}return t},R=c(function(e){return c(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==u(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==u(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})}),V=function(e){return s.createElement(C.Consumer,null,function(t){return e.theme!==t&&(t=R(t)(e.theme)),s.createElement(C.Provider,{value:t},e.children)})};function L(e){var t=e.displayName||e.name||"Component",r=s.forwardRef(function(t,r){return s.createElement(C.Consumer,null,function(n){return s.createElement(e,d({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),a(r,e)}function I(){return s.useContext(C)}function q(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function G(e,t){return function(r){return q(e,r,t)}}G.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&q(e,n,o)}};var M=function(n,o){if(void 0!==n.__SECRET_LIGHTS__)return n.__SECRET_LIGHTS__;void 0===o&&(o={});var i=function(e){void 0===e&&(e={});var t=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(t))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(t,'" was passed'));var r,n={};if(j){r=e.container||document.head;var o=document.querySelectorAll("style[data-lights-".concat(t,"]"));Array.prototype.forEach.call(o,function(e){e.getAttribute("data-lights-".concat(t)).split(" ").forEach(function(e){n[e]=!0}),e.parentNode!==r&&r.appendChild(e)})}return{key:t,sheet:new S({key:t,container:r,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:n,registered:{}}}(o);i.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e};var c,a,s="",l=r(function(e){c+=e,g&&i.sheet.insert(e,s)});void 0!==o.prefix&&(a={prefix:o.prefix});var f=new e(a);function p(e,t){if(null==e)return"";switch(u(e)){case"boolean":return"";case"function":if(void 0!==e.__lights_styles){var r=e.toString();if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return r}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),p.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(y.has(e))return y.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=p.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==u(e[r]))t+=void 0!==i.registered[e[r]]?"".concat(r,"{").concat(i.registered[e[r]],"}"):"".concat(E(r),":").concat(w(r,e[r]),";");else{if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");Array.isArray(e[r])&&"string"==typeof e[r][0]&&void 0===i.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(E(r),":").concat(w(r,e),";")}):t+="".concat(r,"{").concat(p.call(this,e[r],!1),"}")}},this),y.set(e,t),t}.call(this,e);default:var n=i.registered[e];return!1===t&&void 0!==n?n:e}}f.use(o.stylisPlugins)(l);var h,d,y=new WeakMap,v=/label:\s*([^\s;\n{]+)\s*;/g,m=function(e,r){return t(e+r)+r};if("production"!==process.env.NODE_ENV){var _=m,O=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;m=function(e,t){return _(e.replace(O,function(e){return s=e,""}),t)}}var N=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=p.call(this,e,!1)):n+=e[0];for(var i=arguments.length,c=new Array(i>1?i-1:0),a=1;a<i;a++)c[a-1]=t[a];return c.forEach(function(t,o){n+=p.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),d=n,n=n.replace(v,function(e,t){return o+="-".concat(t),""}),h=m(n,o),n};if("production"!==process.env.NODE_ENV){var P=f;f=function(e,t){P(e,t),s=""}}function C(e,t){void 0===i.inserted[h]&&(c="",f(e,t),i.inserted[h]=c)}var k=function(){var e=N.apply(this,arguments),t="".concat(i.key,"-").concat(h);return void 0===i.registered[t]&&(i.registered[t]=d),C(".".concat(t),e),t},T={css:k,cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return A(i.registered,k,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(u(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var c in i="",o)o[c]&&c&&(i&&(i+=" "),i+=c);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r}(r))},injectGlobal:function(){C("",N.apply(this,arguments))},keyframes:function(){var e=N.apply(this,arguments),t="animation-".concat(h);return C("","@keyframes ".concat(t,"{").concat(e,"}")),t},hydrate:function(e){e.forEach(function(e){i.inserted[e]=!0})},flush:function(){i.inserted={},i.registered={},i.sheet.flush()},sheet:i.sheet,caches:i,getRegisteredStyles:b,merge:A.bind(null,i.registered,k)};return n.__SECRET_LIGHTS__=T,T}("undefined"!=typeof global?global:{}),F=function(e){var t=function(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,c,a;void 0!==n&&(o=n.e,i=n.label,c=n.target,a=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var u=r.__lights_real===r,f=void 0===o&&u&&r.__lights_base||r;return"function"!=typeof a&&(a="string"==typeof f&&f.charAt(0)===f.charAt(0).toLowerCase()?k:T),function(){var h=arguments,d=u&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==i&&d.push("label:".concat(i,";")),void 0===o)if(null==h[0]||void 0===h[0].raw)d.push.apply(d,h);else{d.push(h[0][0]);for(var y=h.length,g=1;g<y;g+=1)d.push(h[g],h[0][g])}var b=function(t){function r(){return l(this,r),!(e=v(r).apply(this,arguments))||"object"!=typeof e&&"function"!=typeof e?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this):e;var e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(r,s.Component),p(r,[{key:"render",value:function(){var t=this;return s.createElement(C.Consumer,null,function(r){var n=t.props;t.mergedProps=x(D,{},n,{theme:n.theme||r});var i="",u=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(e.caches.registered,u,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(u)):o,void 0!==c&&(i+=" ".concat(c)),s.createElement(f,x(a,{},n,{className:i,ref:n.innerRef}))})}}]),r}();return b.displayName=void 0!==i?i:"Styled(".concat("string"==typeof f?f:f.displayName||f.name||"Component",")"),void 0!==r.defaultProps&&(b.defaultProps=r.defaultProps),b.__lights_styles=d,b.__lights_base=f,b.__lights_real=b,b.__lights_forwardProp=a,Object.defineProperty(b,"toString",{value:function(){return"production"!==process.env.NODE_ENV&&void 0===c?"NO_COMPONENT_SELECTOR":".".concat(c)}}),b.withComponent=function(e,r){return t(e,void 0!==r?x(D,{},n,r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},b}};return"production"!==process.env.NODE_ENV&&"undefined"!=typeof Proxy&&(t=new Proxy(t,{get:function(e,t){switch(t){case"__proto__":case"name":case"prototype":case"displayName":return e[t];default:throw new Error("You're trying to use the styled shorthand without the pretty-lights/babel plugin."+"\nPlease add pretty-lights/babel to your Babel config or use the function call syntax(`styled('".concat(t,"')` instead of `styled.").concat(t,"`)"))}}})),t}(M),Y=M.flush,z=M.hydrate,H=M.cx,$=M.merge,B=M.getRegisteredStyles,W=M.injectGlobal,U=M.keyframes,Z=M.css,J=M.sheet,K=M.caches;export{Y as flush,z as hydrate,H as cx,$ as merge,B as getRegisteredStyles,W as injectGlobal,U as keyframes,Z as css,J as sheet,K as caches,C as ThemeContext,V as ThemeProvider,I as useTheme,L as withTheme,G as themeFn,F as styled}; | ||
import e from"@emotion/stylis";import t from"stylis-rule-sheet";import r from"@emotion/hash";import n from"@emotion/memoize";import o from"@emotion/unitless";import i from"@emotion/is-prop-valid";import a from"@emotion/weak-memoize";import c from"hoist-non-react-statics";import s from"react";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g=function(){function e(t){u(this,e),this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}return p(e,[{key:"insert",value:function(e,t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(r,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'.concat(e,'"'),t)}}else n.appendChild(document.createTextNode(e+(t||"")));this.ctr+=1}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0}}]),e}(),b="undefined"!=typeof document,_="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",E="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",w=/[A-Z]|^ms/g,O=function(e){return null!=e&&"boolean"!=typeof e},N=n(function(e){return 45===e.charCodeAt(1)?e:e.replace(w,"-$&").toLowerCase()}),S=function(e,t){return null==t||"boolean"==typeof t?"":1===o[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:"".concat(t,"px")};if("production"!==process.env.NODE_ENV){var P=/(attr|calc|counters?|url)\(/,j=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],A=S;S=function(e,t){return"content"===e&&("string"!=typeof t||-1===j.indexOf(t)&&!P.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(t,"\"'`")),A(e,t)}}function C(e,t,r){if(null==t)return"";switch(l(t)){case"boolean":return"";case"function":if(void 0!==t.__lights_styles){var n=t.toString();if("NO_COMPONENT_SELECTOR"===n&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return n}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),C.call(this,e,void 0===this?t():t(this.mergedProps),r);case"object":return function(e,t){var r=this;if(D.has(t))return D.get(t);var n="";if(Array.isArray(t))for(var o=0;o<t.length;o+=1)n+=C.call(this,e,t[o],!1);else Object.keys(t).forEach(function(o){var i=t[o];if("object"!==l(i))null!=e&&void 0!==e[i]?n+="".concat(o,"{").concat(e[i],"}"):O(i)&&(n+="".concat(N(o),":").concat(S(o,i),";"));else{if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(i)||"string"!=typeof i[0]||null!=e&&void 0!==e[i[0]]){var a=C.call(r,e,i,!1);switch(o){case"animation":case"animationName":n+="".concat(N(o),":").concat(a,";");break;default:"production"!==process.env.NODE_ENV&&"undefined"===o&&console.error(E),n+="".concat(o,"{").concat(a,"}")}}else for(var c=0;c<i.length;c+=1)O(i[c])&&(n+="".concat(N(o),":").concat(S(o,i[c]),";"))}});return D.set(t,n),n}.call(this,e,t)}if(null==e)return t;var o=e[t];return!1===r&&void 0!==o?o:t}var k,D=new WeakMap,T=/label:\s*([^\s;\n{]+)\s*;/g;function x(e,t){var n,o=!0,i="",a=e[0];null==a||void 0===a.raw?(o=!1,i+=C.call(this,t,a,!1)):("production"!==process.env.NODE_ENV&&void 0===a[0]&&console.error(_),i+=a[0]);for(var c=1;c<e.length;c+=1)i+=C.call(this,t,e[c],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===a[c]&&console.error(_),i+=a[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(k,function(e){return n=e,""})),T.lastIndex=0;var s="",l=i;return i=i.replace(T,function(e,t){return s+="-".concat(t),""}),{name:r(i+s)+s,styles:i,stylesWithLabel:l,map:n}}function V(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(r):n+="".concat(r," ")}),n}function R(e,t){if(void 0===e.inserted[t.name])return e.insert("",t)}function L(e,t,r,n){var o=[],i=V(e,o,r);return o.length<2?r:i+t(o,n)}"production"!==process.env.NODE_ENV&&(k=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var q=s.createContext({}),I=i,Y=function(e){return"theme"!==e&&"innerRef"!==e},G=function(){return!0},M=function(e,t){for(var r=arguments,n=2,o=arguments.length;n<o;n+=1){var i=r[n],a=void 0;for(a in i)e(a)&&(t[a]=i[a])}return t},W=a(function(e){return a(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!==l(r)||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!==l(t)||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})}),z=function(e){return s.createElement(q.Consumer,null,function(t){return e.theme!==t&&(t=W(t)(e.theme)),s.createElement(q.Provider,{value:t},e.children)})};function F(e){var t=e.displayName||e.name||"Component",r=s.forwardRef(function(t,r){return s.createElement(q.Consumer,null,function(n){return s.createElement(e,d({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),c(r,e)}function B(){return s.useContext(q)}function H(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function $(e,t){return function(r){return H(e,r,t)}}$.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&H(e,n,o)}};var J=function(r,n){if(void 0!==r.__SECRET_LIGHTS__)return r.__SECRET_LIGHTS__;var o=function(r){void 0===r&&(r={});var n,o=r.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(o,'" was passed'));var i,a,c="",s=t(function(e){i+=e,b&&n.sheet.insert(e,c)});void 0!==r.prefix&&(a={prefix:r.prefix});var l=new e(a);if(l.use(r.stylisPlugins)(s),"production"!==process.env.NODE_ENV){var u=l;l=function(e,t){u(e,t),c=""}}var f,p={};if(b){f=r.container||document.head;var h=document.querySelectorAll("style[data-lights-".concat(o,"]"));Array.prototype.forEach.call(h,function(e){(e.getAttribute("data-lights-".concat(o))||"").split(" ").forEach(function(e){p[e]=!0}),e.parentNode!==f&&f.appendChild(e)})}return n={key:o,sheet:new g({key:o,container:f,nonce:r.nonce,speedy:r.speedy}),nonce:r.nonce,inserted:p,registered:{},insert:function(e,t){c=t.map,void 0===n.inserted[t.name]&&(i="",l(e,t.styles),n.inserted[t.name]=i)}}}(void 0);o.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e};var i=function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=x.call(this,r,o.registered),a="".concat(o.key,"-").concat(i.name);return function(e,t){var r="".concat(e.key,"-").concat(t.name);void 0===e.registered[r]&&(e.registered[r]=t.stylesWithLabel||""),e.insert(".".concat(r),t)}(o,i),a},a={css:i,cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return L(o.registered,i,function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(l(o)){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var a in i="",o)o[a]&&a&&(i&&(i+=" "),i+=a);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r}(r))},injectGlobal:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=x.call(this,r,o.registered);R(o,i)},keyframes:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];var i=x.call(this,r,o.registered),a="animation-".concat(i.name);return R(o,{name:i.name,styles:"@keyframes ".concat(a,"{").concat(i.styles,"}")}),a},hydrate:function(e){e.forEach(function(e){o.inserted[e]=!0})},flush:function(){o.inserted={},o.registered={},o.sheet.flush()},sheet:o.sheet,caches:o,getRegisteredStyles:V,merge:L.bind(null,o.registered,i)};return r.__SECRET_LIGHTS__=a,a}("undefined"!=typeof global?global:{}),U=function(e){var t=function(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,a,c;void 0!==n&&(o=n.e,i=n.label,a=n.target,c=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var l=r.__lights_real===r,f=void 0===o&&l&&r.__lights_base||r;return"function"!=typeof c&&(c="string"==typeof f&&f.charAt(0)===f.charAt(0).toLowerCase()?I:Y),function(){var h=arguments,d=l&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==i&&d.push("label:".concat(i,";")),void 0===o){for(var y=arguments.length,g=new Array(y),b=0;b<y;b++)g[b]=h[b];if(null==g[0]||void 0===g[0].raw)d.push.apply(d,g);else{d.push(g[0][0]);for(var _=g.length,E=1;E<_;E+=1)d.push(g[E],g[0][E])}}var w=function(t){function r(){return u(this,r),!(e=v(r).apply(this,arguments))||"object"!=typeof e&&"function"!=typeof e?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this):e;var e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(r,s.Component),p(r,[{key:"render",value:function(){var t=this;return s.createElement(q.Consumer,null,function(r){var n=t.props;t.mergedProps=M(G,{},n,{theme:n.theme||r});var i="",l=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(e.caches.registered,l,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(l)):o,void 0!==a&&(i+=" ".concat(a)),s.createElement(f,M(c,{},n,{className:i,ref:n.innerRef}))})}}]),r}();return w.displayName=void 0!==i?i:"Styled(".concat("string"==typeof f?f:f.displayName||f.name||"Component",")"),void 0!==r.defaultProps&&(w.defaultProps=r.defaultProps),w.__lights_styles=d,w.__lights_base=f,w.__lights_real=w,w.__lights_forwardProp=c,Object.defineProperty(w,"toString",{value:function(){return"production"!==process.env.NODE_ENV&&void 0===a?"NO_COMPONENT_SELECTOR":".".concat(a)}}),w.withComponent=function(e,r){return t(e,void 0!==r?M(G,{},n,r):n).apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(o=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}());var o},w}};return"production"!==process.env.NODE_ENV&&"undefined"!=typeof Proxy&&(t=new Proxy(t,{get:function(e,t){switch(t){case"__proto__":case"name":case"prototype":case"displayName":return e[t];default:throw new Error("You're trying to use the styled shorthand without the pretty-lights/babel plugin."+"\nPlease add pretty-lights/babel to your Babel config or use the function call syntax(`styled('".concat(t,"')` instead of `styled.").concat(t,"`)"))}}})),t}(J),Z=J.flush,K=J.hydrate,Q=J.cx,X=J.merge,ee=J.getRegisteredStyles,te=J.injectGlobal,re=J.keyframes,ne=J.css,oe=J.sheet,ie=J.caches;export{Z as flush,K as hydrate,Q as cx,X as merge,ee as getRegisteredStyles,te as injectGlobal,re as keyframes,ne as css,oe as sheet,ie as caches,q as ThemeContext,z as ThemeProvider,B as useTheme,F as withTheme,$ as themeFn,U as styled}; | ||
//# sourceMappingURL=pretty-lights.modern.js.map |
{ | ||
"name": "pretty-lights", | ||
"version": "0.0.12-alpha.3", | ||
"version": "0.0.12-alpha.4", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -57,2 +57,3 @@ "main": "lib/pretty-lights.js", | ||
"@babel/preset-env": "7.7.7", | ||
"@babel/preset-flow": "7.7.4", | ||
"@babel/preset-react": "7.7.4", | ||
@@ -70,2 +71,3 @@ "babel-check-duplicated-nodes": "1.0.0", | ||
"eslint-config-prettier": "4.2.0", | ||
"eslint-plugin-flowtype": "4.5.2", | ||
"eslint-plugin-import": "2.17.2", | ||
@@ -78,2 +80,3 @@ "eslint-plugin-json": "1.4.0", | ||
"eslint-plugin-react-hooks": "1.6.0", | ||
"flow-bin": "0.114.0", | ||
"jest": "24.9.0", | ||
@@ -80,0 +83,0 @@ "jest-in-case": "1.0.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
952
140909
40
40