@arch-ui/badge
Advanced tools
Comparing version 0.0.17 to 0.0.18
# @arch-ui/badge | ||
## 0.0.18 | ||
### Patch Changes | ||
- [`04bf1e4bb`](https://github.com/keystonejs/keystone-5/commit/04bf1e4bb0223f4e2e06664bbc9e95c51118eb84) [#2](https://github.com/keystonejs/keystone-5/pull/2) Thanks [@bladey](https://github.com/bladey)! - Updated repository URL in package.json. | ||
- Updated dependencies [[`04bf1e4bb`](https://github.com/keystonejs/keystone-5/commit/04bf1e4bb0223f4e2e06664bbc9e95c51118eb84)]: | ||
- @arch-ui/theme@0.0.12 | ||
## 0.0.17 | ||
@@ -7,9 +16,9 @@ | ||
- [`5935b89f8`](https://github.com/keystonejs/keystone/commit/5935b89f8862b36f14d09da68f056f759a860f3e) [#3477](https://github.com/keystonejs/keystone/pull/3477) Thanks [@Noviny](https://github.com/Noviny)! - Updating dependencies: | ||
- [`5935b89f8`](https://github.com/keystonejs/keystone-5/commit/5935b89f8862b36f14d09da68f056f759a860f3e) [#3477](https://github.com/keystonejs/keystone-5/pull/3477) Thanks [@Noviny](https://github.com/Noviny)! - Updating dependencies: | ||
These changes bring the keystone dev experience inline with installing keystone from npm :D | ||
* [`0fc878fa9`](https://github.com/keystonejs/keystone/commit/0fc878fa918c3196196f943f195ffaa62fce504b) [#3439](https://github.com/keystonejs/keystone/pull/3439) Thanks [@renovate](https://github.com/apps/renovate)! - Updated babel dependencies. | ||
* [`0fc878fa9`](https://github.com/keystonejs/keystone-5/commit/0fc878fa918c3196196f943f195ffaa62fce504b) [#3439](https://github.com/keystonejs/keystone-5/pull/3439) Thanks [@renovate](https://github.com/apps/renovate)! - Updated babel dependencies. | ||
* Updated dependencies [[`0fc878fa9`](https://github.com/keystonejs/keystone/commit/0fc878fa918c3196196f943f195ffaa62fce504b)]: | ||
* Updated dependencies [[`0fc878fa9`](https://github.com/keystonejs/keystone-5/commit/0fc878fa918c3196196f943f195ffaa62fce504b)]: | ||
- @arch-ui/theme@0.0.11 | ||
@@ -21,3 +30,3 @@ | ||
- [`45b151b0`](https://github.com/keystonejs/keystone/commit/45b151b05de0583ba50364caeda8b5bb7a111385) [#2829](https://github.com/keystonejs/keystone/pull/2829) Thanks [@Vultraz](https://github.com/Vultraz)! - Converted React PureComponents to functional ones. | ||
- [`45b151b0`](https://github.com/keystonejs/keystone-5/commit/45b151b05de0583ba50364caeda8b5bb7a111385) [#2829](https://github.com/keystonejs/keystone-5/pull/2829) Thanks [@Vultraz](https://github.com/Vultraz)! - Converted React PureComponents to functional ones. | ||
@@ -28,3 +37,3 @@ ## 0.0.15 | ||
- [`577b5e69`](https://github.com/keystonejs/keystone/commit/577b5e69ac4f949d1be2a80d8f391cb0a4b1333a) [#2799](https://github.com/keystonejs/keystone/pull/2799) Thanks [@MadeByMike](https://github.com/MadeByMike)! - Upgraded React and Emotion packages. | ||
- [`577b5e69`](https://github.com/keystonejs/keystone-5/commit/577b5e69ac4f949d1be2a80d8f391cb0a4b1333a) [#2799](https://github.com/keystonejs/keystone-5/pull/2799) Thanks [@MadeByMike](https://github.com/MadeByMike)! - Upgraded React and Emotion packages. | ||
@@ -35,3 +44,3 @@ ## 0.0.14 | ||
- Updated dependencies [[`0de5f232`](https://github.com/keystonejs/keystone/commit/0de5f2321ef8f9fe6dd247c3201372a4156e61e9)]: | ||
- Updated dependencies [[`0de5f232`](https://github.com/keystonejs/keystone-5/commit/0de5f2321ef8f9fe6dd247c3201372a4156e61e9)]: | ||
- @arch-ui/theme@0.0.10 | ||
@@ -43,7 +52,7 @@ | ||
- [`6b353eff`](https://github.com/keystonejs/keystone/commit/6b353effc8b617137a3978b2c845e01403889722) Thanks [@timleslie](https://github.com/timleslie)! - Upgraded React to 16.13.0. | ||
- [`6b353eff`](https://github.com/keystonejs/keystone-5/commit/6b353effc8b617137a3978b2c845e01403889722) Thanks [@timleslie](https://github.com/timleslie)! - Upgraded React to 16.13.0. | ||
* [`5ba330b8`](https://github.com/keystonejs/keystone/commit/5ba330b8b2609ea0033a636daf9a215a5a192c20) [#2487](https://github.com/keystonejs/keystone/pull/2487) Thanks [@Noviny](https://github.com/Noviny)! - Small changes to package.json (mostly adding a repository field) | ||
* [`5ba330b8`](https://github.com/keystonejs/keystone-5/commit/5ba330b8b2609ea0033a636daf9a215a5a192c20) [#2487](https://github.com/keystonejs/keystone-5/pull/2487) Thanks [@Noviny](https://github.com/Noviny)! - Small changes to package.json (mostly adding a repository field) | ||
* Updated dependencies [[`5ba330b8`](https://github.com/keystonejs/keystone/commit/5ba330b8b2609ea0033a636daf9a215a5a192c20)]: | ||
* Updated dependencies [[`5ba330b8`](https://github.com/keystonejs/keystone-5/commit/5ba330b8b2609ea0033a636daf9a215a5a192c20)]: | ||
- @arch-ui/theme@0.0.9 | ||
@@ -55,7 +64,7 @@ | ||
- [`d8a7b8a2`](https://github.com/keystonejs/keystone/commit/d8a7b8a23b4c3e1545d101a92323be165ad362e2) [#2395](https://github.com/keystonejs/keystone/pull/2395) Thanks [@timleslie](https://github.com/timleslie)! - Upgraded all `@emotion.*` dependencies. | ||
- [`d8a7b8a2`](https://github.com/keystonejs/keystone-5/commit/d8a7b8a23b4c3e1545d101a92323be165ad362e2) [#2395](https://github.com/keystonejs/keystone-5/pull/2395) Thanks [@timleslie](https://github.com/timleslie)! - Upgraded all `@emotion.*` dependencies. | ||
* [`dcdd8ed9`](https://github.com/keystonejs/keystone/commit/dcdd8ed9142cf3328a7af80bc167ef93c7669b09) [#2381](https://github.com/keystonejs/keystone/pull/2381) Thanks [@timleslie](https://github.com/timleslie)! - Updated `@babel/*` dependency packages to latest versions. | ||
* [`dcdd8ed9`](https://github.com/keystonejs/keystone-5/commit/dcdd8ed9142cf3328a7af80bc167ef93c7669b09) [#2381](https://github.com/keystonejs/keystone-5/pull/2381) Thanks [@timleslie](https://github.com/timleslie)! - Updated `@babel/*` dependency packages to latest versions. | ||
* Updated dependencies [[`dcdd8ed9`](https://github.com/keystonejs/keystone/commit/dcdd8ed9142cf3328a7af80bc167ef93c7669b09)]: | ||
* Updated dependencies [[`dcdd8ed9`](https://github.com/keystonejs/keystone-5/commit/dcdd8ed9142cf3328a7af80bc167ef93c7669b09)]: | ||
- @arch-ui/theme@0.0.8 | ||
@@ -67,4 +76,4 @@ | ||
- [`38f88b62`](https://github.com/keystonejs/keystone/commit/38f88b62d9592d91b56528d4d9c40e9399440c4a) [#2144](https://github.com/keystonejs/keystone/pull/2144) - Upgraded all @babel/\* dependencies. | ||
- Updated dependencies [[`38f88b62`](https://github.com/keystonejs/keystone/commit/38f88b62d9592d91b56528d4d9c40e9399440c4a)]: | ||
- [`38f88b62`](https://github.com/keystonejs/keystone-5/commit/38f88b62d9592d91b56528d4d9c40e9399440c4a) [#2144](https://github.com/keystonejs/keystone-5/pull/2144) - Upgraded all @babel/\* dependencies. | ||
- Updated dependencies [[`38f88b62`](https://github.com/keystonejs/keystone-5/commit/38f88b62d9592d91b56528d4d9c40e9399440c4a)]: | ||
- @arch-ui/theme@0.0.7 | ||
@@ -76,4 +85,4 @@ | ||
- [`129b0f6`](https://github.com/keystonejs/keystone/commit/129b0f61f34adb7482901d2da4ddb14ce1aedd62) [#2092](https://github.com/keystonejs/keystone/pull/2092) - Upgrade all Babel deps to the same version (7.7.4) | ||
- Updated dependencies [[`129b0f6`](https://github.com/keystonejs/keystone/commit/129b0f61f34adb7482901d2da4ddb14ce1aedd62)]: | ||
- [`129b0f6`](https://github.com/keystonejs/keystone-5/commit/129b0f61f34adb7482901d2da4ddb14ce1aedd62) [#2092](https://github.com/keystonejs/keystone-5/pull/2092) - Upgrade all Babel deps to the same version (7.7.4) | ||
- Updated dependencies [[`129b0f6`](https://github.com/keystonejs/keystone-5/commit/129b0f61f34adb7482901d2da4ddb14ce1aedd62)]: | ||
- @arch-ui/theme@0.0.6 | ||
@@ -85,3 +94,3 @@ | ||
- [`946a52fd`](https://github.com/keystonejs/keystone/commit/946a52fd7057bb73f4ffd465ef51498172926866) [#1995](https://github.com/keystonejs/keystone/pull/1995) Thanks [@Vultraz](https://github.com/Vultraz)! - Updated `react` and `react-dom` to 16.12.0. | ||
- [`946a52fd`](https://github.com/keystonejs/keystone-5/commit/946a52fd7057bb73f4ffd465ef51498172926866) [#1995](https://github.com/keystonejs/keystone-5/pull/1995) Thanks [@Vultraz](https://github.com/Vultraz)! - Updated `react` and `react-dom` to 16.12.0. | ||
@@ -92,3 +101,3 @@ ## 0.0.8 | ||
- [`8226eb47`](https://github.com/keystonejs/keystone/commit/8226eb4709ea8ad5773c900eaaa96068d3cb6bad) [#1819](https://github.com/keystonejs/keystone/pull/1819) Thanks [@w01fgang](https://github.com/w01fgang)! - Upgraded `@emotion/core` and `@emotion/styled`. | ||
- [`8226eb47`](https://github.com/keystonejs/keystone-5/commit/8226eb4709ea8ad5773c900eaaa96068d3cb6bad) [#1819](https://github.com/keystonejs/keystone-5/pull/1819) Thanks [@w01fgang](https://github.com/w01fgang)! - Upgraded `@emotion/core` and `@emotion/styled`. | ||
@@ -99,7 +108,7 @@ ## 0.0.7 | ||
- [42c3fbc9](https://github.com/keystonejs/keystone/commit/42c3fbc9): Upgrade emotion to 10.0.14 | ||
- [42c3fbc9](https://github.com/keystonejs/keystone-5/commit/42c3fbc9): Upgrade emotion to 10.0.14 | ||
## 0.0.6 | ||
- Updated dependencies [19fe6c1b](https://github.com/keystonejs/keystone/commit/19fe6c1b): | ||
- Updated dependencies [19fe6c1b](https://github.com/keystonejs/keystone-5/commit/19fe6c1b): | ||
- @arch-ui/theme@0.0.5 | ||
@@ -111,3 +120,3 @@ | ||
- [81dc0be5](https://github.com/keystonejs/keystone/commit/81dc0be5): | ||
- [81dc0be5](https://github.com/keystonejs/keystone-5/commit/81dc0be5): | ||
@@ -118,3 +127,3 @@ - Update dependencies | ||
- Updated dependencies [e75c105c](https://github.com/keystonejs/keystone/commit/e75c105c): | ||
- Updated dependencies [e75c105c](https://github.com/keystonejs/keystone-5/commit/e75c105c): | ||
- @arch-ui/theme@0.0.3 | ||
@@ -124,3 +133,3 @@ | ||
- [patch][7417ea3a](https://github.com/keystonejs/keystone/commit/7417ea3a): | ||
- [patch][7417ea3a](https://github.com/keystonejs/keystone-5/commit/7417ea3a): | ||
@@ -127,0 +136,0 @@ - Update patch-level dependencies |
@@ -13,4 +13,2 @@ 'use strict'; | ||
var _extends__default = /*#__PURE__*/_interopDefault(_extends); | ||
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties); | ||
var React__default = /*#__PURE__*/_interopDefault(React); | ||
@@ -74,3 +72,3 @@ var styled__default = /*#__PURE__*/_interopDefault(styled); | ||
} = _ref, | ||
props = _objectWithoutProperties__default['default'](_ref, ["appearance", "max", "value", "variant"]); | ||
props = _objectWithoutProperties(_ref, ["appearance", "max", "value", "variant"]); | ||
@@ -86,3 +84,3 @@ const getValue = ({ | ||
return /*#__PURE__*/React__default['default'].createElement(BadgeElement, _extends__default['default']({ | ||
return /*#__PURE__*/React__default['default'].createElement(BadgeElement, _extends({ | ||
appearance: appearance, | ||
@@ -89,0 +87,0 @@ variant: variant |
@@ -1,16 +0,15 @@ | ||
"use strict"; | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var _extends = require("@babel/runtime/helpers/extends"), _objectWithoutProperties = require("@babel/runtime/helpers/objectWithoutProperties"), React = require("react"), styled = require("@emotion/styled"), theme = require("@arch-ui/theme"); | ||
var _extends = require('@babel/runtime/helpers/extends'); | ||
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); | ||
var React = require('react'); | ||
var styled = require('@emotion/styled'); | ||
var theme = require('@arch-ui/theme'); | ||
function _interopDefault(e) { | ||
return e && e.__esModule ? e : { | ||
default: e | ||
}; | ||
} | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
var _extends__default = _interopDefault(_extends), _objectWithoutProperties__default = _interopDefault(_objectWithoutProperties), React__default = _interopDefault(React), styled__default = _interopDefault(styled); | ||
var React__default = /*#__PURE__*/_interopDefault(React); | ||
var styled__default = /*#__PURE__*/_interopDefault(styled); | ||
@@ -24,12 +23,14 @@ const boldBackgroundColor = { | ||
danger: theme.colors.danger | ||
}, boldTextColor = { | ||
default: "white", | ||
inverted: "white", | ||
primary: "white", | ||
created: "white", | ||
warning: "white", | ||
danger: "white" | ||
}, subtleBackgroundColor = { | ||
}; | ||
const boldTextColor = { | ||
default: 'white', | ||
inverted: 'white', | ||
primary: 'white', | ||
created: 'white', | ||
warning: 'white', | ||
danger: 'white' | ||
}; | ||
const subtleBackgroundColor = { | ||
default: theme.colors.N10, | ||
inverted: "white", | ||
inverted: 'white', | ||
primary: theme.colors.B.L85, | ||
@@ -39,3 +40,4 @@ created: theme.colors.G.L85, | ||
danger: theme.colors.R.L85 | ||
}, subtleTextColor = { | ||
}; | ||
const subtleTextColor = { | ||
default: theme.colors.N70, | ||
@@ -47,22 +49,43 @@ inverted: theme.colors.text, | ||
danger: theme.colors.R.D20 | ||
}, BadgeElement = styled__default.default.div(({appearance: appearance, variant: variant}) => ({ | ||
backgroundColor: "bold" === variant ? boldBackgroundColor[appearance] : subtleBackgroundColor[appearance], | ||
borderRadius: "2em", | ||
boxSizing: "border-box", | ||
color: "bold" === variant ? boldTextColor[appearance] : subtleTextColor[appearance], | ||
display: "inline-block", | ||
}; | ||
const BadgeElement = styled__default['default'].div(({ | ||
appearance, | ||
variant | ||
}) => ({ | ||
backgroundColor: variant === 'bold' ? boldBackgroundColor[appearance] : subtleBackgroundColor[appearance], | ||
borderRadius: '2em', | ||
boxSizing: 'border-box', | ||
color: variant === 'bold' ? boldTextColor[appearance] : subtleTextColor[appearance], | ||
display: 'inline-block', | ||
fontSize: 12, | ||
fontWeight: 500, | ||
lineHeight: 1, | ||
minWidth: "2em", | ||
padding: "0.25em 0.5em", | ||
textAlign: "center" | ||
})), Badge = React.memo(_ref => { | ||
let {appearance: appearance = "default", max: max = 99, value: value = 0, variant: variant = "subtle"} = _ref, props = _objectWithoutProperties__default.default(_ref, [ "appearance", "max", "value", "variant" ]); | ||
return React__default.default.createElement(BadgeElement, _extends__default.default({ | ||
minWidth: '2em', | ||
padding: '0.25em 0.5em', | ||
textAlign: 'center' | ||
})); | ||
const Badge = /*#__PURE__*/React.memo((_ref) => { | ||
let { | ||
appearance = 'default', | ||
max = 99, | ||
value = 0, | ||
variant = 'subtle' | ||
} = _ref, | ||
props = _objectWithoutProperties(_ref, ["appearance", "max", "value", "variant"]); | ||
const getValue = ({ | ||
value, | ||
max | ||
}) => { | ||
if (value < 0) return '0'; | ||
if (max > 0 && value > max) return `${max}+`; | ||
return value; | ||
}; | ||
return /*#__PURE__*/React__default['default'].createElement(BadgeElement, _extends({ | ||
appearance: appearance, | ||
variant: variant | ||
}, props), (({value: value, max: max}) => value < 0 ? "0" : max > 0 && value > max ? max + "+" : value)({ | ||
value: value, | ||
max: max | ||
}, props), getValue({ | ||
value, | ||
max | ||
})); | ||
@@ -69,0 +92,0 @@ }); |
{ | ||
"name": "@arch-ui/badge", | ||
"description": "Badge Component used in @keystonejs Admin UI.", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"author": "Jed Watson", | ||
@@ -9,15 +9,15 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.13.1" | ||
"react": "^17.0.1" | ||
}, | ||
"devDependencies": { | ||
"react": "^16.13.1" | ||
"react": "^17.0.1" | ||
}, | ||
"dependencies": { | ||
"@arch-ui/theme": "0.0.11", | ||
"@babel/runtime": "^7.11.2", | ||
"@emotion/core": "^10.0.35", | ||
"@arch-ui/theme": "0.0.12", | ||
"@babel/runtime": "^7.12.13", | ||
"@emotion/core": "^10.1.1", | ||
"@emotion/styled": "^10.0.27" | ||
}, | ||
"module": "dist/badge.esm.js", | ||
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/arch/packages/badge" | ||
"repository": "https://github.com/keystonejs/keystone-5/tree/master/packages/arch/packages/badge" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
15025
313
1
+ Added@arch-ui/color-utils@0.0.3(transitive)
+ Added@arch-ui/theme@0.0.12(transitive)
+ Addedreact@17.0.2(transitive)
- Removed@arch-ui/color-utils@0.0.2(transitive)
- Removed@arch-ui/theme@0.0.11(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)
Updated@arch-ui/theme@0.0.12
Updated@babel/runtime@^7.12.13
Updated@emotion/core@^10.1.1