@atlaskit/badge
Advanced tools
Comparing version 15.0.23 to 15.1.0
# @atlaskit/badge | ||
## 15.1.0 | ||
### Minor Changes | ||
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump | ||
### Patch Changes | ||
- Updated dependencies | ||
## 15.0.23 | ||
@@ -4,0 +14,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,17 +9,9 @@ value: true | ||
exports.default = void 0; | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box")); | ||
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text")); | ||
var _utils = require("./internal/utils"); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
/* eslint-disable @atlassian/tangerine/import/entry-points */ | ||
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ | ||
@@ -40,9 +30,9 @@ | ||
var _ref$appearance = _ref.appearance, | ||
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, | ||
_ref$children = _ref.children, | ||
children = _ref$children === void 0 ? 0 : _ref$children, | ||
_ref$max = _ref.max, | ||
max = _ref$max === void 0 ? 99 : _ref$max, | ||
style = _ref.style, | ||
testId = _ref.testId; | ||
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, | ||
_ref$children = _ref.children, | ||
children = _ref$children === void 0 ? 0 : _ref$children, | ||
_ref$max = _ref.max, | ||
max = _ref$max === void 0 ? 99 : _ref$max, | ||
style = _ref.style, | ||
testId = _ref.testId; | ||
return /*#__PURE__*/_react.default.createElement(_box.default, { | ||
@@ -49,0 +39,0 @@ testId: testId, |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,3 +13,2 @@ value: true | ||
}); | ||
var _badge = _interopRequireDefault(require("../badge")); |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,3 +13,2 @@ value: true | ||
}); | ||
var _badge = _interopRequireDefault(require("./badge")); |
@@ -7,26 +7,19 @@ "use strict"; | ||
exports.formatValue = formatValue; | ||
function getSafeValue() { | ||
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | ||
if (value < 0) { | ||
return 0; | ||
} | ||
return value; | ||
} | ||
function formatValue(value, max) { | ||
var safeValue = getSafeValue(value); | ||
var safeMax = getSafeValue(max); | ||
if (safeMax && safeMax < safeValue) { | ||
return "".concat(safeMax, "+"); | ||
} | ||
if (safeValue === Infinity) { | ||
return '∞'; | ||
} | ||
return safeValue.toString(); | ||
} |
{ | ||
"name": "@atlaskit/badge", | ||
"version": "15.0.23", | ||
"version": "15.1.0", | ||
"sideEffects": false | ||
} |
/* eslint-disable @atlassian/tangerine/import/entry-points */ | ||
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ | ||
@@ -8,3 +7,2 @@ import React, { memo } from 'react'; | ||
import { formatValue } from './internal/utils'; | ||
/** | ||
@@ -11,0 +9,0 @@ * __Badge__ |
@@ -5,19 +5,14 @@ function getSafeValue(value = 0) { | ||
} | ||
return value; | ||
} | ||
export function formatValue(value, max) { | ||
const safeValue = getSafeValue(value); | ||
const safeMax = getSafeValue(max); | ||
if (safeMax && safeMax < safeValue) { | ||
return `${safeMax}+`; | ||
} | ||
if (safeValue === Infinity) { | ||
return '∞'; | ||
} | ||
return safeValue.toString(); | ||
} |
{ | ||
"name": "@atlaskit/badge", | ||
"version": "15.0.23", | ||
"version": "15.1.0", | ||
"sideEffects": false | ||
} |
/* eslint-disable @atlassian/tangerine/import/entry-points */ | ||
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ | ||
@@ -8,3 +7,2 @@ import React, { memo } from 'react'; | ||
import { formatValue } from './internal/utils'; | ||
/** | ||
@@ -21,9 +19,9 @@ * __Badge__ | ||
var _ref$appearance = _ref.appearance, | ||
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, | ||
_ref$children = _ref.children, | ||
children = _ref$children === void 0 ? 0 : _ref$children, | ||
_ref$max = _ref.max, | ||
max = _ref$max === void 0 ? 99 : _ref$max, | ||
style = _ref.style, | ||
testId = _ref.testId; | ||
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, | ||
_ref$children = _ref.children, | ||
children = _ref$children === void 0 ? 0 : _ref$children, | ||
_ref$max = _ref.max, | ||
max = _ref$max === void 0 ? 99 : _ref$max, | ||
style = _ref.style, | ||
testId = _ref.testId; | ||
return /*#__PURE__*/React.createElement(Box, { | ||
@@ -30,0 +28,0 @@ testId: testId, |
function getSafeValue() { | ||
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | ||
if (value < 0) { | ||
return 0; | ||
} | ||
return value; | ||
} | ||
export function formatValue(value, max) { | ||
var safeValue = getSafeValue(value); | ||
var safeMax = getSafeValue(max); | ||
if (safeMax && safeMax < safeValue) { | ||
return "".concat(safeMax, "+"); | ||
} | ||
if (safeValue === Infinity) { | ||
return '∞'; | ||
} | ||
return safeValue.toString(); | ||
} |
{ | ||
"name": "@atlaskit/badge", | ||
"version": "15.0.23", | ||
"version": "15.1.0", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/badge", | ||
"version": "15.0.23", | ||
"version": "15.1.0", | ||
"description": "A badge is a visual indicator for numeric values such as tallies and scores.", | ||
@@ -18,3 +18,2 @@ "publishConfig": { | ||
"atlassian": { | ||
"disableProductCI": true, | ||
"team": "Design System Team", | ||
@@ -32,4 +31,4 @@ "releaseModel": "scheduled", | ||
"dependencies": { | ||
"@atlaskit/codemod-utils": "^4.1.0", | ||
"@atlaskit/ds-explorations": "^2.0.0", | ||
"@atlaskit/codemod-utils": "^4.2.0", | ||
"@atlaskit/ds-explorations": "^2.1.0", | ||
"@babel/runtime": "^7.0.0" | ||
@@ -41,6 +40,6 @@ }, | ||
"devDependencies": { | ||
"@atlaskit/button": "^16.5.0", | ||
"@atlaskit/button": "^16.7.0", | ||
"@atlaskit/docs": "*", | ||
"@atlaskit/ds-lib": "^2.1.1", | ||
"@atlaskit/section-message": "^6.3.0", | ||
"@atlaskit/ds-lib": "^2.2.0", | ||
"@atlaskit/section-message": "^6.4.0", | ||
"@atlaskit/ssr": "*", | ||
@@ -77,4 +76,6 @@ "@atlaskit/theme": "*", | ||
"analytics": "analytics-next", | ||
"design-tokens": "spacing", | ||
"theming": "tokens", | ||
"design-tokens": [ | ||
"color", | ||
"spacing" | ||
], | ||
"deprecation": "no-deprecated-imports" | ||
@@ -81,0 +82,0 @@ } |
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
58182