@hig/label
Advanced tools
Comparing version 1.2.2 to 2.0.0
@@ -1,2 +0,2 @@ | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -34,63 +34,39 @@ import { css, cx } from 'emotion'; | ||
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; }; }(); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Label = function Label(props) { | ||
var children = props.children, | ||
disabled = props.disabled, | ||
customStylesheet = props.stylesheet, | ||
variant = props.variant, | ||
otherProps = _objectWithoutProperties(props, ["children", "disabled", "stylesheet", "variant"]); | ||
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; } | ||
var className = otherProps.className; | ||
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 Label = function (_Component) { | ||
_inherits(Label, _Component); | ||
return React.createElement( | ||
ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
function Label() { | ||
_classCallCheck(this, Label); | ||
var styles = stylesheet({ | ||
disabled: disabled, | ||
stylesheet: customStylesheet, | ||
variant: variant | ||
}, resolvedRoles); | ||
return _possibleConstructorReturn(this, (Label.__proto__ || Object.getPrototypeOf(Label)).apply(this, arguments)); | ||
} | ||
_createClass(Label, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
disabled = _props.disabled, | ||
customStylesheet = _props.stylesheet, | ||
variant = _props.variant, | ||
otherProps = _objectWithoutProperties(_props, ["children", "disabled", "stylesheet", "variant"]); | ||
var className = otherProps.className; | ||
return React.createElement( | ||
ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var styles = stylesheet({ | ||
disabled: disabled, | ||
stylesheet: customStylesheet, | ||
variant: variant | ||
}, resolvedRoles); | ||
return ( | ||
// eslint-disable-next-line jsx-a11y/label-has-for | ||
React.createElement( | ||
"label", | ||
_extends({}, otherProps, { | ||
className: cx([className, css(styles.label)]) | ||
}), | ||
children | ||
) | ||
); | ||
} | ||
return ( | ||
// eslint-disable-next-line jsx-a11y/label-has-for | ||
React.createElement( | ||
"label", | ||
_extends({}, otherProps, { className: cx([className, css(styles.label)]) }), | ||
children | ||
) | ||
); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Label; | ||
}(Component); | ||
Label.displayName = "Label"; | ||
@@ -115,2 +91,3 @@ Label.propTypes = { | ||
}; | ||
Label.defaultProps = { | ||
@@ -117,0 +94,0 @@ variant: variants.SIDE |
@@ -7,4 +7,3 @@ 'use strict'; | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var React = _interopDefault(require('react')); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
@@ -42,63 +41,39 @@ var emotion = require('emotion'); | ||
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; }; }(); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Label = function Label(props) { | ||
var children = props.children, | ||
disabled = props.disabled, | ||
customStylesheet = props.stylesheet, | ||
variant = props.variant, | ||
otherProps = _objectWithoutProperties(props, ["children", "disabled", "stylesheet", "variant"]); | ||
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; } | ||
var className = otherProps.className; | ||
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 Label = function (_Component) { | ||
_inherits(Label, _Component); | ||
return React.createElement( | ||
themeContext.ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
function Label() { | ||
_classCallCheck(this, Label); | ||
var styles = stylesheet({ | ||
disabled: disabled, | ||
stylesheet: customStylesheet, | ||
variant: variant | ||
}, resolvedRoles); | ||
return _possibleConstructorReturn(this, (Label.__proto__ || Object.getPrototypeOf(Label)).apply(this, arguments)); | ||
} | ||
_createClass(Label, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
children = _props.children, | ||
disabled = _props.disabled, | ||
customStylesheet = _props.stylesheet, | ||
variant = _props.variant, | ||
otherProps = _objectWithoutProperties(_props, ["children", "disabled", "stylesheet", "variant"]); | ||
var className = otherProps.className; | ||
return React__default.createElement( | ||
themeContext.ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var styles = stylesheet({ | ||
disabled: disabled, | ||
stylesheet: customStylesheet, | ||
variant: variant | ||
}, resolvedRoles); | ||
return ( | ||
// eslint-disable-next-line jsx-a11y/label-has-for | ||
React__default.createElement( | ||
"label", | ||
_extends({}, otherProps, { | ||
className: emotion.cx([className, emotion.css(styles.label)]) | ||
}), | ||
children | ||
) | ||
); | ||
} | ||
return ( | ||
// eslint-disable-next-line jsx-a11y/label-has-for | ||
React.createElement( | ||
"label", | ||
_extends({}, otherProps, { className: emotion.cx([className, emotion.css(styles.label)]) }), | ||
children | ||
) | ||
); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Label; | ||
}(React.Component); | ||
Label.displayName = "Label"; | ||
@@ -123,2 +98,3 @@ Label.propTypes = { | ||
}; | ||
Label.defaultProps = { | ||
@@ -125,0 +101,0 @@ variant: variants.SIDE |
@@ -0,1 +1,13 @@ | ||
# [@hig/label-v2.0.0](https://github.com/Autodesk/hig/compare/@hig/label@1.2.2...@hig/label@2.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/label-v1.2.2](https://github.com/Autodesk/hig/compare/@hig/label@1.2.1...@hig/label@1.2.2) (2022-01-12) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "@hig/label", | ||
"version": "1.2.2", | ||
"version": "2.0.0", | ||
"description": "HIG Label", | ||
@@ -25,4 +25,4 @@ "author": "Autodesk Inc.", | ||
"@hig/theme-context": "^3.0.1", | ||
"@hig/theme-data": "^2.22.0", | ||
"react": "^15.4.1 || ^16.3.2" | ||
"@hig/theme-data": "^2.22.1", | ||
"react": "^17.0.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
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
13736
239