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

@hig/skeleton-item

Package Overview
Dependencies
Maintainers
4
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.3.1 to 1.0.0

68

build/index.es.js

@@ -0,6 +1,45 @@

import { css } from 'emotion';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { ThemeContext } from '@hig/themes';
import { ThemeContext } from '@hig/theme-context';
function stylesheet(props, themeData) {
var height = props.height,
marginBottom = props.marginBottom,
maxWidth = props.maxWidth;
return {
skeletonItem: {
backgroundColor: themeData["skeletonItem.backgroundColor"],
borderRadius: themeData["skeletonItem.borderRadius"],
height: height || themeData["skeletonItem.defaultHeight"],
overflow: "hidden",
position: "relative",
marginBottom: marginBottom,
maxWidth: maxWidth,
"&:after": {
animation: "3s ease-in infinite shine",
backgroundImage: "linear-gradient(135deg, transparent 0%, transparent 40%, " + themeData["skeletonItem.highlightColor"] + " 50%, transparent 60%, transparent 100%)",
bottom: 0,
content: '""',
left: 0,
position: "absolute",
top: 0,
width: "300px"
},
"@keyframes shine": {
from: {
transform: "translateX(-100%)"
},
"60%": {
transform: "translateX(100%)"
},
to: {
transform: "translateX(100%)"
}
}
}
};
}
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; }; }();

@@ -26,4 +65,8 @@

value: function render() {
var _this2 = this;
var _props = this.props,
height = _props.height,
marginBottom = _props.marginBottom,
maxWidth = _props.maxWidth;
return React.createElement(

@@ -33,11 +76,10 @@ ThemeContext.Consumer,

function (_ref) {
var themeClass = _ref.themeClass;
return React.createElement("div", {
className: cx("hig__skeleton-item", themeClass),
style: {
maxWidth: _this2.props.maxWidth,
marginBottom: _this2.props.marginBottom,
height: _this2.props.height
}
});
var resolvedRoles = _ref.resolvedRoles;
var styles = stylesheet({
maxWidth: maxWidth,
marginBottom: marginBottom,
height: height
}, resolvedRoles);
return React.createElement("div", { className: css(styles.skeletonItem) });
}

@@ -44,0 +86,0 @@ );

70

build/index.js

@@ -7,8 +7,47 @@ 'use strict';

var emotion = require('emotion');
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 themeContext = require('@hig/theme-context');
function stylesheet(props, themeData) {
var height = props.height,
marginBottom = props.marginBottom,
maxWidth = props.maxWidth;
return {
skeletonItem: {
backgroundColor: themeData["skeletonItem.backgroundColor"],
borderRadius: themeData["skeletonItem.borderRadius"],
height: height || themeData["skeletonItem.defaultHeight"],
overflow: "hidden",
position: "relative",
marginBottom: marginBottom,
maxWidth: maxWidth,
"&:after": {
animation: "3s ease-in infinite shine",
backgroundImage: "linear-gradient(135deg, transparent 0%, transparent 40%, " + themeData["skeletonItem.highlightColor"] + " 50%, transparent 60%, transparent 100%)",
bottom: 0,
content: '""',
left: 0,
position: "absolute",
top: 0,
width: "300px"
},
"@keyframes shine": {
from: {
transform: "translateX(-100%)"
},
"60%": {
transform: "translateX(100%)"
},
to: {
transform: "translateX(100%)"
}
}
}
};
}
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; }; }();

@@ -34,17 +73,20 @@

value: function render() {
var _this2 = this;
var _props = this.props,
height = _props.height,
marginBottom = _props.marginBottom,
maxWidth = _props.maxWidth;
return React__default.createElement(
themes.ThemeContext.Consumer,
themeContext.ThemeContext.Consumer,
null,
function (_ref) {
var themeClass = _ref.themeClass;
return React__default.createElement("div", {
className: cx("hig__skeleton-item", themeClass),
style: {
maxWidth: _this2.props.maxWidth,
marginBottom: _this2.props.marginBottom,
height: _this2.props.height
}
});
var resolvedRoles = _ref.resolvedRoles;
var styles = stylesheet({
maxWidth: maxWidth,
marginBottom: marginBottom,
height: height
}, resolvedRoles);
return React__default.createElement("div", { className: emotion.css(styles.skeletonItem) });
}

@@ -51,0 +93,0 @@ );

@@ -0,1 +1,18 @@

# [@hig/skeleton-item-v1.0.0](https://github.com/Autodesk/hig/compare/@hig/skeleton-item@0.3.1...@hig/skeleton-item@1.0.0) (2019-02-26)
### Bug Fixes
* **package:** update [@hig](https://github.com/hig)/theme-context to version 2.0.0 ([ce34ca4](https://github.com/Autodesk/hig/commit/ce34ca4))
* **package:** update emotion to version 10.0.0 ([abecf80](https://github.com/Autodesk/hig/commit/abecf80))
* bump up theme-context dependency ([b068dab](https://github.com/Autodesk/hig/commit/b068dab))
* combined greenkeeper prs for version updates see pr 1392 ([d0a017a](https://github.com/Autodesk/hig/commit/d0a017a))
* release skeleton-item ([d4a1c78](https://github.com/Autodesk/hig/commit/d4a1c78))
* Update theme data package ([dc5178a](https://github.com/Autodesk/hig/commit/dc5178a))
### BREAKING CHANGES
* * Remove CSS classname
# [@hig/skeleton-item-v0.3.1](https://github.com/Autodesk/hig/compare/@hig/skeleton-item@0.3.0...@hig/skeleton-item@0.3.1) (2018-10-08)

@@ -2,0 +19,0 @@

{
"name": "@hig/skeleton-item",
"version": "0.3.1",
"version": "1.0.0",
"description": "HIG SkeletonItem component",

@@ -17,3 +17,2 @@ "author": "Autodesk Inc.",

"module": "build/index.es.js",
"style": "build/index.css",
"files": [

@@ -23,13 +22,12 @@ "build/*"

"dependencies": {
"@hig/themes": "^0.3.0",
"classnames": "^2.2.5",
"prop-types": "^15.6.1"
"@hig/theme-context": "^2.1.0",
"emotion": "^10.0.0",
"prop-types": "^15.7.1"
},
"devDependencies": {
"@hig/babel-preset": "^0.1.0",
"@hig/babel-preset": "^0.1.1",
"@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.2.3"
"@hig/semantic-release-config": "^0.1.0"
},

@@ -36,0 +34,0 @@ "peerDependencies": {

@@ -11,7 +11,6 @@ # Skeleton Item

## Import the component and CSS
## Import the component
```
import SkeletonItem from '@hig/skeleton-item';
import '@hig/skeleton-item/build/index.css';
```

@@ -18,0 +17,0 @@

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