New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kodiak-ui/progress

Package Overview
Dependencies
Maintainers
6
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kodiak-ui/progress - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

12

dist/progress.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";

24

dist/progress.cjs.js

@@ -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("./progress.cjs.prod.js");
} else {
module.exports = require("./progress.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/progress/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,105 +0,15 @@

import { createElement } from 'react';
import { Box } from '@kodiak-ui/primitives';
import { useMeasure } from '@kodiak-ui/hooks';
// 👋 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 _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 Progress(_ref) {
var value = _ref.value,
_ref$min = _ref.min,
min = _ref$min === void 0 ? 0 : _ref$min,
_ref$max = _ref.max,
max = _ref$max === void 0 ? 100 : _ref$max,
_ref$color = _ref.color,
color = _ref$color === void 0 ? 'primary' : _ref$color,
_ref$containerVariant = _ref.containerVariant,
containerVariant = _ref$containerVariant === void 0 ? 'container' : _ref$containerVariant,
_ref$barVariant = _ref.barVariant,
barVariant = _ref$barVariant === void 0 ? 'bar' : _ref$barVariant,
children = _ref.children,
progressSx = _ref.progressSx,
props = _objectWithoutProperties(_ref, ["value", "min", "max", "color", "containerVariant", "barVariant", "children", "progressSx"]);
var progressWidth = (value - min) * 100 / (max - min);
return /*#__PURE__*/createElement(Box, _extends({
__base: {
bg: 'muted',
borderRadius: 'default',
height: '12px'
},
variant: containerVariant,
variantKey: "progresses"
}, props), /*#__PURE__*/createElement(Box, {
__base: {
bg: color,
height: '100%',
transition: 'all 0.2s ease-in-out 0s',
position: 'relative',
width: "".concat(progressWidth > 100 ? 100 : progressWidth < 0 ? 0 : progressWidth, "%")
},
role: "progressbar",
"aria-valuenow": value,
"aria-valuemin": min,
"aria-valuemax": max,
variant: barVariant,
variantKey: "progresses",
sx: progressSx
}, children));
}
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(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$1(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 ProgressThumb(_ref) {
var value = _ref.value,
min = _ref.min,
max = _ref.max,
_ref$variant = _ref.variant,
variant = _ref$variant === void 0 ? 'thumb' : _ref$variant,
_ref$variantKey = _ref.variantKey,
variantKey = _ref$variantKey === void 0 ? 'progresses' : _ref$variantKey,
children = _ref.children,
props = _objectWithoutProperties$1(_ref, ["value", "min", "max", "variant", "variantKey", "children"]);
var _useMeasure = useMeasure(),
_useMeasure2 = _slicedToArray(_useMeasure, 2),
bind = _useMeasure2[0],
width = _useMeasure2[1].width;
return /*#__PURE__*/createElement(Box, _extends$1({}, bind, {
__base: {
bg: 'white',
border: '1px solid',
borderColor: 'muted',
borderRadius: 'default',
left: min && value <= min ? 0 : max && value >= max ? 'auto' : "calc(100% - ".concat(width / 2, "px)"),
lineHeight: 1,
p: 2,
position: 'absolute',
right: max && value >= max ? '0' : 'auto',
top: '50%',
transform: 'translateY(-50%)'
},
variant: variant,
variantKey: variantKey
}, props), children ? children : value);
}
export { Progress, ProgressThumb };
module.exports = require("/Users/wescole/Jilt/kodiak-ui/packages/progress/src/index.ts")
{
"name": "@kodiak-ui/progress",
"version": "0.1.9",
"version": "0.1.10",
"description": "Kodiak UI's progress bar component",

@@ -29,3 +29,3 @@ "keywords": [

"@kodiak-ui/core": "^0.1.16",
"@kodiak-ui/hooks": "^0.9.3",
"@kodiak-ui/hooks": "^0.10.0",
"@kodiak-ui/primitives": "^0.12.2"

@@ -37,3 +37,3 @@ },

},
"gitHead": "a499847e890dbb59c108e9b5f0dc7cb017fab627"
"gitHead": "5b3355d28f558f34eb09bb6950493d81a3407114"
}
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