Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

theming

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

theming - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Changelog

### 2.1.2 (2018-11-2)
- Added exporting of ThemeProviderProps ([#67](https://github.com/cssinjs/theming/pull/67))
### 2.1.1 (2018-11-1)

@@ -8,0 +12,0 @@

182

dist/theming.js

@@ -10,3 +10,3 @@ (function (global, factory) {

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
}

@@ -1251,6 +1251,6 @@

Object.defineProperty(exports,"__esModule",{value:!0});
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.placeholder"):60113;
function q(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}exports.typeOf=q;exports.AsyncMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&("function"===typeof a.then||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return q(a)===l};exports.isContextConsumer=function(a){return q(a)===k};exports.isContextProvider=function(a){return q(a)===h};exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};
exports.isForwardRef=function(a){return q(a)===m};exports.isFragment=function(a){return q(a)===e};exports.isProfiler=function(a){return q(a)===g};exports.isPortal=function(a){return q(a)===d};exports.isStrictMode=function(a){return q(a)===f};
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.concurrent_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):60115,r=b?Symbol.for("react.lazy"):
60116;function t(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}function u(a){return t(a)===l}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d;
exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return u(a)};exports.isConcurrentMode=u;exports.isContextConsumer=function(a){return t(a)===k};exports.isContextProvider=function(a){return t(a)===h};
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===m};exports.isFragment=function(a){return t(a)===e};exports.isProfiler=function(a){return t(a)===g};exports.isPortal=function(a){return t(a)===d};exports.isStrictMode=function(a){return t(a)===f};
});

@@ -1261,20 +1261,22 @@

var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
var reactIs_production_min_3 = reactIs_production_min.ContextConsumer;
var reactIs_production_min_4 = reactIs_production_min.ContextProvider;
var reactIs_production_min_5 = reactIs_production_min.Element;
var reactIs_production_min_6 = reactIs_production_min.ForwardRef;
var reactIs_production_min_7 = reactIs_production_min.Fragment;
var reactIs_production_min_8 = reactIs_production_min.Profiler;
var reactIs_production_min_9 = reactIs_production_min.Portal;
var reactIs_production_min_10 = reactIs_production_min.StrictMode;
var reactIs_production_min_11 = reactIs_production_min.isValidElementType;
var reactIs_production_min_12 = reactIs_production_min.isAsyncMode;
var reactIs_production_min_13 = reactIs_production_min.isContextConsumer;
var reactIs_production_min_14 = reactIs_production_min.isContextProvider;
var reactIs_production_min_15 = reactIs_production_min.isElement;
var reactIs_production_min_16 = reactIs_production_min.isForwardRef;
var reactIs_production_min_17 = reactIs_production_min.isFragment;
var reactIs_production_min_18 = reactIs_production_min.isProfiler;
var reactIs_production_min_19 = reactIs_production_min.isPortal;
var reactIs_production_min_20 = reactIs_production_min.isStrictMode;
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
var reactIs_production_min_6 = reactIs_production_min.Element;
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
var reactIs_production_min_8 = reactIs_production_min.Fragment;
var reactIs_production_min_9 = reactIs_production_min.Profiler;
var reactIs_production_min_10 = reactIs_production_min.Portal;
var reactIs_production_min_11 = reactIs_production_min.StrictMode;
var reactIs_production_min_12 = reactIs_production_min.isValidElementType;
var reactIs_production_min_13 = reactIs_production_min.isAsyncMode;
var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode;
var reactIs_production_min_15 = reactIs_production_min.isContextConsumer;
var reactIs_production_min_16 = reactIs_production_min.isContextProvider;
var reactIs_production_min_17 = reactIs_production_min.isElement;
var reactIs_production_min_18 = reactIs_production_min.isForwardRef;
var reactIs_production_min_19 = reactIs_production_min.isFragment;
var reactIs_production_min_20 = reactIs_production_min.isProfiler;
var reactIs_production_min_21 = reactIs_production_min.isPortal;
var reactIs_production_min_22 = reactIs_production_min.isStrictMode;

