@arch-ui/badge
Advanced tools
Comparing version 0.0.8 to 0.0.9
# @arch-ui/badge | ||
## 0.0.9 | ||
### Patch Changes | ||
- [`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. | ||
## 0.0.8 | ||
@@ -4,0 +10,0 @@ |
@@ -1,4 +0,4 @@ | ||
import _extends from '@babel/runtime/helpers/extends'; | ||
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties'; | ||
import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
import _extends from '@babel/runtime/helpers/esm/extends'; | ||
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties'; | ||
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import React, { PureComponent } from 'react'; | ||
@@ -5,0 +5,0 @@ import styled from '@emotion/styled'; |
{ | ||
"name": "@arch-ui/badge", | ||
"description": "Badge Component used in @keystonejs Admin UI.", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"author": "Jed Watson", | ||
@@ -9,6 +9,6 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.8.6" | ||
"react": "^16.12.0" | ||
}, | ||
"devDependencies": { | ||
"react": "^16.8.6" | ||
"react": "^16.12.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "dependencies": { |
@@ -1,3 +0,1 @@ | ||
// @flow | ||
import React, { PureComponent } from 'react'; | ||
@@ -44,2 +42,3 @@ import styled from '@emotion/styled'; | ||
variant === 'bold' ? boldBackgroundColor[appearance] : subtleBackgroundColor[appearance], | ||
borderRadius: '2em', | ||
@@ -57,14 +56,3 @@ boxSizing: 'border-box', | ||
type Props = { | ||
/* Affects the visual style of the badge */ | ||
appearance: 'default' | 'primary' | 'created' | 'removed', | ||
/* The maximum value to display e.g. value = 100, max = 50; "50+" will be displayed */ | ||
max: number, | ||
/* The value displayed within the badge. */ | ||
value: number, | ||
/* The value displayed within the badge. */ | ||
variant: 'bold' | 'subtle', | ||
}; | ||
export class Badge extends PureComponent<Props> { | ||
export class Badge extends PureComponent { | ||
static defaultProps = { | ||
@@ -76,3 +64,3 @@ appearance: 'default', | ||
}; | ||
getValue = ({ value, max }: { value: number, max: number }) => { | ||
getValue = ({ value, max }) => { | ||
if (value < 0) return '0'; | ||
@@ -79,0 +67,0 @@ if (max > 0 && value > max) return `${max}+`; |
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
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
12047
8
347