@kodiak-ui/skeleton
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -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"; |
@@ -1,7 +0,19 @@ | ||
'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("/Users/wescole/Jilt/kodiak-ui/node_modules/@preconstruct/hook/dist/hook.cjs.js").___internalHook("/Users/wescole/Jilt/kodiak-ui"); | ||
// this re-exports the source file | ||
module.exports = require("/Users/wescole/Jilt/kodiak-ui/packages/skeleton/src/index.ts"); | ||
// this unregisters the require hook so that any modules required after this one | ||
// aren't compiled with the require hook in case you have some other require hook | ||
// or something that should be used on other modules | ||
unregister(); |
@@ -1,75 +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 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 _objectSpread(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 _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 _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 _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 _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; | ||
} | ||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
// 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 _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, ["variantKey", "variant", "duration", "children"]); | ||
return jsx(Box, { | ||
as: "span" | ||
}, jsx(Box, _extends({ | ||
__base: _objectSpread(_objectSpread({}, 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("/Users/wescole/Jilt/kodiak-ui/packages/skeleton/src/index.ts") |
{ | ||
"name": "@kodiak-ui/skeleton", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Skeleton for loading", | ||
@@ -23,9 +23,9 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@emotion/core": "^10.0.27", | ||
"kodiak-ui": "0.0.9", | ||
"react": "^16.13.0", | ||
"react-dom": "^16.13.0", | ||
"theme-ui": "^0.3.1" | ||
"react-dom": "^16.13.0" | ||
}, | ||
"dependencies": { | ||
"@kodiak-ui/primitives": "^0.17.13" | ||
"@emotion/core": "^10.0.28", | ||
"@kodiak-ui/primitives": "^0.17.14" | ||
}, | ||
@@ -36,3 +36,3 @@ "repository": { | ||
}, | ||
"gitHead": "45a944f70d69dde34aae313ceeeee94e051d2472" | ||
"gitHead": "e80c7b3d70ad562af29c38b6c95bd2b8c9a6492b" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
4602
6
40
+ Added@emotion/core@^10.0.28