@hig/skeleton-item
Advanced tools
Comparing version 0.2.0-alpha.fbb1eed0 to 0.2.0
@@ -0,179 +1,24 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import cx from 'classnames'; | ||
import { ThemeContext } from '@hig/themes'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
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 HIGLightTheme = { | ||
themeId: "hig-light", | ||
themeClass: "hig--light-theme" | ||
}; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var themeContextShape = { | ||
/** Uniquely identifies a theme */ | ||
themeId: PropTypes.string, | ||
/** A class added to each themed element */ | ||
themeClass: PropTypes.string | ||
}; | ||
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 _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i];for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
}return target; | ||
}; | ||
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 _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 _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 === 'undefined' ? 'undefined' : _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 === 'undefined' ? 'undefined' : _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 Provider = function (_Component) { | ||
_inherits(Provider, _Component); | ||
function Provider() { | ||
_classCallCheck(this, Provider); | ||
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments)); | ||
} | ||
_createClass(Provider, [{ | ||
key: "getChildContext", | ||
value: function getChildContext() { | ||
return _extends({}, this.props.value); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
return this.props.children; | ||
} | ||
}]); | ||
return Provider; | ||
}(Component); | ||
Provider.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
value: PropTypes.shape(themeContextShape), | ||
/** Content within will be provided with the passed theme */ | ||
children: PropTypes.node.isRequired | ||
}; | ||
Provider.childContextTypes = themeContextShape; | ||
Provider.defaultProps = { | ||
value: HIGLightTheme | ||
}; | ||
var _createClass$1 = 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 _classCallCheck$1(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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 = function (_Component) { | ||
_inherits$1(Consumer, _Component); | ||
function Consumer() { | ||
_classCallCheck$1(this, Consumer); | ||
return _possibleConstructorReturn$1(this, (Consumer.__proto__ || Object.getPrototypeOf(Consumer)).apply(this, arguments)); | ||
} | ||
_createClass$1(Consumer, [{ | ||
key: "render", | ||
value: function render() { | ||
var theme = this.context.themeId && this.context.themeClass ? this.context : HIGLightTheme; | ||
return this.props.children(theme); | ||
} | ||
}]); | ||
return Consumer; | ||
}(Component); | ||
Consumer.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
children: PropTypes.func | ||
}; | ||
Consumer.contextTypes = themeContextShape; | ||
Consumer.__docgenInfo = { | ||
"description": "", | ||
"displayName": "Consumer", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "A theme provided to the consumer within" | ||
} | ||
} | ||
}; | ||
var index = { Provider: Provider, Consumer: Consumer }; | ||
var _createClass$2 = 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 _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn$2(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$2(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 SkeletonItem = function (_Component) { | ||
_inherits$2(SkeletonItem, _Component); | ||
_inherits(SkeletonItem, _Component); | ||
function SkeletonItem() { | ||
_classCallCheck$2(this, SkeletonItem); | ||
_classCallCheck(this, SkeletonItem); | ||
return _possibleConstructorReturn$2(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments)); | ||
return _possibleConstructorReturn(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments)); | ||
} | ||
_createClass$2(SkeletonItem, [{ | ||
_createClass(SkeletonItem, [{ | ||
key: "render", | ||
@@ -184,3 +29,3 @@ value: function render() { | ||
return React.createElement( | ||
index.Consumer, | ||
ThemeContext.Consumer, | ||
null, | ||
@@ -187,0 +32,0 @@ function (_ref) { |
@@ -7,181 +7,26 @@ 'use strict'; | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var cx = _interopDefault(require('classnames')); | ||
var themes = require('@hig/themes'); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
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 HIGLightTheme = { | ||
themeId: "hig-light", | ||
themeClass: "hig--light-theme" | ||
}; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var themeContextShape = { | ||
/** Uniquely identifies a theme */ | ||
themeId: PropTypes.string, | ||
/** A class added to each themed element */ | ||
themeClass: PropTypes.string | ||
}; | ||
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 _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i];for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
}return target; | ||
}; | ||
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 _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 _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 === 'undefined' ? 'undefined' : _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 === 'undefined' ? 'undefined' : _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 Provider = function (_Component) { | ||
_inherits(Provider, _Component); | ||
function Provider() { | ||
_classCallCheck(this, Provider); | ||
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments)); | ||
} | ||
_createClass(Provider, [{ | ||
key: "getChildContext", | ||
value: function getChildContext() { | ||
return _extends({}, this.props.value); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
return this.props.children; | ||
} | ||
}]); | ||
return Provider; | ||
}(React.Component); | ||
Provider.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
value: PropTypes.shape(themeContextShape), | ||
/** Content within will be provided with the passed theme */ | ||
children: PropTypes.node.isRequired | ||
}; | ||
Provider.childContextTypes = themeContextShape; | ||
Provider.defaultProps = { | ||
value: HIGLightTheme | ||
}; | ||
var _createClass$1 = 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 _classCallCheck$1(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
}return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _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 = function (_Component) { | ||
_inherits$1(Consumer, _Component); | ||
function Consumer() { | ||
_classCallCheck$1(this, Consumer); | ||
return _possibleConstructorReturn$1(this, (Consumer.__proto__ || Object.getPrototypeOf(Consumer)).apply(this, arguments)); | ||
} | ||
_createClass$1(Consumer, [{ | ||
key: "render", | ||
value: function render() { | ||
var theme = this.context.themeId && this.context.themeClass ? this.context : HIGLightTheme; | ||
return this.props.children(theme); | ||
} | ||
}]); | ||
return Consumer; | ||
}(React.Component); | ||
Consumer.propTypes = { | ||
/** A theme provided to the consumer within */ | ||
children: PropTypes.func | ||
}; | ||
Consumer.contextTypes = themeContextShape; | ||
Consumer.__docgenInfo = { | ||
"description": "", | ||
"displayName": "Consumer", | ||
"props": { | ||
"children": { | ||
"type": { | ||
"name": "func" | ||
}, | ||
"required": false, | ||
"description": "A theme provided to the consumer within" | ||
} | ||
} | ||
}; | ||
var index = { Provider: Provider, Consumer: Consumer }; | ||
var _createClass$2 = 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 _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn$2(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$2(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 SkeletonItem = function (_Component) { | ||
_inherits$2(SkeletonItem, _Component); | ||
_inherits(SkeletonItem, _Component); | ||
function SkeletonItem() { | ||
_classCallCheck$2(this, SkeletonItem); | ||
_classCallCheck(this, SkeletonItem); | ||
return _possibleConstructorReturn$2(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments)); | ||
return _possibleConstructorReturn(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments)); | ||
} | ||
_createClass$2(SkeletonItem, [{ | ||
_createClass(SkeletonItem, [{ | ||
key: "render", | ||
@@ -192,3 +37,3 @@ value: function render() { | ||
return React__default.createElement( | ||
index.Consumer, | ||
themes.ThemeContext.Consumer, | ||
null, | ||
@@ -195,0 +40,0 @@ function (_ref) { |
{ | ||
"name": "@hig/skeleton-item", | ||
"version": "0.2.0-alpha.fbb1eed0", | ||
"version": "0.2.0", | ||
"description": "HIG SkeletonItem component", | ||
@@ -22,3 +22,3 @@ "author": "Autodesk Inc.", | ||
"dependencies": { | ||
"@hig/themes": "0.2.0-alpha.fbb1eed0", | ||
"@hig/themes": "^0.1.3", | ||
"classnames": "^2.2.5", | ||
@@ -28,6 +28,7 @@ "prop-types": "^15.6.1" | ||
"devDependencies": { | ||
"@hig/babel-preset": "0.2.0-alpha.fbb1eed0", | ||
"@hig/eslint-config": "0.2.0-alpha.fbb1eed0", | ||
"@hig/scripts": "0.2.0-alpha.fbb1eed0", | ||
"@hig/semantic-release-config": "0.2.0-alpha.fbb1eed0", | ||
"@hig/babel-preset": "^0.1.0", | ||
"@hig/eslint-config": "^0.1.0", | ||
"@hig/jest-preset": "^0.1.0", | ||
"@hig/scripts": "^0.1.2", | ||
"@hig/semantic-release-config": "^0.1.0", | ||
"@hig/styles": "^0.1.1" | ||
@@ -41,2 +42,3 @@ }, | ||
"lint": "hig-scripts-lint", | ||
"test": "hig-scripts-test", | ||
"release": "hig-scripts-release" | ||
@@ -47,2 +49,5 @@ }, | ||
}, | ||
"jest": { | ||
"preset": "@hig/jest-preset" | ||
}, | ||
"release": { | ||
@@ -49,0 +54,0 @@ "extends": "@hig/semantic-release-config" |
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
7
23254
6
352
+ Added@hig/themes@0.1.3(transitive)
- Removed@hig/themes@0.2.0-alpha.fbb1eed0(transitive)
Updated@hig/themes@^0.1.3