@@ -1301,5 +1303,7 @@ var reactIs_development = createCommonjsModule(function (module, exports) {

var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_PLACEHOLDER_TYPE = hasSymbol ? Symbol.for('react.placeholder') : 0xead1;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;

@@ -1309,5 +1313,58 @@ function isValidElementType(type) {

// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_PLACEHOLDER_TYPE || typeof type === 'object' && type !== null && (typeof type.then === 'function' || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
}
/**
* Forked from fbjs/warning:
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
*
* Only change is we use console.warn instead of console.error,
* and do nothing when 'console' is not supported.
* This really simplifies the code.
* ---
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var lowPriorityWarning = function () {};
{
var printWarning = function (format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.warn(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
lowPriorityWarning = function (condition, format) {
if (format === undefined) {
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
}
var lowPriorityWarning$1 = lowPriorityWarning;
function typeOf(object) {

@@ -1322,3 +1379,3 @@ if (typeof object === 'object' && object !== null) {

switch (type) {
case REACT_ASYNC_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_FRAGMENT_TYPE:

@@ -1348,3 +1405,5 @@ case REACT_PROFILER_TYPE:

var AsyncMode = REACT_ASYNC_MODE_TYPE;
// AsyncMode alias is deprecated along with isAsyncMode
var AsyncMode = REACT_CONCURRENT_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;

@@ -1359,5 +1418,17 @@ var ContextProvider = REACT_PROVIDER_TYPE;

var hasWarnedAboutDeprecatedIsAsyncMode = false;
// AsyncMode should be deprecated
function isAsyncMode(object) {
return typeOf(object) === REACT_ASYNC_MODE_TYPE;
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
}
}
return isConcurrentMode(object);
}
function isConcurrentMode(object) {
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {

@@ -1390,2 +1461,3 @@ return typeOf(object) === REACT_CONTEXT_TYPE;

exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;

@@ -1401,2 +1473,3 @@ exports.ContextProvider = ContextProvider;

exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;

@@ -1417,20 +1490,22 @@ exports.isContextProvider = isContextProvider;

var reactIs_development_2 = reactIs_development.AsyncMode;
var reactIs_development_3 = reactIs_development.ContextConsumer;
var reactIs_development_4 = reactIs_development.ContextProvider;
var reactIs_development_5 = reactIs_development.Element;
var reactIs_development_6 = reactIs_development.ForwardRef;
var reactIs_development_7 = reactIs_development.Fragment;
var reactIs_development_8 = reactIs_development.Profiler;
var reactIs_development_9 = reactIs_development.Portal;
var reactIs_development_10 = reactIs_development.StrictMode;
var reactIs_development_11 = reactIs_development.isValidElementType;
var reactIs_development_12 = reactIs_development.isAsyncMode;
var reactIs_development_13 = reactIs_development.isContextConsumer;
var reactIs_development_14 = reactIs_development.isContextProvider;
var reactIs_development_15 = reactIs_development.isElement;
var reactIs_development_16 = reactIs_development.isForwardRef;
var reactIs_development_17 = reactIs_development.isFragment;
var reactIs_development_18 = reactIs_development.isProfiler;
var reactIs_development_19 = reactIs_development.isPortal;
var reactIs_development_20 = reactIs_development.isStrictMode;
var reactIs_development_3 = reactIs_development.ConcurrentMode;
var reactIs_development_4 = reactIs_development.ContextConsumer;
var reactIs_development_5 = reactIs_development.ContextProvider;
var reactIs_development_6 = reactIs_development.Element;
var reactIs_development_7 = reactIs_development.ForwardRef;
var reactIs_development_8 = reactIs_development.Fragment;
var reactIs_development_9 = reactIs_development.Profiler;
var reactIs_development_10 = reactIs_development.Portal;
var reactIs_development_11 = reactIs_development.StrictMode;
var reactIs_development_12 = reactIs_development.isValidElementType;
var reactIs_development_13 = reactIs_development.isAsyncMode;
var reactIs_development_14 = reactIs_development.isConcurrentMode;
var reactIs_development_15 = reactIs_development.isContextConsumer;
var reactIs_development_16 = reactIs_development.isContextProvider;
var reactIs_development_17 = reactIs_development.isElement;
var reactIs_development_18 = reactIs_development.isForwardRef;
var reactIs_development_19 = reactIs_development.isFragment;
var reactIs_development_20 = reactIs_development.isProfiler;
var reactIs_development_21 = reactIs_development.isPortal;
var reactIs_development_22 = reactIs_development.isStrictMode;

@@ -1444,6 +1519,2 @@ var reactIs = createCommonjsModule(function (module) {

var _ReactIs$ForwardRef;
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/**

@@ -1457,2 +1528,3 @@ * Copyright 2015, Yahoo! Inc.

childContextTypes: true,
contextType: true,
contextTypes: true,

@@ -1478,4 +1550,10 @@ defaultProps: true,

var TYPE_STATICS = _defineProperty$1({}, reactIs.ForwardRef, (_ReactIs$ForwardRef = {}, _defineProperty$1(_ReactIs$ForwardRef, '$$typeof', true), _defineProperty$1(_ReactIs$ForwardRef, 'render', true), _ReactIs$ForwardRef));
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
var defineProperty = Object.defineProperty;

@@ -1482,0 +1560,0 @@ var getOwnPropertyNames = Object.getOwnPropertyNames;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.theming={},e.react)}(this,function(e,y){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}y=y&&y.hasOwnProperty("default")?y.default:y;var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}})()&&Object.assign;function u(){}var d=r(function(e){e.exports=function(){function e(e,t,r,n,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}var r={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=u,r.PropTypes=r}()}),a="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c="__global_unique_id__",h=function(){return a[c]=(a[c]||0)+1};function f(e){return function(){return e}}var s=function(){};s.thatReturns=f,s.thatReturnsFalse=f(!1),s.thatReturnsTrue=f(!0),s.thatReturnsNull=f(null),s.thatReturnsThis=function(){return this},s.thatReturnsArgument=function(e){return e};var m=s,l=r(function(e,t){t.__esModule=!0;r(y);var a=r(d),c=r(h);r(m);function r(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=1073741823;t.default=function(e,u){var t,r,n="__create-react-context-"+(0,c.default)()+"__",o=function(a){function c(){var e,t,r,n;f(this,c);for(var o=arguments.length,i=Array(o),u=0;u<o;u++)i[u]=arguments[u];return(e=t=s(this,a.call.apply(a,[this].concat(i)))).emitter=(r=t.props.value,n=[],{on:function(e){n.push(e)},off:function(t){n=n.filter(function(e){return e!==t})},get:function(){return r},set:function(e,t){r=e,n.forEach(function(e){return e(r,t)})}}),s(t,e)}return l(c,a),c.prototype.getChildContext=function(){var e;return(e={})[n]=this.emitter,e},c.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,r=e.value,n=void 0;((o=t)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof u?u(t,r):p,0!=(n|=0)&&this.emitter.set(e.value,n))}var o,i},c.prototype.render=function(){return this.props.children},c}(y.Component);o.childContextTypes=((t={})[n]=a.default.object.isRequired,t);var i=function(i){function u(){var e,r;f(this,u);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=r=s(this,i.call.apply(i,[this].concat(n)))).state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},s(r,e)}return l(u,i),u.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?p:t},u.prototype.componentDidMount=function(){this.context[n]&&this.context[n].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?p:e},u.prototype.componentWillUnmount=function(){this.context[n]&&this.context[n].off(this.onUpdate)},u.prototype.getValue=function(){return this.context[n]?this.context[n].get():e},u.prototype.render=function(){return e=this.props.children,(Array.isArray(e)?e[0]:e)(this.state.value);var e},u}(y.Component);return i.contextTypes=((r={})[n]=a.default.object,r),{Provider:o,Consumer:i}},e.exports=t.default});t(l);var p=t(r(function(e,t){t.__esModule=!0;var r=o(y),n=o(l);function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default.createContext||n.default,e.exports=t.default}));function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return(b=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)}var P=function(){};function g(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function O(i){var e,t;return t=e=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var o=n.prototype;return o.getTheme=function(e){var t=this.props.theme;if("function"!=typeof t)return P(g(t),"[ThemeProvider] Please make your theme prop a plain object"),b({},e,t);var r=t(e);return P(g(r),"[ThemeProvider] Please return an object from your theme function"),r},o.render=function(){var t=this,r=this.props.children;return r?y.createElement(i.Consumer,null,function(e){return y.createElement(i.Provider,{value:t.getTheme(e)},r)}):null},n}(y.Component),v(e,"propTypes",{children:d.node,theme:d.oneOfType([d.shape({}),d.func]).isRequired}),v(e,"defaultProps",{children:null}),t}var _=r(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.placeholder"):60113;function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case s:case i:case a:case u:return e;default:switch(e=e&&e.$$typeof){case f:case l:case c:return e;default:return t}}case o:return t}}}t.typeOf=y,t.AsyncMode=s,t.ContextConsumer=f,t.ContextProvider=c,t.Element=n,t.ForwardRef=l,t.Fragment=i,t.Profiler=a,t.Portal=o,t.StrictMode=u,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===u||e===p||"object"==typeof e&&null!==e&&("function"==typeof e.then||e.$$typeof===c||e.$$typeof===f||e.$$typeof===l)},t.isAsyncMode=function(e){return y(e)===s},t.isContextConsumer=function(e){return y(e)===f},t.isContextProvider=function(e){return y(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return y(e)===l},t.isFragment=function(e){return y(e)===i},t.isProfiler=function(e){return y(e)===a},t.isPortal=function(e){return y(e)===o},t.isStrictMode=function(e){return y(e)===u}});t(_);_.typeOf,_.AsyncMode,_.ContextConsumer,_.ContextProvider,_.Element,_.ForwardRef,_.Fragment,_.Profiler,_.Portal,_.StrictMode,_.isValidElementType,_.isAsyncMode,_.isContextConsumer,_.isContextProvider,_.isElement,_.isForwardRef,_.isFragment,_.isProfiler,_.isPortal,_.isStrictMode;var j=r(function(e,t){});t(j);j.typeOf,j.AsyncMode,j.ContextConsumer,j.ContextProvider,j.Element,j.ForwardRef,j.Fragment,j.Profiler,j.Portal,j.StrictMode,j.isValidElementType,j.isAsyncMode,j.isContextConsumer,j.isContextProvider,j.isElement,j.isForwardRef,j.isFragment,j.isProfiler,j.isPortal,j.isStrictMode;var w,x=r(function(e){e.exports=_});function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var C={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},S={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},R=T({},x.ForwardRef,(T(w={},"$$typeof",!0),T(w,"render",!0),w)),E=Object.defineProperty,M=Object.getOwnPropertyNames,$=Object.getOwnPropertySymbols,F=Object.getOwnPropertyDescriptor,A=Object.getPrototypeOf,k=Object.prototype;var N=function e(t,r,n){if("string"==typeof r)return t;if(k){var o=A(r);o&&o!==k&&e(t,o,n)}var i=M(r);$&&(i=i.concat($(r)));for(var u=R[t.$$typeof]||C,a=R[r.$$typeof]||C,c=0;c<i.length;++c){var f=i[c];if(!(S[f]||n&&n[f]||a&&a[f]||u&&u[f])){var s=F(r,f);try{E(t,f,s)}catch(e){}}}return t},q=t(r(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.displayName||e.name||("string"==typeof e&&0<e.length?e:"Unknown")}}));function U(i){return function(n,e){var t=(void 0===e?{}:e).forwardInnerRef,o=void 0!==t&&t;function r(e){var t=e.innerRef,r=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,["innerRef"]);return r[o?"innerRef":"ref"]=t,y.createElement(i.Consumer,null,function(e){return y.createElement(n,b({theme:e},r))})}return r.displayName="WithTheme("+q(n)+")",N(r,n),r}}var V=p({});function B(e){return{withTheme:U(e),ThemeProvider:O(e)}}var D=B(V),I=D.withTheme,W=D.ThemeProvider;e.ThemeContext=V,e.withTheme=I,e.createTheming=B,e.ThemeProvider=W,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.theming={},e.react)}(this,function(e,y){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}y=y&&y.hasOwnProperty("default")?y.default:y;var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}})()&&Object.assign;function u(){}var d=r(function(e){e.exports=function(){function e(e,t,r,n,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}var r={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=u,r.PropTypes=r}()}),a="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c="__global_unique_id__",m=function(){return a[c]=(a[c]||0)+1};function f(e){return function(){return e}}var s=function(){};s.thatReturns=f,s.thatReturnsFalse=f(!1),s.thatReturnsTrue=f(!0),s.thatReturnsNull=f(null),s.thatReturnsThis=function(){return this},s.thatReturnsArgument=function(e){return e};var h=s,p=r(function(e,t){t.__esModule=!0;r(y);var a=r(d),c=r(m);r(h);function r(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=1073741823;t.default=function(e,u){var t,r,n="__create-react-context-"+(0,c.default)()+"__",o=function(a){function c(){var e,t,r,n;f(this,c);for(var o=arguments.length,i=Array(o),u=0;u<o;u++)i[u]=arguments[u];return(e=t=s(this,a.call.apply(a,[this].concat(i)))).emitter=(r=t.props.value,n=[],{on:function(e){n.push(e)},off:function(t){n=n.filter(function(e){return e!==t})},get:function(){return r},set:function(e,t){r=e,n.forEach(function(e){return e(r,t)})}}),s(t,e)}return p(c,a),c.prototype.getChildContext=function(){var e;return(e={})[n]=this.emitter,e},c.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,r=e.value,n=void 0;((o=t)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof u?u(t,r):l,0!=(n|=0)&&this.emitter.set(e.value,n))}var o,i},c.prototype.render=function(){return this.props.children},c}(y.Component);o.childContextTypes=((t={})[n]=a.default.object.isRequired,t);var i=function(i){function u(){var e,r;f(this,u);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=r=s(this,i.call.apply(i,[this].concat(n)))).state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},s(r,e)}return p(u,i),u.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?l:t},u.prototype.componentDidMount=function(){this.context[n]&&this.context[n].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?l:e},u.prototype.componentWillUnmount=function(){this.context[n]&&this.context[n].off(this.onUpdate)},u.prototype.getValue=function(){return this.context[n]?this.context[n].get():e},u.prototype.render=function(){return e=this.props.children,(Array.isArray(e)?e[0]:e)(this.state.value);var e},u}(y.Component);return i.contextTypes=((r={})[n]=a.default.object,r),{Provider:o,Consumer:i}},e.exports=t.default});t(p);var l=t(r(function(e,t){t.__esModule=!0;var r=o(y),n=o(p);function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default.createContext||n.default,e.exports=t.default}));function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return(b=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)}var P=function(){};function g(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function O(i){var e,t;return t=e=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),(t.prototype.constructor=t).__proto__=r;var o=n.prototype;return o.getTheme=function(e){var t=this.props.theme;if("function"!=typeof t)return P(g(t),"[ThemeProvider] Please make your theme prop a plain object"),b({},e,t);var r=t(e);return P(g(r),"[ThemeProvider] Please return an object from your theme function"),r},o.render=function(){var t=this,r=this.props.children;return r?y.createElement(i.Consumer,null,function(e){return y.createElement(i.Provider,{value:t.getTheme(e)},r)}):null},n}(y.Component),v(e,"propTypes",{children:d.node,theme:d.oneOfType([d.shape({}),d.func]).isRequired}),v(e,"defaultProps",{children:null}),t}var _=r(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116;function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case s:case i:case a:case u:return e;default:switch(e=e&&e.$$typeof){case f:case p:case c:return e;default:return t}}case o:return t}}}function h(e){return m(e)===s}t.typeOf=m,t.AsyncMode=s,t.ConcurrentMode=s,t.ContextConsumer=f,t.ContextProvider=c,t.Element=n,t.ForwardRef=p,t.Fragment=i,t.Profiler=a,t.Portal=o,t.StrictMode=u,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===u||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===c||e.$$typeof===f||e.$$typeof===p)},t.isAsyncMode=function(e){return h(e)},t.isConcurrentMode=h,t.isContextConsumer=function(e){return m(e)===f},t.isContextProvider=function(e){return m(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return m(e)===p},t.isFragment=function(e){return m(e)===i},t.isProfiler=function(e){return m(e)===a},t.isPortal=function(e){return m(e)===o},t.isStrictMode=function(e){return m(e)===u}});t(_);_.typeOf,_.AsyncMode,_.ConcurrentMode,_.ContextConsumer,_.ContextProvider,_.Element,_.ForwardRef,_.Fragment,_.Profiler,_.Portal,_.StrictMode,_.isValidElementType,_.isAsyncMode,_.isConcurrentMode,_.isContextConsumer,_.isContextProvider,_.isElement,_.isForwardRef,_.isFragment,_.isProfiler,_.isPortal,_.isStrictMode;var j=r(function(e,t){});t(j);j.typeOf,j.AsyncMode,j.ConcurrentMode,j.ContextConsumer,j.ContextProvider,j.Element,j.ForwardRef,j.Fragment,j.Profiler,j.Portal,j.StrictMode,j.isValidElementType,j.isAsyncMode,j.isConcurrentMode,j.isContextConsumer,j.isContextProvider,j.isElement,j.isForwardRef,j.isFragment,j.isProfiler,j.isPortal,j.isStrictMode;var x=r(function(e){e.exports=_}),w={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},C={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},T={};T[x.ForwardRef]={$$typeof:!0,render:!0};var S=Object.defineProperty,M=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols,E=Object.getOwnPropertyDescriptor,$=Object.getPrototypeOf,F=Object.prototype;var A=function e(t,r,n){if("string"==typeof r)return t;if(F){var o=$(r);o&&o!==F&&e(t,o,n)}var i=M(r);R&&(i=i.concat(R(r)));for(var u=T[t.$$typeof]||w,a=T[r.$$typeof]||w,c=0;c<i.length;++c){var f=i[c];if(!(C[f]||n&&n[f]||a&&a[f]||u&&u[f])){var s=E(r,f);try{S(t,f,s)}catch(e){}}}return t},k=t(r(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.displayName||e.name||("string"==typeof e&&0<e.length?e:"Unknown")}}));function N(i){return function(n,e){var t=(void 0===e?{}:e).forwardInnerRef,o=void 0!==t&&t;function r(e){var t=e.innerRef,r=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,["innerRef"]);return r[o?"innerRef":"ref"]=t,y.createElement(i.Consumer,null,function(e){return y.createElement(n,b({theme:e},r))})}return r.displayName="WithTheme("+k(n)+")",A(r,n),r}}var q=l({});function U(e){return{withTheme:N(e),ThemeProvider:O(e)}}var V=U(q),B=V.withTheme,D=V.ThemeProvider;e.ThemeContext=q,e.withTheme=B,e.createTheming=U,e.ThemeProvider=D,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "theming",
"version": "2.1.1",
"version": "2.1.2",
"description": "Unified CSSinJS theming solution for React",

@@ -69,21 +69,21 @@ "main": "dist/theming.cjs.js",

"@babel/register": "^7.0.0",
"ava": "^1.0.0-beta.8",
"ava": "^1.0.0-rc.1",
"coveralls": "^3.0.0",
"eslint": "^5.6.0",
"eslint": "^5.8.0",
"eslint-config-jss": "^5.0.1",
"flow-bin": "^0.81.0",
"nyc": "^13.0.1",
"react": "^16.0.0",
"react-test-renderer": "^16.0.0",
"flow-bin": "^0.85.0",
"nyc": "^13.1.0",
"react": "^16.6.0",
"react-test-renderer": "^16.6.0",
"rimraf": "^2.6.1",
"rollup": "^0.66.2",
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.1.8",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-size-snapshot": "^0.7.0",
"rollup-plugin-uglify": "^6.0.0",
"sinon": "^6.3.3",
"typescript": "^3.1.3"
"sinon": "^7.1.1",
"typescript": "^3.1.6"
},

@@ -93,3 +93,3 @@ "dependencies": {

"create-react-context": "^0.2.3",
"hoist-non-react-statics": "^3.0.1",
"hoist-non-react-statics": "^3.1.0",
"prop-types": "^15.5.8",

@@ -96,0 +96,0 @@ "react-display-name": "^0.2.4",

@@ -9,9 +9,9 @@ // @flow

type Props = {
export type ThemeProviderProps<Theme> = {
children: Node,
theme: Object | (outerTheme: Object) => Object,
theme: Theme | (outerTheme: Theme) => Theme,
};
export default function createThemeProvider(context: Context<{}>) {
return class ThemeProvider extends React.Component<Props> {
export default function createThemeProvider<Theme>(context: Context<Theme>) {
return class ThemeProvider extends React.Component<ThemeProviderProps<Theme>> {
static propTypes = {

@@ -25,3 +25,3 @@ children: PropTypes.node,

// Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
getTheme(outerTheme: Object) {
getTheme(outerTheme: Theme) {
const { theme } = this.props;

@@ -28,0 +28,0 @@

@@ -43,3 +43,4 @@ import * as React from 'react';

ThemeProvider,
ThemeProviderProps,
Theming,
}

@@ -5,3 +5,3 @@ // @flow

import createThemeProvider from './create-theme-provider';
import createThemeProvider, { type ThemeProviderProps } from './create-theme-provider';
import createWithTheme from './create-with-theme';

@@ -16,3 +16,3 @@

const ThemeContext = createReactContext({});
const ThemeContext = createReactContext<{}>({});

@@ -31,3 +31,6 @@ function createTheming(context: Context<{}>): Theming {

export type { Theming };
export type {
Theming,
ThemeProviderProps,
};

@@ -34,0 +37,0 @@ export {

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