Socket
Socket
Sign inDemoInstall

react-css-variables

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-css-variables - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

80

es/index.js

@@ -11,2 +11,40 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

export function getStyledArguments(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push('; --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push('; --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return args;
}
export function getStyledComponent(keys) {
return styled.div.apply(styled, getStyledArguments(keys));
}
export function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
}
var CSSVariables = function (_PureComponent) {

@@ -21,3 +59,3 @@ _inherits(CSSVariables, _PureComponent);

_this.state = {
component: _this.getStyledComponent(_this.getNonChildrenKeys(props))
component: getStyledComponent(getNonChildrenKeys(props))
};

@@ -28,7 +66,7 @@ return _this;

CSSVariables.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var nextNonChildrenKeys = this.getNonChildrenKeys(nextProps);
var nextNonChildrenKeys = getNonChildrenKeys(nextProps);
if (!isEqual(this.getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
if (!isEqual(getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
this.setState({
component: this.getStyledComponent(nextNonChildrenKeys)
component: getStyledComponent(nextNonChildrenKeys)
});

@@ -38,36 +76,2 @@ }

CSSVariables.prototype.getNonChildrenKeys = function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
};
CSSVariables.prototype.getStyledComponent = function getStyledComponent(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push(' --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push(' --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return styled.div.apply(styled, args);
};
CSSVariables.prototype.render = function render() {

@@ -74,0 +78,0 @@ return React.createElement(this.state.component, this.props);

@@ -5,2 +5,5 @@ 'use strict';

exports.default = undefined;
exports.getStyledArguments = getStyledArguments;
exports.getStyledComponent = getStyledComponent;
exports.getNonChildrenKeys = getNonChildrenKeys;

@@ -27,2 +30,40 @@ var _react = require('react');

function getStyledArguments(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push('; --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push('; --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return args;
}
function getStyledComponent(keys) {
return _styledComponents2.default.div.apply(_styledComponents2.default, getStyledArguments(keys));
}
function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
}
var CSSVariables = function (_PureComponent) {

@@ -37,3 +78,3 @@ _inherits(CSSVariables, _PureComponent);

_this.state = {
component: _this.getStyledComponent(_this.getNonChildrenKeys(props))
component: getStyledComponent(getNonChildrenKeys(props))
};

@@ -44,7 +85,7 @@ return _this;

CSSVariables.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var nextNonChildrenKeys = this.getNonChildrenKeys(nextProps);
var nextNonChildrenKeys = getNonChildrenKeys(nextProps);
if (!(0, _lodash2.default)(this.getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
if (!(0, _lodash2.default)(getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
this.setState({
component: this.getStyledComponent(nextNonChildrenKeys)
component: getStyledComponent(nextNonChildrenKeys)
});

@@ -54,36 +95,2 @@ }

CSSVariables.prototype.getNonChildrenKeys = function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
};
CSSVariables.prototype.getStyledComponent = function getStyledComponent(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push(' --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push(' --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return _styledComponents2.default.div.apply(_styledComponents2.default, args);
};
CSSVariables.prototype.render = function render() {

@@ -96,3 +103,2 @@ return _react2.default.createElement(this.state.component, this.props);

exports.default = CSSVariables;
module.exports = exports['default'];
exports.default = CSSVariables;
{
"name": "react-css-variables",
"version": "1.0.0",
"version": "1.0.1",
"description": "A React component to set CSS variables",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -76,2 +76,5 @@ /*!

var _jsxFileName = '/Users/jide/Projects/react-css-variables/src/index.js';
exports.getStyledArguments = getStyledArguments;
exports.getStyledComponent = getStyledComponent;
exports.getNonChildrenKeys = getNonChildrenKeys;

@@ -98,2 +101,40 @@ var _react = __webpack_require__(2);

function getStyledArguments(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push('; --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push('; --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return args;
}
function getStyledComponent(keys) {
return _styledComponents2.default.div.apply(_styledComponents2.default, getStyledArguments(keys));
}
function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
}
var CSSVariables = function (_PureComponent) {

@@ -108,3 +149,3 @@ _inherits(CSSVariables, _PureComponent);

_this.state = {
component: _this.getStyledComponent(_this.getNonChildrenKeys(props))
component: getStyledComponent(getNonChildrenKeys(props))
};

@@ -115,7 +156,7 @@ return _this;

CSSVariables.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var nextNonChildrenKeys = this.getNonChildrenKeys(nextProps);
var nextNonChildrenKeys = getNonChildrenKeys(nextProps);
if (!(0, _lodash2.default)(this.getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
if (!(0, _lodash2.default)(getNonChildrenKeys(this.props), nextNonChildrenKeys)) {
this.setState({
component: this.getStyledComponent(nextNonChildrenKeys)
component: getStyledComponent(nextNonChildrenKeys)
});

@@ -125,36 +166,2 @@ }

CSSVariables.prototype.getNonChildrenKeys = function getNonChildrenKeys(props) {
return Object.keys(props).filter(function (key) {
return key !== 'children';
});
};
CSSVariables.prototype.getStyledComponent = function getStyledComponent(keys) {
var last = keys.length - 1;
var args = keys.reduce(function (acc, key, i) {
switch (i) {
case 0:
acc[0].push('--' + key + ':');
if (last === 0) {
acc[0].push(';');
}
break;
case last:
acc[0].push(' --' + key + ':');
acc[0].push(';');
break;
default:
acc[0].push(' --' + key + ':');
}
acc.push(function (props) {
return props[key];
});
return acc;
}, [[]]);
return _styledComponents2.default.div.apply(_styledComponents2.default, args);
};
CSSVariables.prototype.render = function render() {

@@ -164,3 +171,3 @@ return _react2.default.createElement(this.state.component, _extends({}, this.props, {

fileName: _jsxFileName,
lineNumber: 55
lineNumber: 59
},

@@ -167,0 +174,0 @@ __self: this

@@ -5,3 +5,3 @@ /*!

*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("styled-components")):"function"==typeof define&&define.amd?define(["react","styled-components"],e):"object"==typeof exports?exports.ReactCSSVariables=e(require("react"),require("styled-components")):t.ReactCSSVariables=e(t.React,t.styled)}(this,function(t,e){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0,e.default=void 0;var i=r(2),c=n(i),f=r(3),s=n(f),l=r(4),p=n(l),h=function(t){function e(r){o(this,e);var n=a(this,t.call(this,r));return n.state={component:n.getStyledComponent(n.getNonChildrenKeys(r))},n}return u(e,t),e.prototype.componentWillReceiveProps=function(t){var e=this.getNonChildrenKeys(t);(0,p.default)(this.getNonChildrenKeys(this.props),e)||this.setState({component:this.getStyledComponent(e)})},e.prototype.getNonChildrenKeys=function(t){return Object.keys(t).filter(function(t){return"children"!==t})},e.prototype.getStyledComponent=function(t){var e=t.length-1,r=t.reduce(function(t,r,n){switch(n){case 0:t[0].push("--"+r+":"),0===e&&t[0].push(";");break;case e:t[0].push(" --"+r+":"),t[0].push(";");break;default:t[0].push(" --"+r+":")}return t.push(function(t){return t[r]}),t},[[]]);return s.default.div.apply(s.default,r)},e.prototype.render=function(){return c.default.createElement(this.state.component,this.props)},e}(i.PureComponent);e.default=h},function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e,r){(function(t,r){function n(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function o(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function a(t){return function(e){return t(e)}}function u(t,e){return null==t?void 0:t[e]}function i(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function c(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function f(t,e){return function(r){return t(e(r))}}function s(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function l(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function p(){this.__data__=we?we(null):{}}function h(t){return this.has(t)&&delete this.__data__[t]}function _(t){var e=this.__data__;if(we){var r=e[t];return r===ht?void 0:r}return fe.call(e,t)?e[t]:void 0}function y(t){var e=this.__data__;return we?void 0!==e[t]:fe.call(e,t)}function d(t,e){var r=this.__data__;return r[t]=we&&void 0===e?ht:e,this}function v(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function b(){this.__data__=[]}function g(t){var e=this.__data__,r=q(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ye.call(e,r,1),!0}function j(t){var e=this.__data__,r=q(e,t);return r<0?void 0:e[r][1]}function m(t){return q(this.__data__,t)>-1}function w(t,e){var r=this.__data__,n=q(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function A(){this.__data__={hash:new l,map:new(be||v),string:new l}}function x(t){return J(this,t).delete(t)}function S(t){return J(this,t).get(t)}function k(t){return J(this,t).has(t)}function C(t,e){return J(this,t).set(t,e),this}function E(t){var e=-1,r=t?t.length:0;for(this.__data__=new O;++e<r;)this.add(t[e])}function P(t){return this.__data__.set(t,ht),this}function R(t){return this.__data__.has(t)}function $(t){this.__data__=new v(t)}function F(){this.__data__=new v}function M(t){return this.__data__.delete(t)}function T(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}function N(t,e){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!be||n.length<pt-1)return n.push([t,e]),this;r=this.__data__=new O(n)}return r.set(t,e),this}function U(t,e){var r=Re(t)||nt(t)?o(t.length,String):[],n=r.length,a=!!n;for(var u in t)!e&&!fe.call(t,u)||a&&("length"==u||X(u,n))||r.push(u);return r}function q(t,e){for(var r=t.length;r--;)if(rt(t[r][0],e))return r;return-1}function z(t){return se.call(t)}function K(t,e,r,n,o){return t===e||(null==t||null==e||!ft(t)&&!st(e)?t!==t&&e!==e:L(t,e,K,r,n,o))}function L(t,e,r,n,o,a){var u=Re(t),c=Re(e),f=bt,s=bt;u||(f=Pe(t),f=f==vt?St:f),c||(s=Pe(e),s=s==vt?St:s);var l=f==St&&!i(t),p=s==St&&!i(e),h=f==s;if(h&&!l)return a||(a=new $),u||$e(t)?W(t,e,r,n,o,a):G(t,e,f,r,n,o,a);if(!(o&yt)){var _=l&&fe.call(t,"__wrapped__"),y=p&&fe.call(e,"__wrapped__");if(_||y){var d=_?t.value():t,v=y?e.value():e;return a||(a=new $),r(d,v,n,o,a)}}return!!h&&(a||(a=new $),H(t,e,r,n,o,a))}function V(t){if(!ft(t)||Z(t))return!1;var e=it(t)||i(t)?le:Dt;return e.test(et(t))}function B(t){return st(t)&&ct(t.length)&&!!Gt[se.call(t)]}function D(t){if(!tt(t))return de(t);var e=[];for(var r in Object(t))fe.call(t,r)&&"constructor"!=r&&e.push(r);return e}function W(t,e,r,o,a,u){var i=a&yt,c=t.length,f=e.length;if(c!=f&&!(i&&f>c))return!1;var s=u.get(t);if(s&&u.get(e))return s==e;var l=-1,p=!0,h=a&_t?new E:void 0;for(u.set(t,e),u.set(e,t);++l<c;){var _=t[l],y=e[l];if(o)var d=i?o(y,_,l,e,t,u):o(_,y,l,t,e,u);if(void 0!==d){if(d)continue;p=!1;break}if(h){if(!n(e,function(t,e){if(!h.has(e)&&(_===t||r(_,t,o,a,u)))return h.add(e)})){p=!1;break}}else if(_!==y&&!r(_,y,o,a,u)){p=!1;break}}return u.delete(t),u.delete(e),p}function G(t,e,r,n,o,a,u){switch(r){case Mt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ft:return!(t.byteLength!=e.byteLength||!n(new he(t),new he(e)));case gt:case jt:case xt:return rt(+t,+e);case mt:return t.name==e.name&&t.message==e.message;case Ct:case Pt:return t==e+"";case At:var i=c;case Et:var f=a&yt;if(i||(i=s),t.size!=e.size&&!f)return!1;var l=u.get(t);if(l)return l==e;a|=_t,u.set(t,e);var p=W(i(t),i(e),n,o,a,u);return u.delete(t),p;case Rt:if(Ee)return Ee.call(t)==Ee.call(e)}return!1}function H(t,e,r,n,o,a){var u=o&yt,i=lt(t),c=i.length,f=lt(e),s=f.length;if(c!=s&&!u)return!1;for(var l=c;l--;){var p=i[l];if(!(u?p in e:fe.call(e,p)))return!1}var h=a.get(t);if(h&&a.get(e))return h==e;var _=!0;a.set(t,e),a.set(e,t);for(var y=u;++l<c;){p=i[l];var d=t[p],v=e[p];if(n)var b=u?n(v,d,p,e,t,a):n(d,v,p,t,e,a);if(!(void 0===b?d===v||r(d,v,n,o,a):b)){_=!1;break}y||(y="constructor"==p)}if(_&&!y){var g=t.constructor,j=e.constructor;g!=j&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j)&&(_=!1)}return a.delete(t),a.delete(e),_}function J(t,e){var r=t.__data__;return Y(e)?r["string"==typeof e?"string":"hash"]:r.map}function Q(t,e){var r=u(t,e);return V(r)?r:void 0}function X(t,e){return e=null==e?dt:e,!!e&&("number"==typeof t||Wt.test(t))&&t>-1&&t%1==0&&t<e}function Y(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Z(t){return!!ie&&ie in t}function tt(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||ae;return t===r}function et(t){if(null!=t){try{return ce.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function rt(t,e){return t===e||t!==t&&e!==e}function nt(t){return at(t)&&fe.call(t,"callee")&&(!_e.call(t,"callee")||se.call(t)==vt)}function ot(t){return null!=t&&ct(t.length)&&!it(t)}function at(t){return st(t)&&ot(t)}function ut(t,e){return K(t,e)}function it(t){var e=ft(t)?se.call(t):"";return e==wt||e==Ot}function ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=dt}function ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function st(t){return!!t&&"object"==typeof t}function lt(t){return ot(t)?U(t):D(t)}var pt=200,ht="__lodash_hash_undefined__",_t=1,yt=2,dt=9007199254740991,vt="[object Arguments]",bt="[object Array]",gt="[object Boolean]",jt="[object Date]",mt="[object Error]",wt="[object Function]",Ot="[object GeneratorFunction]",At="[object Map]",xt="[object Number]",St="[object Object]",kt="[object Promise]",Ct="[object RegExp]",Et="[object Set]",Pt="[object String]",Rt="[object Symbol]",$t="[object WeakMap]",Ft="[object ArrayBuffer]",Mt="[object DataView]",Tt="[object Float32Array]",It="[object Float64Array]",Nt="[object Int8Array]",Ut="[object Int16Array]",qt="[object Int32Array]",zt="[object Uint8Array]",Kt="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Vt="[object Uint32Array]",Bt=/[\\^$.*+?()[\]{}|]/g,Dt=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,Gt={};Gt[Tt]=Gt[It]=Gt[Nt]=Gt[Ut]=Gt[qt]=Gt[zt]=Gt[Kt]=Gt[Lt]=Gt[Vt]=!0,Gt[vt]=Gt[bt]=Gt[Ft]=Gt[gt]=Gt[Mt]=Gt[jt]=Gt[mt]=Gt[wt]=Gt[At]=Gt[xt]=Gt[St]=Gt[Ct]=Gt[Et]=Gt[Pt]=Gt[$t]=!1;var Ht="object"==typeof t&&t&&t.Object===Object&&t,Jt="object"==typeof self&&self&&self.Object===Object&&self,Qt=Ht||Jt||Function("return this")(),Xt="object"==typeof e&&e&&!e.nodeType&&e,Yt=Xt&&"object"==typeof r&&r&&!r.nodeType&&r,Zt=Yt&&Yt.exports===Xt,te=Zt&&Ht.process,ee=function(){try{return te&&te.binding("util")}catch(t){}}(),re=ee&&ee.isTypedArray,ne=Array.prototype,oe=Function.prototype,ae=Object.prototype,ue=Qt["__core-js_shared__"],ie=function(){var t=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ce=oe.toString,fe=ae.hasOwnProperty,se=ae.toString,le=RegExp("^"+ce.call(fe).replace(Bt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=Qt.Symbol,he=Qt.Uint8Array,_e=ae.propertyIsEnumerable,ye=ne.splice,de=f(Object.keys,Object),ve=Q(Qt,"DataView"),be=Q(Qt,"Map"),ge=Q(Qt,"Promise"),je=Q(Qt,"Set"),me=Q(Qt,"WeakMap"),we=Q(Object,"create"),Oe=et(ve),Ae=et(be),xe=et(ge),Se=et(je),ke=et(me),Ce=pe?pe.prototype:void 0,Ee=Ce?Ce.valueOf:void 0;l.prototype.clear=p,l.prototype.delete=h,l.prototype.get=_,l.prototype.has=y,l.prototype.set=d,v.prototype.clear=b,v.prototype.delete=g,v.prototype.get=j,v.prototype.has=m,v.prototype.set=w,O.prototype.clear=A,O.prototype.delete=x,O.prototype.get=S,O.prototype.has=k,O.prototype.set=C,E.prototype.add=E.prototype.push=P,E.prototype.has=R,$.prototype.clear=F,$.prototype.delete=M,$.prototype.get=T,$.prototype.has=I,$.prototype.set=N;var Pe=z;(ve&&Pe(new ve(new ArrayBuffer(1)))!=Mt||be&&Pe(new be)!=At||ge&&Pe(ge.resolve())!=kt||je&&Pe(new je)!=Et||me&&Pe(new me)!=$t)&&(Pe=function(t){var e=se.call(t),r=e==St?t.constructor:void 0,n=r?et(r):void 0;if(n)switch(n){case Oe:return Mt;case Ae:return At;case xe:return kt;case Se:return Et;case ke:return $t}return e});var Re=Array.isArray,$e=re?a(re):B;r.exports=ut}).call(e,function(){return this}(),r(5)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("styled-components")):"function"==typeof define&&define.amd?define(["react","styled-components"],e):"object"==typeof exports?exports.ReactCSSVariables=e(require("react"),require("styled-components")):t.ReactCSSVariables=e(t.React,t.styled)}(this,function(t,e){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(t){var e=t.length-1,r=t.reduce(function(t,r,n){switch(n){case 0:t[0].push("--"+r+":"),0===e&&t[0].push(";");break;case e:t[0].push("; --"+r+":"),t[0].push(";");break;default:t[0].push("; --"+r+":")}return t.push(function(t){return t[r]}),t},[[]]);return r}function i(t){return _.default.div.apply(_.default,c(t))}function f(t){return Object.keys(t).filter(function(t){return"children"!==t})}e.__esModule=!0,e.default=void 0,e.getStyledArguments=c,e.getStyledComponent=i,e.getNonChildrenKeys=f;var s=r(2),l=n(s),p=r(3),_=n(p),h=r(4),y=n(h),d=function(t){function e(r){o(this,e);var n=a(this,t.call(this,r));return n.state={component:i(f(r))},n}return u(e,t),e.prototype.componentWillReceiveProps=function(t){var e=f(t);(0,y.default)(f(this.props),e)||this.setState({component:i(e)})},e.prototype.render=function(){return l.default.createElement(this.state.component,this.props)},e}(s.PureComponent);e.default=d},function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e,r){(function(t,r){function n(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function o(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function a(t){return function(e){return t(e)}}function u(t,e){return null==t?void 0:t[e]}function c(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function i(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function f(t,e){return function(r){return t(e(r))}}function s(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function l(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function p(){this.__data__=we?we(null):{}}function _(t){return this.has(t)&&delete this.__data__[t]}function h(t){var e=this.__data__;if(we){var r=e[t];return r===_t?void 0:r}return fe.call(e,t)?e[t]:void 0}function y(t){var e=this.__data__;return we?void 0!==e[t]:fe.call(e,t)}function d(t,e){var r=this.__data__;return r[t]=we&&void 0===e?_t:e,this}function v(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function b(){this.__data__=[]}function g(t){var e=this.__data__,r=z(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ye.call(e,r,1),!0}function j(t){var e=this.__data__,r=z(e,t);return r<0?void 0:e[r][1]}function m(t){return z(this.__data__,t)>-1}function w(t,e){var r=this.__data__,n=z(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function A(){this.__data__={hash:new l,map:new(be||v),string:new l}}function x(t){return J(this,t).delete(t)}function S(t){return J(this,t).get(t)}function k(t){return J(this,t).has(t)}function E(t,e){return J(this,t).set(t,e),this}function P(t){var e=-1,r=t?t.length:0;for(this.__data__=new O;++e<r;)this.add(t[e])}function C(t){return this.__data__.set(t,_t),this}function R(t){return this.__data__.has(t)}function $(t){this.__data__=new v(t)}function F(){this.__data__=new v}function M(t){return this.__data__.delete(t)}function T(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}function U(t,e){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!be||n.length<pt-1)return n.push([t,e]),this;r=this.__data__=new O(n)}return r.set(t,e),this}function q(t,e){var r=Re(t)||nt(t)?o(t.length,String):[],n=r.length,a=!!n;for(var u in t)!e&&!fe.call(t,u)||a&&("length"==u||X(u,n))||r.push(u);return r}function z(t,e){for(var r=t.length;r--;)if(rt(t[r][0],e))return r;return-1}function L(t){return se.call(t)}function V(t,e,r,n,o){return t===e||(null==t||null==e||!ft(t)&&!st(e)?t!==t&&e!==e:B(t,e,V,r,n,o))}function B(t,e,r,n,o,a){var u=Re(t),i=Re(e),f=bt,s=bt;u||(f=Ce(t),f=f==vt?St:f),i||(s=Ce(e),s=s==vt?St:s);var l=f==St&&!c(t),p=s==St&&!c(e),_=f==s;if(_&&!l)return a||(a=new $),u||$e(t)?G(t,e,r,n,o,a):K(t,e,f,r,n,o,a);if(!(o&yt)){var h=l&&fe.call(t,"__wrapped__"),y=p&&fe.call(e,"__wrapped__");if(h||y){var d=h?t.value():t,v=y?e.value():e;return a||(a=new $),r(d,v,n,o,a)}}return!!_&&(a||(a=new $),H(t,e,r,n,o,a))}function D(t){if(!ft(t)||Z(t))return!1;var e=ct(t)||c(t)?le:Nt;return e.test(et(t))}function W(t){return st(t)&&it(t.length)&&!!Kt[se.call(t)]}function N(t){if(!tt(t))return de(t);var e=[];for(var r in Object(t))fe.call(t,r)&&"constructor"!=r&&e.push(r);return e}function G(t,e,r,o,a,u){var c=a&yt,i=t.length,f=e.length;if(i!=f&&!(c&&f>i))return!1;var s=u.get(t);if(s&&u.get(e))return s==e;var l=-1,p=!0,_=a&ht?new P:void 0;for(u.set(t,e),u.set(e,t);++l<i;){var h=t[l],y=e[l];if(o)var d=c?o(y,h,l,e,t,u):o(h,y,l,t,e,u);if(void 0!==d){if(d)continue;p=!1;break}if(_){if(!n(e,function(t,e){if(!_.has(e)&&(h===t||r(h,t,o,a,u)))return _.add(e)})){p=!1;break}}else if(h!==y&&!r(h,y,o,a,u)){p=!1;break}}return u.delete(t),u.delete(e),p}function K(t,e,r,n,o,a,u){switch(r){case Mt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ft:return!(t.byteLength!=e.byteLength||!n(new _e(t),new _e(e)));case gt:case jt:case xt:return rt(+t,+e);case mt:return t.name==e.name&&t.message==e.message;case Et:case Ct:return t==e+"";case At:var c=i;case Pt:var f=a&yt;if(c||(c=s),t.size!=e.size&&!f)return!1;var l=u.get(t);if(l)return l==e;a|=ht,u.set(t,e);var p=G(c(t),c(e),n,o,a,u);return u.delete(t),p;case Rt:if(Pe)return Pe.call(t)==Pe.call(e)}return!1}function H(t,e,r,n,o,a){var u=o&yt,c=lt(t),i=c.length,f=lt(e),s=f.length;if(i!=s&&!u)return!1;for(var l=i;l--;){var p=c[l];if(!(u?p in e:fe.call(e,p)))return!1}var _=a.get(t);if(_&&a.get(e))return _==e;var h=!0;a.set(t,e),a.set(e,t);for(var y=u;++l<i;){p=c[l];var d=t[p],v=e[p];if(n)var b=u?n(v,d,p,e,t,a):n(d,v,p,t,e,a);if(!(void 0===b?d===v||r(d,v,n,o,a):b)){h=!1;break}y||(y="constructor"==p)}if(h&&!y){var g=t.constructor,j=e.constructor;g!=j&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j)&&(h=!1)}return a.delete(t),a.delete(e),h}function J(t,e){var r=t.__data__;return Y(e)?r["string"==typeof e?"string":"hash"]:r.map}function Q(t,e){var r=u(t,e);return D(r)?r:void 0}function X(t,e){return e=null==e?dt:e,!!e&&("number"==typeof t||Gt.test(t))&&t>-1&&t%1==0&&t<e}function Y(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Z(t){return!!ce&&ce in t}function tt(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||ae;return t===r}function et(t){if(null!=t){try{return ie.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function rt(t,e){return t===e||t!==t&&e!==e}function nt(t){return at(t)&&fe.call(t,"callee")&&(!he.call(t,"callee")||se.call(t)==vt)}function ot(t){return null!=t&&it(t.length)&&!ct(t)}function at(t){return st(t)&&ot(t)}function ut(t,e){return V(t,e)}function ct(t){var e=ft(t)?se.call(t):"";return e==wt||e==Ot}function it(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=dt}function ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function st(t){return!!t&&"object"==typeof t}function lt(t){return ot(t)?q(t):N(t)}var pt=200,_t="__lodash_hash_undefined__",ht=1,yt=2,dt=9007199254740991,vt="[object Arguments]",bt="[object Array]",gt="[object Boolean]",jt="[object Date]",mt="[object Error]",wt="[object Function]",Ot="[object GeneratorFunction]",At="[object Map]",xt="[object Number]",St="[object Object]",kt="[object Promise]",Et="[object RegExp]",Pt="[object Set]",Ct="[object String]",Rt="[object Symbol]",$t="[object WeakMap]",Ft="[object ArrayBuffer]",Mt="[object DataView]",Tt="[object Float32Array]",It="[object Float64Array]",Ut="[object Int8Array]",qt="[object Int16Array]",zt="[object Int32Array]",Lt="[object Uint8Array]",Vt="[object Uint8ClampedArray]",Bt="[object Uint16Array]",Dt="[object Uint32Array]",Wt=/[\\^$.*+?()[\]{}|]/g,Nt=/^\[object .+?Constructor\]$/,Gt=/^(?:0|[1-9]\d*)$/,Kt={};Kt[Tt]=Kt[It]=Kt[Ut]=Kt[qt]=Kt[zt]=Kt[Lt]=Kt[Vt]=Kt[Bt]=Kt[Dt]=!0,Kt[vt]=Kt[bt]=Kt[Ft]=Kt[gt]=Kt[Mt]=Kt[jt]=Kt[mt]=Kt[wt]=Kt[At]=Kt[xt]=Kt[St]=Kt[Et]=Kt[Pt]=Kt[Ct]=Kt[$t]=!1;var Ht="object"==typeof t&&t&&t.Object===Object&&t,Jt="object"==typeof self&&self&&self.Object===Object&&self,Qt=Ht||Jt||Function("return this")(),Xt="object"==typeof e&&e&&!e.nodeType&&e,Yt=Xt&&"object"==typeof r&&r&&!r.nodeType&&r,Zt=Yt&&Yt.exports===Xt,te=Zt&&Ht.process,ee=function(){try{return te&&te.binding("util")}catch(t){}}(),re=ee&&ee.isTypedArray,ne=Array.prototype,oe=Function.prototype,ae=Object.prototype,ue=Qt["__core-js_shared__"],ce=function(){var t=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ie=oe.toString,fe=ae.hasOwnProperty,se=ae.toString,le=RegExp("^"+ie.call(fe).replace(Wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pe=Qt.Symbol,_e=Qt.Uint8Array,he=ae.propertyIsEnumerable,ye=ne.splice,de=f(Object.keys,Object),ve=Q(Qt,"DataView"),be=Q(Qt,"Map"),ge=Q(Qt,"Promise"),je=Q(Qt,"Set"),me=Q(Qt,"WeakMap"),we=Q(Object,"create"),Oe=et(ve),Ae=et(be),xe=et(ge),Se=et(je),ke=et(me),Ee=pe?pe.prototype:void 0,Pe=Ee?Ee.valueOf:void 0;l.prototype.clear=p,l.prototype.delete=_,l.prototype.get=h,l.prototype.has=y,l.prototype.set=d,v.prototype.clear=b,v.prototype.delete=g,v.prototype.get=j,v.prototype.has=m,v.prototype.set=w,O.prototype.clear=A,O.prototype.delete=x,O.prototype.get=S,O.prototype.has=k,O.prototype.set=E,P.prototype.add=P.prototype.push=C,P.prototype.has=R,$.prototype.clear=F,$.prototype.delete=M,$.prototype.get=T,$.prototype.has=I,$.prototype.set=U;var Ce=L;(ve&&Ce(new ve(new ArrayBuffer(1)))!=Mt||be&&Ce(new be)!=At||ge&&Ce(ge.resolve())!=kt||je&&Ce(new je)!=Pt||me&&Ce(new me)!=$t)&&(Ce=function(t){var e=se.call(t),r=e==St?t.constructor:void 0,n=r?et(r):void 0;if(n)switch(n){case Oe:return Mt;case Ae:return At;case xe:return kt;case Se:return Pt;case ke:return $t}return e});var Re=Array.isArray,$e=re?a(re):W;r.exports=ut}).call(e,function(){return this}(),r(5)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}])});
//# sourceMappingURL=react-css-variables.min.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc