pretty-lights
Advanced tools
Comparing version 0.0.12-alpha.0 to 0.0.12-alpha.1
@@ -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")),a=e(require("@emotion/weak-memoize")),s=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=/[A-Z]|^ms/g,_=o(function(e){return e.replace(b,"-$&").toLowerCase()}),E=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 w=/(attr|calc|counters?|url)\(/,O=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],N=E;E=function(e,t){return"content"===e&&("string"!=typeof t||-1===O.indexOf(t)&&!w.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,"\"'`")),N(e,t)}}var j="undefined"!=typeof document;function P(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("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var S=function(){function e(t){f(this,e),this.isSpeedy="production"===process.env.NODE_ENV,this.tags=[],this.ctr=0,this.opts=t}return h(e,[{key:"inject",value:function(){if(this.injected)throw new Error("already injected!");this.tags[0]=P(this.opts),this.injected=!0}},{key:"speedy",value:function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e}},{key:"insert",value:function(e,t){if(this.isSpeedy){var r=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]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn("illegal rule",e)}}else{var n=P(this.opts);this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr+=1,this.ctr%65e3==0&&this.tags.push(P(this.opts))}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0,this.injected=!1}}]),e}(),x=u.createContext({}),A=c,C=function(e){return"theme"!==e&&"innerRef"!==e},T=function(){return!0},k=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},D=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?v(r,!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})});function R(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 q(e,t){return function(r){return R(e,r,t)}}q.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&R(e,n,o)}};var V=function(e,o){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;void 0===o&&(o={});var i=o.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(i))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(i,'" was passed'));var c,a,s=new S(o),u="",f=n(function(e){c+=e,j&&s.insert(e,u)});void 0!==o.prefix&&(a={prefix:o.prefix});var p={registered:{},inserted:{},nonce:o.nonce,key:i};j&&s.inject();var h=new t(a);function d(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}`"),d.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(m.has(e))return m.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=d.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==l(e[r]))t+=void 0!==p.registered[e[r]]?"".concat(r,"{").concat(p.registered[e[r]],"}"):"".concat(_(r),":").concat(E(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===p.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(_(r),":").concat(E(r,e),";")}):t+="".concat(r,"{").concat(d.call(this,e[r],!1),"}")}},this),m.set(e,t),t}.call(this,e);default:var n=p.registered[e];return!1===t&&void 0!==n?n:e}}h.use(o.stylisPlugins)(f);var y,v,m=new WeakMap,g=/label:\s*([^\s;\n{]+)\s*;/g,b=function(e,t){return r(e+t)+t};if("production"!==process.env.NODE_ENV){var w=b,O=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;b=function(e,t){return w(e.replace(O,function(e){return u=e,""}),t)}}var N=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=d.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+=d.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),v=n,n=n.replace(g,function(e,t){return o+="-".concat(t),""}),y=b(n,o),n};if("production"!==process.env.NODE_ENV){var P=h;h=function(e,t){P(e,t),u=""}}function x(e,t){void 0===p.inserted[y]&&(c="",h(e,t),p.inserted[y]=c)}var A=function(){var e=N.apply(this,arguments),t="".concat(i,"-").concat(y);return void 0===p.registered[t]&&(p.registered[t]=v),x(".".concat(t),e),t};function C(e,t){var r="";return t.split(" ").forEach(function(t){void 0!==p.registered[t]?e.push(t):r+="".concat(t," ")}),r}function T(e,t){var r=[],n=C(r,e);return r.length<2?e:n+A(r,t)}function k(e){p.inserted[e]=!0}if(j){var D=document.querySelectorAll("[data-lights-".concat(i,"]"));Array.prototype.forEach.call(D,function(e){s.tags[0].parentNode.insertBefore(e,s.tags[0]),e.getAttribute("data-lights-".concat(i)).split(" ").forEach(k)})}var R={flush:function(){j&&(s.flush(),s.inject()),p.inserted={},p.registered={}},hydrate:function(e){e.forEach(k)},cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return T(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))},merge:T,getRegisteredStyles:C,injectGlobal:function(){x("",N.apply(this,arguments))},keyframes:function(){var e=N.apply(this,arguments),t="animation-".concat(y);return x("","@keyframes ".concat(t,"{").concat(e,"}")),t},css:A,sheet:s,caches:p};return e.__SECRET_LIGHTS__=R,R}("undefined"!=typeof global?global:{}),L=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 s=r.__lights_real===r,l=void 0===o&&s&&r.__lights_base||r;return"function"!=typeof a&&(a="string"==typeof l&&l.charAt(0)===l.charAt(0).toLowerCase()?A:C),function(){var p=arguments,d=s&&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=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(x.Consumer,null,function(r){var n=t.props;t.mergedProps=k(T,{},n,{theme:n.theme||r});var i="",s=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(s,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(s)):o,void 0!==c&&(i+=" ".concat(c)),u.createElement(l,k(a,{},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=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?k(T,{},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}(V),I=V.hydrate,G=V.cx,M=V.merge,F=V.getRegisteredStyles,Y=V.injectGlobal,z=V.keyframes,H=V.css,$=V.sheet,B=V.caches;exports.flush=V.flush,exports.hydrate=I,exports.cx=G,exports.merge=M,exports.getRegisteredStyles=F,exports.injectGlobal=Y,exports.keyframes=z,exports.css=H,exports.sheet=$,exports.caches=B,exports.ThemeContext=x,exports.ThemeProvider=function(e){return u.createElement(x.Consumer,null,function(t){return e.theme!==t&&(t=D(t)(e.theme)),u.createElement(x.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(x)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=u.forwardRef(function(t,r){return u.createElement(x.Consumer,null,function(n){return u.createElement(e,y({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),s(r,e)},exports.themeFn=q,exports.styled=L; | ||
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")),a=e(require("@emotion/weak-memoize")),s=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=/[A-Z]|^ms/g,_=o(function(e){return e.replace(b,"-$&").toLowerCase()}),E=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 w=/(attr|calc|counters?|url)\(/,O=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],N=E;E=function(e,t){return"content"===e&&("string"!=typeof t||-1===O.indexOf(t)&&!w.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,"\"'`")),N(e,t)}}var P="undefined"!=typeof document,j=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}(),S=u.createContext({}),x=c,A=function(e){return"theme"!==e&&"innerRef"!==e},C=function(){return!0},T=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},k=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?v(r,!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})});function D(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 R(e,t){return function(r){return D(e,r,t)}}R.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&D(e,n,o)}};var q=function(e,o){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;void 0===o&&(o={});var i,c=o.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(c))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(c,'" was passed'));P&&(i=o.container||document.head);var a,s,u=new j({key:c,container:i,nonce:o.nonce,speedy:o.speedy}),f="",p=n(function(e){a+=e,P&&u.insert(e,f)});void 0!==o.prefix&&(s={prefix:o.prefix});var h={registered:{},inserted:{},nonce:o.nonce,key:c},d=new t(s);function y(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}`"),y.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(m.has(e))return m.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=y.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==l(e[r]))t+=void 0!==h.registered[e[r]]?"".concat(r,"{").concat(h.registered[e[r]],"}"):"".concat(_(r),":").concat(E(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===h.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(_(r),":").concat(E(r,e),";")}):t+="".concat(r,"{").concat(y.call(this,e[r],!1),"}")}},this),m.set(e,t),t}.call(this,e);default:var n=h.registered[e];return!1===t&&void 0!==n?n:e}}d.use(o.stylisPlugins)(p);var v,g,m=new WeakMap,b=/label:\s*([^\s;\n{]+)\s*;/g,w=function(e,t){return r(e+t)+t};if("production"!==process.env.NODE_ENV){var O=w,N=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;w=function(e,t){return O(e.replace(N,function(e){return f=e,""}),t)}}var S=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=y.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+=y.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),g=n,n=n.replace(b,function(e,t){return o+="-".concat(t),""}),v=w(n,o),n};if("production"!==process.env.NODE_ENV){var x=d;d=function(e,t){x(e,t),f=""}}function A(e,t){void 0===h.inserted[v]&&(a="",d(e,t),h.inserted[v]=a)}var C=function(){var e=S.apply(this,arguments),t="".concat(c,"-").concat(v);return void 0===h.registered[t]&&(h.registered[t]=g),A(".".concat(t),e),t};function T(e,t){var r="";return t.split(" ").forEach(function(t){void 0!==h.registered[t]?e.push(t):r+="".concat(t," ")}),r}function k(e,t){var r=[],n=T(r,e);return r.length<2?e:n+C(r,t)}function D(e){h.inserted[e]=!0}if(P){var R=document.querySelectorAll("style[data-lights-".concat(c,"]"));Array.prototype.forEach.call(R,function(e){e.getAttribute("data-lights-".concat(c)).split(" ").forEach(D),e.parentNode!==i&&i.appendChild(e)})}var q={flush:function(){P&&u.flush(),h.inserted={},h.registered={}},hydrate:function(e){e.forEach(D)},cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return 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(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))},merge:k,getRegisteredStyles:T,injectGlobal:function(){A("",S.apply(this,arguments))},keyframes:function(){var e=S.apply(this,arguments),t="animation-".concat(v);return A("","@keyframes ".concat(t,"{").concat(e,"}")),t},css:C,sheet:u,caches:h};return e.__SECRET_LIGHTS__=q,q}("undefined"!=typeof global?global:{}),V=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 s=r.__lights_real===r,l=void 0===o&&s&&r.__lights_base||r;return"function"!=typeof a&&(a="string"==typeof l&&l.charAt(0)===l.charAt(0).toLowerCase()?x:A),function(){var p=arguments,d=s&&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(S.Consumer,null,function(r){var n=t.props;t.mergedProps=T(C,{},n,{theme:n.theme||r});var i="",s=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(s,n.className):"".concat(n.className," ")),i+=void 0===o?e.css.apply(t,d.concat(s)):o,void 0!==c&&(i+=" ".concat(c)),u.createElement(l,T(a,{},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=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?T(C,{},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}(q),L=q.hydrate,I=q.cx,G=q.merge,M=q.getRegisteredStyles,F=q.injectGlobal,Y=q.keyframes,z=q.css,H=q.sheet,$=q.caches;exports.flush=q.flush,exports.hydrate=L,exports.cx=I,exports.merge=G,exports.getRegisteredStyles=M,exports.injectGlobal=F,exports.keyframes=Y,exports.css=z,exports.sheet=H,exports.caches=$,exports.ThemeContext=S,exports.ThemeProvider=function(e){return u.createElement(S.Consumer,null,function(t){return e.theme!==t&&(t=k(t)(e.theme)),u.createElement(S.Provider,{value:t},e.children)})},exports.useTheme=function(){return u.useContext(S)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=u.forwardRef(function(t,r){return u.createElement(S.Consumer,null,function(n){return u.createElement(e,y({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),s(r,e)},exports.themeFn=R,exports.styled=V; | ||
//# 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=/[A-Z]|^ms/g,b=n(function(e){return e.replace(g,"-$&").toLowerCase()}),_=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 E=/(attr|calc|counters?|url)\(/,w=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],O=_;_=function(e,t){return"content"===e&&("string"!=typeof t||-1===w.indexOf(t)&&!E.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,"\"'`")),O(e,t)}}var N="undefined"!=typeof document;function j(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("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var P=function(){function e(t){l(this,e),this.isSpeedy="production"===process.env.NODE_ENV,this.tags=[],this.ctr=0,this.opts=t}return p(e,[{key:"inject",value:function(){if(this.injected)throw new Error("already injected!");this.tags[0]=j(this.opts),this.injected=!0}},{key:"speedy",value:function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e}},{key:"insert",value:function(e,t){if(this.isSpeedy){var r=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]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn("illegal rule",e)}}else{var n=j(this.opts);this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr+=1,this.ctr%65e3==0&&this.tags.push(j(this.opts))}},{key:"flush",value:function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0,this.injected=!1}}]),e}(),S=s.createContext({}),A=i,C=function(e){return"theme"!==e&&"innerRef"!==e},k=function(){return!0},T=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},D=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(r,!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})}),x=function(e){return s.createElement(S.Consumer,null,function(t){return e.theme!==t&&(t=D(t)(e.theme)),s.createElement(S.Provider,{value:t},e.children)})};function R(e){var t=e.displayName||e.name||"Component",r=s.forwardRef(function(t,r){return s.createElement(S.Consumer,null,function(n){return s.createElement(e,d({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),a(r,e)}function V(){return s.useContext(S)}function L(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 I(e,t){return function(r){return L(e,r,t)}}I.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&L(e,n,o)}};var q=function(n,o){if(void 0!==n.__SECRET_LIGHTS__)return n.__SECRET_LIGHTS__;void 0===o&&(o={});var i=o.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(i))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(i,'" was passed'));var c,a,s=new P(o),l="",f=r(function(e){c+=e,N&&s.insert(e,l)});void 0!==o.prefix&&(a={prefix:o.prefix});var p={registered:{},inserted:{},nonce:o.nonce,key:i};N&&s.inject();var h=new e(a);function d(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}`"),d.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(m.has(e))return m.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=d.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==u(e[r]))t+=void 0!==p.registered[e[r]]?"".concat(r,"{").concat(p.registered[e[r]],"}"):"".concat(b(r),":").concat(_(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===p.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(b(r),":").concat(_(r,e),";")}):t+="".concat(r,"{").concat(d.call(this,e[r],!1),"}")}},this),m.set(e,t),t}.call(this,e);default:var n=p.registered[e];return!1===t&&void 0!==n?n:e}}h.use(o.stylisPlugins)(f);var y,v,m=new WeakMap,g=/label:\s*([^\s;\n{]+)\s*;/g,E=function(e,r){return t(e+r)+r};if("production"!==process.env.NODE_ENV){var w=E,O=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;E=function(e,t){return w(e.replace(O,function(e){return l=e,""}),t)}}var j=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=d.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+=d.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),v=n,n=n.replace(g,function(e,t){return o+="-".concat(t),""}),y=E(n,o),n};if("production"!==process.env.NODE_ENV){var S=h;h=function(e,t){S(e,t),l=""}}function A(e,t){void 0===p.inserted[y]&&(c="",h(e,t),p.inserted[y]=c)}var C=function(){var e=j.apply(this,arguments),t="".concat(i,"-").concat(y);return void 0===p.registered[t]&&(p.registered[t]=v),A(".".concat(t),e),t};function k(e,t){var r="";return t.split(" ").forEach(function(t){void 0!==p.registered[t]?e.push(t):r+="".concat(t," ")}),r}function T(e,t){var r=[],n=k(r,e);return r.length<2?e:n+C(r,t)}function D(e){p.inserted[e]=!0}if(N){var x=document.querySelectorAll("[data-lights-".concat(i,"]"));Array.prototype.forEach.call(x,function(e){s.tags[0].parentNode.insertBefore(e,s.tags[0]),e.getAttribute("data-lights-".concat(i)).split(" ").forEach(D)})}var R={flush:function(){N&&(s.flush(),s.inject()),p.inserted={},p.registered={}},hydrate:function(e){e.forEach(D)},cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return T(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))},merge:T,getRegisteredStyles:k,injectGlobal:function(){A("",j.apply(this,arguments))},keyframes:function(){var e=j.apply(this,arguments),t="animation-".concat(y);return A("","@keyframes ".concat(t,"{").concat(e,"}")),t},css:C,sheet:s,caches:p};return n.__SECRET_LIGHTS__=R,R}("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,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()?A:C),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(S.Consumer,null,function(r){var n=t.props;t.mergedProps=T(k,{},n,{theme:n.theme||r});var i="",u=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(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,T(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?T(k,{},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}(q),M=q.flush,F=q.hydrate,Y=q.cx,z=q.merge,H=q.getRegisteredStyles,$=q.injectGlobal,B=q.keyframes,W=q.css,U=q.sheet,Z=q.caches;export{M as flush,F as hydrate,Y as cx,z as merge,H as getRegisteredStyles,$ as injectGlobal,B as keyframes,W as css,U as sheet,Z as caches,S as ThemeContext,x as ThemeProvider,V as useTheme,R as withTheme,I as themeFn,G as styled}; | ||
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=/[A-Z]|^ms/g,b=n(function(e){return e.replace(g,"-$&").toLowerCase()}),_=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 E=/(attr|calc|counters?|url)\(/,w=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],O=_;_=function(e,t){return"content"===e&&("string"!=typeof t||-1===w.indexOf(t)&&!E.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,"\"'`")),O(e,t)}}var N="undefined"!=typeof document,P=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}(),S=s.createContext({}),j=i,A=function(e){return"theme"!==e&&"innerRef"!==e},C=function(){return!0},k=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},T=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(r,!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{},t)}(e,t)})}),x=function(e){return s.createElement(S.Consumer,null,function(t){return e.theme!==t&&(t=T(t)(e.theme)),s.createElement(S.Provider,{value:t},e.children)})};function D(e){var t=e.displayName||e.name||"Component",r=s.forwardRef(function(t,r){return s.createElement(S.Consumer,null,function(n){return s.createElement(e,d({theme:n,ref:r},t))})});return r.displayName="WithTheme(".concat(t,")"),a(r,e)}function R(){return s.useContext(S)}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(n,o){if(void 0!==n.__SECRET_LIGHTS__)return n.__SECRET_LIGHTS__;void 0===o&&(o={});var i,c=o.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(c))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'.concat(c,'" was passed'));N&&(i=o.container||document.head);var a,s,l=new P({key:c,container:i,nonce:o.nonce,speedy:o.speedy}),f="",p=r(function(e){a+=e,N&&l.insert(e,f)});void 0!==o.prefix&&(s={prefix:o.prefix});var h={registered:{},inserted:{},nonce:o.nonce,key:c},d=new e(s);function y(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}`"),y.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(g.has(e))return g.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=y.call(this,e,!1)},this):Object.keys(e).forEach(function(r){if("object"!==u(e[r]))t+=void 0!==h.registered[e[r]]?"".concat(r,"{").concat(h.registered[e[r]],"}"):"".concat(b(r),":").concat(_(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===h.registered[e[r][0]]?e[r].forEach(function(e){t+="".concat(b(r),":").concat(_(r,e),";")}):t+="".concat(r,"{").concat(y.call(this,e[r],!1),"}")}},this),g.set(e,t),t}.call(this,e);default:var n=h.registered[e];return!1===t&&void 0!==n?n:e}}d.use(o.stylisPlugins)(p);var v,m,g=new WeakMap,E=/label:\s*([^\s;\n{]+)\s*;/g,w=function(e,r){return t(e+r)+r};if("production"!==process.env.NODE_ENV){var O=w,S=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;w=function(e,t){return O(e.replace(S,function(e){return f=e,""}),t)}}var j=function(e){var t=arguments,r=!0,n="",o="";null==e||void 0===e.raw?(r=!1,n+=y.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+=y.call(this,t,46===n.charCodeAt(n.length-1)),!0===r&&void 0!==e[o+1]&&(n+=e[o+1])},this),m=n,n=n.replace(E,function(e,t){return o+="-".concat(t),""}),v=w(n,o),n};if("production"!==process.env.NODE_ENV){var A=d;d=function(e,t){A(e,t),f=""}}function C(e,t){void 0===h.inserted[v]&&(a="",d(e,t),h.inserted[v]=a)}var k=function(){var e=j.apply(this,arguments),t="".concat(c,"-").concat(v);return void 0===h.registered[t]&&(h.registered[t]=m),C(".".concat(t),e),t};function T(e,t){var r="";return t.split(" ").forEach(function(t){void 0!==h.registered[t]?e.push(t):r+="".concat(t," ")}),r}function x(e,t){var r=[],n=T(r,e);return r.length<2?e:n+k(r,t)}function D(e){h.inserted[e]=!0}if(N){var R=document.querySelectorAll("style[data-lights-".concat(c,"]"));Array.prototype.forEach.call(R,function(e){e.getAttribute("data-lights-".concat(c)).split(" ").forEach(D),e.parentNode!==i&&i.appendChild(e)})}var V={flush:function(){N&&l.flush(),h.inserted={},h.registered={}},hydrate:function(e){e.forEach(D)},cx:function(){for(var e=arguments,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=e[n];return x(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))},merge:x,getRegisteredStyles:T,injectGlobal:function(){C("",j.apply(this,arguments))},keyframes:function(){var e=j.apply(this,arguments),t="animation-".concat(v);return C("","@keyframes ".concat(t,"{").concat(e,"}")),t},css:k,sheet:l,caches:h};return n.__SECRET_LIGHTS__=V,V}("undefined"!=typeof global?global:{}),q=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()?j:A),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(S.Consumer,null,function(r){var n=t.props;t.mergedProps=k(C,{},n,{theme:n.theme||r});var i="",u=[];return n.className&&(i+=void 0===o?e.getRegisteredStyles(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,k(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?k(C,{},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),G=I.flush,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;export{G as flush,M as hydrate,F as cx,Y as merge,z as getRegisteredStyles,H as injectGlobal,$ as keyframes,B as css,W as sheet,U as caches,S as ThemeContext,x as ThemeProvider,R as useTheme,D as withTheme,L as themeFn,q as styled}; | ||
//# sourceMappingURL=pretty-lights.modern.js.map |
{ | ||
"name": "pretty-lights", | ||
"version": "0.0.12-alpha.0", | ||
"version": "0.0.12-alpha.1", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -5,0 +5,0 @@ "main": "lib/pretty-lights.js", |
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
150532
937