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

@hig/skeleton-item

Package Overview
Dependencies
Maintainers
5
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hig/skeleton-item - npm Package Compare versions

Comparing version 0.1.0-alpha.9af96942 to 0.1.0-alpha.9f5ebd81

README.md

212

build/index.es.js

@@ -0,79 +1,179 @@

import PropTypes from 'prop-types';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ThemeContext } from '@hig/themes';
import cx from 'classnames';
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
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 HIGLightTheme = {
themeId: "hig-light",
themeClass: "hig--light-theme"
};
var themeContextShape = {
/** Uniquely identifies a theme */
themeId: PropTypes.string,
/** A class added to each themed element */
themeClass: PropTypes.string
};
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;
};
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");
}
}
var classnames = createCommonjsModule(function (module) {
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; };
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;
}
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
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;
}
(function () {
var Provider = function (_Component) {
_inherits(Provider, _Component);
var hasOwn = {}.hasOwnProperty;
function Provider() {
_classCallCheck(this, Provider);
function classNames() {
var classes = [];
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments));
}
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
_createClass(Provider, [{
key: "getChildContext",
value: function getChildContext() {
return _extends({}, this.props.value);
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
var argType = typeof arg === 'undefined' ? 'undefined' : _typeof(arg);
return Provider;
}(Component);
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
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
};
return classes.join(' ');
}
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;
};
}();
if ('object' !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof undefined === 'function' && _typeof(undefined.amd) === 'object' && undefined.amd) {
// register as 'classnames', consistent with npm package name
undefined('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
})();
});
function _classCallCheck$1(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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;
}
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 Consumer = function (_Component) {
_inherits$1(Consumer, _Component);
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; }
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(SkeletonItem, _Component);
_inherits$2(SkeletonItem, _Component);
function SkeletonItem() {
_classCallCheck(this, SkeletonItem);
_classCallCheck$2(this, SkeletonItem);
return _possibleConstructorReturn(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments));
return _possibleConstructorReturn$2(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments));
}
_createClass(SkeletonItem, [{
_createClass$2(SkeletonItem, [{
key: "render",

@@ -84,3 +184,3 @@ value: function render() {

return React.createElement(
ThemeContext.Consumer,
index.Consumer,
null,

@@ -90,3 +190,3 @@ function (_ref) {

return React.createElement("div", {
className: classnames("hig__skeleton-item", themeClass),
className: cx("hig__skeleton-item", themeClass),
style: {

@@ -93,0 +193,0 @@ maxWidth: _this2.props.maxWidth,

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var PropTypes = _interopDefault(require('prop-types'));
var React = require('react');
var React__default = _interopDefault(React);
var PropTypes = _interopDefault(require('prop-types'));
var themes = require('@hig/themes');
var cx = _interopDefault(require('classnames'));
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
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 HIGLightTheme = {
themeId: "hig-light",
themeClass: "hig--light-theme"
};
var themeContextShape = {
/** Uniquely identifies a theme */
themeId: PropTypes.string,
/** A class added to each themed element */
themeClass: PropTypes.string
};
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;
};
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");
}
}
var classnames = createCommonjsModule(function (module) {
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; };
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;
}
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
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;
}
(function () {
var Provider = function (_Component) {
_inherits(Provider, _Component);
var hasOwn = {}.hasOwnProperty;
function Provider() {
_classCallCheck(this, Provider);
function classNames() {
var classes = [];
return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments));
}
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
_createClass(Provider, [{
key: "getChildContext",
value: function getChildContext() {
return _extends({}, this.props.value);
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
var argType = typeof arg === 'undefined' ? 'undefined' : _typeof(arg);
return Provider;
}(React.Component);
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
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
};
return classes.join(' ');
}
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;
};
}();
if ('object' !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof undefined === 'function' && _typeof(undefined.amd) === 'object' && undefined.amd) {
// register as 'classnames', consistent with npm package name
undefined('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
})();
});
function _classCallCheck$1(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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;
}
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 Consumer = function (_Component) {
_inherits$1(Consumer, _Component);
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; }
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(SkeletonItem, _Component);
_inherits$2(SkeletonItem, _Component);
function SkeletonItem() {
_classCallCheck(this, SkeletonItem);
_classCallCheck$2(this, SkeletonItem);
return _possibleConstructorReturn(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments));
return _possibleConstructorReturn$2(this, (SkeletonItem.__proto__ || Object.getPrototypeOf(SkeletonItem)).apply(this, arguments));
}
_createClass(SkeletonItem, [{
_createClass$2(SkeletonItem, [{
key: "render",

@@ -89,3 +191,3 @@ value: function render() {

return React__default.createElement(
themes.ThemeContext.Consumer,
index.Consumer,
null,

@@ -95,3 +197,3 @@ function (_ref) {

return React__default.createElement("div", {
className: classnames("hig__skeleton-item", themeClass),
className: cx("hig__skeleton-item", themeClass),
style: {

@@ -137,2 +239,2 @@ maxWidth: _this2.props.maxWidth,

module.exports = SkeletonItem;
exports.default = SkeletonItem;
{
"name": "@hig/skeleton-item",
"version": "0.1.0-alpha.9af96942",
"version": "0.1.0-alpha.9f5ebd81",
"description": "HIG SkeletonItem component",

@@ -18,20 +18,31 @@ "author": "Autodesk Inc.",

"dependencies": {
"@hig/themes": "0.1.0-alpha.9af96942"
"@hig/themes": "0.1.0-alpha.9f5ebd81",
"classnames": "^2.2.5"
},
"devDependencies": {
"@hig/babel-preset": "0.2.0-alpha.9af96942",
"@hig/scripts": "0.2.0-alpha.9af96942",
"@hig/styles": "0.1.0-alpha.9af96942"
"@hig/babel-preset": "0.2.0-alpha.9f5ebd81",
"@hig/eslint-config": "0.2.0-alpha.9f5ebd81",
"@hig/scripts": "0.2.0-alpha.9f5ebd81",
"@hig/styles": "0.2.0-alpha.9f5ebd81"
},
"peerDependencies": {
"prop-types": "^15.6.1",
"react": "^15.4.1"
"react": "^15.4.1 || ^16.3.2"
},
"scripts": {
"build": "hig-scripts-build",
"lint": "eslint src --ext .js,.jsx"
"lint": "eslint src --color --ext .js,.jsx"
},
"eslintConfig": {
"extends": "@hig"
},
"babel": {
"env": {
"test": {
"presets": [
"@hig/babel-preset/test"
]
}
}
}
}

Sorry, the diff of this file is not supported yet

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