@hig/surface
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,2 +0,2 @@ | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -49,66 +49,44 @@ import { ThemeContext } from '@hig/theme-context'; | ||
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 Surface = function Surface(props) { | ||
var borderRadius = props.borderRadius, | ||
children = props.children, | ||
horizontalPadding = props.horizontalPadding, | ||
verticalPadding = props.verticalPadding, | ||
level = props.level, | ||
shadow = props.shadow, | ||
customStylesheet = props.stylesheet, | ||
tagName = props.tagName, | ||
otherProps = _objectWithoutProperties(props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "stylesheet", "tagName"]); | ||
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; } | ||
return React.createElement( | ||
ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var Surface = function (_Component) { | ||
_inherits(Surface, _Component); | ||
var styles = stylesheet({ | ||
borderRadius: borderRadius, | ||
stylesheet: customStylesheet, | ||
horizontalPadding: horizontalPadding, | ||
verticalPadding: verticalPadding, | ||
level: level, | ||
shadow: shadow | ||
}, resolvedRoles); | ||
function Surface() { | ||
_classCallCheck(this, Surface); | ||
var Element = tagName; | ||
return _possibleConstructorReturn(this, (Surface.__proto__ || Object.getPrototypeOf(Surface)).apply(this, arguments)); | ||
} | ||
_createClass(Surface, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
borderRadius = _props.borderRadius, | ||
children = _props.children, | ||
horizontalPadding = _props.horizontalPadding, | ||
verticalPadding = _props.verticalPadding, | ||
level = _props.level, | ||
shadow = _props.shadow, | ||
customStylesheet = _props.stylesheet, | ||
tagName = _props.tagName, | ||
otherProps = _objectWithoutProperties(_props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "stylesheet", "tagName"]); | ||
var className = otherProps.className; | ||
return React.createElement( | ||
ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var styles = stylesheet({ | ||
borderRadius: borderRadius, | ||
stylesheet: customStylesheet, | ||
horizontalPadding: horizontalPadding, | ||
verticalPadding: verticalPadding, | ||
level: level, | ||
shadow: shadow | ||
}, resolvedRoles); | ||
var Element = tagName; | ||
return React.createElement( | ||
Element, | ||
{ className: cx(css(styles.surface), className) }, | ||
children | ||
); | ||
} | ||
return Element && React.createElement( | ||
Element, | ||
{ className: cx(css(styles.surface), className) }, | ||
children | ||
); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Surface; | ||
}(Component); | ||
Surface.displayName = "Surfacel"; | ||
@@ -150,2 +128,3 @@ Surface.propTypes = { | ||
}; | ||
Surface.defaultProps = { | ||
@@ -157,3 +136,3 @@ level: 100, | ||
"description": "", | ||
"displayName": "Surface", | ||
"displayName": "Surfacel", | ||
"props": { | ||
@@ -160,0 +139,0 @@ "borderRadius": { |
@@ -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')); | ||
@@ -57,66 +56,44 @@ var themeContext = require('@hig/theme-context'); | ||
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 Surface = function Surface(props) { | ||
var borderRadius = props.borderRadius, | ||
children = props.children, | ||
horizontalPadding = props.horizontalPadding, | ||
verticalPadding = props.verticalPadding, | ||
level = props.level, | ||
shadow = props.shadow, | ||
customStylesheet = props.stylesheet, | ||
tagName = props.tagName, | ||
otherProps = _objectWithoutProperties(props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "stylesheet", "tagName"]); | ||
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; } | ||
return React.createElement( | ||
themeContext.ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var Surface = function (_Component) { | ||
_inherits(Surface, _Component); | ||
var styles = stylesheet({ | ||
borderRadius: borderRadius, | ||
stylesheet: customStylesheet, | ||
horizontalPadding: horizontalPadding, | ||
verticalPadding: verticalPadding, | ||
level: level, | ||
shadow: shadow | ||
}, resolvedRoles); | ||
function Surface() { | ||
_classCallCheck(this, Surface); | ||
var Element = tagName; | ||
return _possibleConstructorReturn(this, (Surface.__proto__ || Object.getPrototypeOf(Surface)).apply(this, arguments)); | ||
} | ||
_createClass(Surface, [{ | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
borderRadius = _props.borderRadius, | ||
children = _props.children, | ||
horizontalPadding = _props.horizontalPadding, | ||
verticalPadding = _props.verticalPadding, | ||
level = _props.level, | ||
shadow = _props.shadow, | ||
customStylesheet = _props.stylesheet, | ||
tagName = _props.tagName, | ||
otherProps = _objectWithoutProperties(_props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "stylesheet", "tagName"]); | ||
var className = otherProps.className; | ||
return React__default.createElement( | ||
themeContext.ThemeContext.Consumer, | ||
null, | ||
function (_ref) { | ||
var resolvedRoles = _ref.resolvedRoles; | ||
var styles = stylesheet({ | ||
borderRadius: borderRadius, | ||
stylesheet: customStylesheet, | ||
horizontalPadding: horizontalPadding, | ||
verticalPadding: verticalPadding, | ||
level: level, | ||
shadow: shadow | ||
}, resolvedRoles); | ||
var Element = tagName; | ||
return React__default.createElement( | ||
Element, | ||
{ className: emotion.cx(emotion.css(styles.surface), className) }, | ||
children | ||
); | ||
} | ||
return Element && React.createElement( | ||
Element, | ||
{ className: emotion.cx(emotion.css(styles.surface), className) }, | ||
children | ||
); | ||
} | ||
}]); | ||
); | ||
}; | ||
return Surface; | ||
}(React.Component); | ||
Surface.displayName = "Surfacel"; | ||
@@ -158,2 +135,3 @@ Surface.propTypes = { | ||
}; | ||
Surface.defaultProps = { | ||
@@ -165,3 +143,3 @@ level: 100, | ||
"description": "", | ||
"displayName": "Surface", | ||
"displayName": "Surfacel", | ||
"props": { | ||
@@ -168,0 +146,0 @@ "borderRadius": { |
@@ -0,1 +1,9 @@ | ||
# [@hig/surface-v1.2.1](https://github.com/Autodesk/hig/compare/@hig/surface@1.2.0...@hig/surface@1.2.1) (2022-01-12) | ||
### Bug Fixes | ||
* react v. in peerDependencies instead of dependencies ([4701332](https://github.com/Autodesk/hig/commit/4701332)) | ||
* add validation render Element ([2b77595](https://github.com/Autodesk/hig/commit/2b77595)) | ||
# [@hig/surface-v1.2.0](https://github.com/Autodesk/hig/compare/@hig/surface@1.1.1...@hig/surface@1.2.0) (2021-02-24) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "@hig/surface", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "HIG Surface component", | ||
@@ -29,8 +29,8 @@ "author": "Autodesk Inc.", | ||
"@hig/semantic-release-config": "^0.1.0", | ||
"@hig/typography": "^1.2.0" | ||
"@hig/typography": "^1.2.1" | ||
}, | ||
"peerDependencies": { | ||
"@hig/theme-context": "^3.0.1", | ||
"@hig/theme-data": "^2.19.3", | ||
"react": "^15.4.1 || ^16.3.2" | ||
"@hig/theme-context": "^3.0.2", | ||
"@hig/theme-data": "^2.22.0", | ||
"react": "^17.0.0" | ||
}, | ||
@@ -37,0 +37,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
17444
394