@hig/theme-context
Advanced tools
Comparing version 3.0.3 to 4.0.0
import createReactContext from 'create-react-context'; | ||
import defaultTheme from '@hig/theme-data/build/json/lightGrayMediumDensityTheme/theme.json'; | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -67,39 +67,16 @@ | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var Consumer$1 = function Consumer$$1(props) { | ||
return React.createElement( | ||
Consumer, | ||
null, | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
var result = isDebugging ? createThemeProxy(theme) : theme; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Consumer$1 = function (_Component) { | ||
_inherits(Consumer$$1, _Component); | ||
function Consumer$$1() { | ||
_classCallCheck(this, Consumer$$1); | ||
return _possibleConstructorReturn(this, (Consumer$$1.__proto__ || Object.getPrototypeOf(Consumer$$1)).apply(this, arguments)); | ||
} | ||
_createClass(Consumer$$1, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this2 = this; | ||
return React.createElement( | ||
Consumer, | ||
null, | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
var result = isDebugging ? createThemeProxy(theme) : theme; | ||
return _this2.props.children(result); | ||
} | ||
); | ||
return props.children(result); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Consumer$$1; | ||
}(Component); | ||
Consumer$1.displayName = "Consumer"; | ||
@@ -106,0 +83,0 @@ Consumer$1.propTypes = { |
@@ -9,4 +9,3 @@ 'use strict'; | ||
var defaultTheme = _interopDefault(require('@hig/theme-data/build/json/lightGrayMediumDensityTheme/theme.json')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var React = _interopDefault(require('react')); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
@@ -75,39 +74,16 @@ | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var Consumer$1 = function Consumer$$1(props) { | ||
return React.createElement( | ||
Consumer, | ||
null, | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
var result = isDebugging ? createThemeProxy(theme) : theme; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Consumer$1 = function (_Component) { | ||
_inherits(Consumer$$1, _Component); | ||
function Consumer$$1() { | ||
_classCallCheck(this, Consumer$$1); | ||
return _possibleConstructorReturn(this, (Consumer$$1.__proto__ || Object.getPrototypeOf(Consumer$$1)).apply(this, arguments)); | ||
} | ||
_createClass(Consumer$$1, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this2 = this; | ||
return React__default.createElement( | ||
Consumer, | ||
null, | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
var result = isDebugging ? createThemeProxy(theme) : theme; | ||
return _this2.props.children(result); | ||
} | ||
); | ||
return props.children(result); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Consumer$$1; | ||
}(React.Component); | ||
Consumer$1.displayName = "Consumer"; | ||
@@ -114,0 +90,0 @@ Consumer$1.propTypes = { |
@@ -0,1 +1,13 @@ | ||
# [@hig/theme-context-v4.0.0](https://github.com/Autodesk/hig/compare/@hig/theme-context@3.0.3...@hig/theme-context@4.0.0) (2022-01-13) | ||
### Code Refactoring | ||
* Major Release - React 17 Upgrade ([2523711](https://github.com/Autodesk/hig/commit/2523711)) | ||
### BREAKING CHANGES | ||
* This release includes upgrading to React 17 and all associated libraries. The components have also had structural changes, utilizing stateless components and hooks. There should be no change in look or behavior of components. The code usage is the same so if you’re already on react 17 you can bump the version directly. If you’re on an old version of react you’ll need to upgrade your project’s react first to 17 and then the HIG components. This upgrade also means no more fixes for the react 15 version but it will still be available for download from NPM. You can fork the repo and make fixes with the older version if there is something critical past this release date. | ||
# [@hig/theme-context-v3.0.3](https://github.com/Autodesk/hig/compare/@hig/theme-context@3.0.2...@hig/theme-context@3.0.3) (2022-01-12) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "@hig/theme-context", | ||
"version": "3.0.3", | ||
"version": "4.0.0", | ||
"description": "ThemeContext components to ease adoption of theme data from React components", | ||
@@ -32,4 +32,4 @@ "author": "Autodesk Inc.", | ||
"peerDependencies": { | ||
"@hig/theme-data": "^2.22.0", | ||
"react": "^15.4.1 || ^16.3.2" | ||
"@hig/theme-data": "^2.22.1", | ||
"react": "^17.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "scripts": { |
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
15939
165