Socket
Socket
Sign inDemoInstall

@kodiak-ui/skeleton

Package Overview
Dependencies
127
Maintainers
6
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.7 to 0.2.8

12

dist/skeleton.cjs.d.ts

@@ -1,1 +0,11 @@

export * from "./declarations/src/index";
// are you seeing an error that a default export doesn't exist but your source file has a default export?
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
// curious why you need to?
// this file exists so that you can import from the entrypoint normally
// except that it points to your source file and you don't need to run build constantly
// which means we need to re-export all of the modules from your source file
// and since export * doesn't include default exports, we need to read your source file
// to check for a default export and re-export it if it exists
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
export * from "../src/index";

21

dist/skeleton.cjs.js

@@ -1,7 +0,16 @@

'use strict';
"use strict";
// this file might look strange and you might be wondering what it's for
// it's lets you import your source files by importing this entrypoint
// as you would import it if it was built with preconstruct build
// this file is slightly different to some others though
// it has a require hook which compiles your code with Babel
// this means that you don't have to set up @babel/register or anything like that
// but you can still require this module and it'll be compiled
if (process.env.NODE_ENV === "production") {
module.exports = require("./skeleton.cjs.prod.js");
} else {
module.exports = require("./skeleton.cjs.dev.js");
}
// this bit of code imports the require hook and registers it
let unregister = require("../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../..", "..");
// this re-exports the source file
module.exports = require("../src/index.ts");
unregister();

@@ -1,175 +0,15 @@

import { keyframes, jsx } from '@emotion/core';
import { Fragment, forwardRef } from 'react';
import { Box } from '@kodiak-ui/primitives/box';
// 👋 hey!!
// you might be reading this and seeing .esm in the filename
// and being confused why there is commonjs below this filename
// DON'T WORRY!
// this is intentional
// it's only commonjs with `preconstruct dev`
// when you run `preconstruct build`, it will be ESM
// why is it commonjs?
// we need to re-export every export from the source file
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *)
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to
// run preconstruct dev again which wouldn't be ideal
// this solution could change but for now, it's working
function _extends() {
_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;
};
return _extends.apply(this, arguments);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
}
function _templateObject() {
var data = _taggedTemplateLiteral(["\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
// based on https://github.com/dvtng/react-loading-skeleton
var skeletonKeyframes = keyframes(_templateObject());
var skeletonColor = '#eee';
var defaultHighlightColor = '#f5f5f5';
var skeletonBaseStyles = {
backgroundColor: skeletonColor,
backgroundImage: "linear-gradient(\n 90deg,\n ".concat(skeletonColor, ",\n ").concat(defaultHighlightColor, ",\n ").concat(skeletonColor, "\n )"),
backgroundSize: "200px 100%",
backgroundRepeat: "no-repeat",
borderRadius: 'default',
display: 'inline-block',
lineHeight: 1,
width: '100%'
};
function Repeat(_ref) {
var _ref$count = _ref.count,
count = _ref$count === void 0 ? 1 : _ref$count,
children = _ref.children;
var lines = new Array(count).fill(null);
return jsx(Fragment, null, lines.map(function (_, index) {
return jsx(Fragment, {
key: index
}, children);
}));
}
var Skeleton = /*#__PURE__*/forwardRef(function Skeleton(_ref2, forwardedRef) {
var __base = _ref2.__base,
_ref2$variantKey = _ref2.variantKey,
variantKey = _ref2$variantKey === void 0 ? 'skeletons' : _ref2$variantKey,
variant = _ref2.variant,
_ref2$duration = _ref2.duration,
duration = _ref2$duration === void 0 ? '1.2s' : _ref2$duration,
children = _ref2.children,
props = _objectWithoutProperties(_ref2, ["__base", "variantKey", "variant", "duration", "children"]);
return jsx(Box, {
as: "span"
}, jsx(Box, _extends({
__base: _objectSpread2(_objectSpread2(_objectSpread2({}, __base), skeletonBaseStyles), {}, {
animation: "".concat(skeletonKeyframes, " ").concat(duration, " ease-in-out infinite")
}),
ref: forwardedRef,
variantKey: variantKey,
variant: variant,
as: "span"
}, props), "\u200C", children));
});
export { Repeat, Skeleton };
module.exports = require("../src/index.ts")
{
"name": "@kodiak-ui/skeleton",
"version": "0.2.7",
"version": "0.2.8",
"description": "Skeleton for loading",

@@ -24,8 +24,8 @@ "keywords": [

"kodiak-ui": "0.0.9",
"react": "^16.13.0",
"react-dom": "^16.13.0"
"react": "^16.14.0",
"react-dom": "^16.14.0"
},
"dependencies": {
"@emotion/core": "^10.0.28",
"@kodiak-ui/primitives": "^0.20.2"
"@kodiak-ui/primitives": "^0.20.3"
},

@@ -36,3 +36,3 @@ "repository": {

},
"gitHead": "b567c9aa0482d1f41d92009e372282d2715456f9"
"gitHead": "8d3eb8dda094293a4dcc5c808d1d55e64093517e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc