@atlaskit/badge 15.1.3 → 15.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/badge
2
2
 
3
+ ## 15.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update how certain background colors are referenced by name. Internal changes only.
8
+ - Updated dependencies
9
+
10
+ ## 15.1.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
15
+
3
16
  ## 15.1.3
4
17
 
5
18
  ### Patch Changes
package/dist/cjs/badge.js CHANGED
@@ -7,14 +7,19 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
11
10
  var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
11
+ var _primitives = require("@atlaskit/primitives");
12
12
  var _utils = require("./internal/utils");
13
13
  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); }
14
14
  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; }
15
15
  /* eslint-disable @atlassian/tangerine/import/entry-points */
16
16
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
17
17
 
18
+ var boxStyles = (0, _primitives.xcss)({
19
+ borderRadius: 'border.radius.200',
20
+ display: 'inlineFlex'
21
+ });
22
+
18
23
  /**
19
24
  * __Badge__
20
25
  *
@@ -33,16 +38,15 @@ var Badge = /*#__PURE__*/(0, _react.memo)(function Badge(_ref) {
33
38
  max = _ref$max === void 0 ? 99 : _ref$max,
34
39
  style = _ref.style,
35
40
  testId = _ref.testId;
36
- return /*#__PURE__*/_react.default.createElement(_box.default, {
41
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
37
42
  testId: testId,
38
43
  as: "span",
39
44
  backgroundColor: backgroundColors[appearance],
40
- borderRadius: "badge",
41
- display: "inlineFlex",
42
- paddingInline: "space.075",
43
- UNSAFE_style: style !== null && style !== void 0 && style.backgroundColor ? {
45
+ xcss: boxStyles,
46
+ style: style !== null && style !== void 0 && style.backgroundColor ? {
44
47
  backgroundColor: style.backgroundColor
45
- } : undefined
48
+ } : undefined,
49
+ paddingInline: "space.075"
46
50
  }, /*#__PURE__*/_react.default.createElement(_text.default, {
47
51
  fontSize: "size.075",
48
52
  lineHeight: "lineHeight.100",
@@ -57,12 +61,12 @@ Badge.displayName = 'Badge';
57
61
  var _default = Badge;
58
62
  exports.default = _default;
59
63
  var backgroundColors = {
60
- added: 'success',
61
- default: 'neutral',
62
- important: 'danger.bold',
63
- primary: 'brand.bold',
64
+ added: 'color.background.success',
65
+ default: 'color.background.neutral',
66
+ important: 'color.background.danger.bold',
67
+ primary: 'color.background.brand.bold',
64
68
  primaryInverted: 'elevation.surface',
65
- removed: 'danger'
69
+ removed: 'color.background.danger'
66
70
  };
67
71
  var textColors = {
68
72
  added: 'success',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.3",
3
+ "version": "15.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,14 @@
1
1
  /* eslint-disable @atlassian/tangerine/import/entry-points */
2
2
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
3
  import React, { memo } from 'react';
4
- import Box from '@atlaskit/ds-explorations/box';
5
4
  import Text from '@atlaskit/ds-explorations/text';
5
+ import { Box, xcss } from '@atlaskit/primitives';
6
6
  import { formatValue } from './internal/utils';
7
+ const boxStyles = xcss({
8
+ borderRadius: 'border.radius.200',
9
+ display: 'inlineFlex'
10
+ });
11
+
7
12
  /**
8
13
  * __Badge__
9
14
  *
@@ -24,12 +29,11 @@ const Badge = /*#__PURE__*/memo(function Badge({
24
29
  testId: testId,
25
30
  as: "span",
26
31
  backgroundColor: backgroundColors[appearance],
27
- borderRadius: "badge",
28
- display: "inlineFlex",
29
- paddingInline: "space.075",
30
- UNSAFE_style: style !== null && style !== void 0 && style.backgroundColor ? {
32
+ xcss: boxStyles,
33
+ style: style !== null && style !== void 0 && style.backgroundColor ? {
31
34
  backgroundColor: style.backgroundColor
32
- } : undefined
35
+ } : undefined,
36
+ paddingInline: "space.075"
33
37
  }, /*#__PURE__*/React.createElement(Text, {
34
38
  fontSize: "size.075",
35
39
  lineHeight: "lineHeight.100",
@@ -43,12 +47,12 @@ const Badge = /*#__PURE__*/memo(function Badge({
43
47
  Badge.displayName = 'Badge';
44
48
  export default Badge;
45
49
  const backgroundColors = {
46
- added: 'success',
47
- default: 'neutral',
48
- important: 'danger.bold',
49
- primary: 'brand.bold',
50
+ added: 'color.background.success',
51
+ default: 'color.background.neutral',
52
+ important: 'color.background.danger.bold',
53
+ primary: 'color.background.brand.bold',
50
54
  primaryInverted: 'elevation.surface',
51
- removed: 'danger'
55
+ removed: 'color.background.danger'
52
56
  };
53
57
  const textColors = {
54
58
  added: 'success',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.3",
3
+ "version": "15.1.5",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/badge.js CHANGED
@@ -1,9 +1,14 @@
1
1
  /* eslint-disable @atlassian/tangerine/import/entry-points */
2
2
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
3
  import React, { memo } from 'react';
4
- import Box from '@atlaskit/ds-explorations/box';
5
4
  import Text from '@atlaskit/ds-explorations/text';
5
+ import { Box, xcss } from '@atlaskit/primitives';
6
6
  import { formatValue } from './internal/utils';
7
+ var boxStyles = xcss({
8
+ borderRadius: 'border.radius.200',
9
+ display: 'inlineFlex'
10
+ });
11
+
7
12
  /**
8
13
  * __Badge__
9
14
  *
@@ -26,12 +31,11 @@ var Badge = /*#__PURE__*/memo(function Badge(_ref) {
26
31
  testId: testId,
27
32
  as: "span",
28
33
  backgroundColor: backgroundColors[appearance],
29
- borderRadius: "badge",
30
- display: "inlineFlex",
31
- paddingInline: "space.075",
32
- UNSAFE_style: style !== null && style !== void 0 && style.backgroundColor ? {
34
+ xcss: boxStyles,
35
+ style: style !== null && style !== void 0 && style.backgroundColor ? {
33
36
  backgroundColor: style.backgroundColor
34
- } : undefined
37
+ } : undefined,
38
+ paddingInline: "space.075"
35
39
  }, /*#__PURE__*/React.createElement(Text, {
36
40
  fontSize: "size.075",
37
41
  lineHeight: "lineHeight.100",
@@ -45,12 +49,12 @@ var Badge = /*#__PURE__*/memo(function Badge(_ref) {
45
49
  Badge.displayName = 'Badge';
46
50
  export default Badge;
47
51
  var backgroundColors = {
48
- added: 'success',
49
- default: 'neutral',
50
- important: 'danger.bold',
51
- primary: 'brand.bold',
52
+ added: 'color.background.success',
53
+ default: 'color.background.neutral',
54
+ important: 'color.background.danger.bold',
55
+ primary: 'color.background.brand.bold',
52
56
  primaryInverted: 'elevation.surface',
53
- removed: 'danger'
57
+ removed: 'color.background.danger'
54
58
  };
55
59
  var textColors = {
56
60
  added: 'success',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.3",
3
+ "version": "15.1.5",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.3",
3
+ "version": "15.1.5",
4
4
  "description": "A badge is a visual indicator for numeric values such as tallies and scores.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@atlaskit/codemod-utils": "^4.2.0",
42
- "@atlaskit/ds-explorations": "^2.1.0",
42
+ "@atlaskit/ds-explorations": "^2.2.0",
43
+ "@atlaskit/primitives": "*",
43
44
  "@babel/runtime": "^7.0.0"
44
45
  },
45
46
  "peerDependencies": {
@@ -58,6 +59,7 @@
58
59
  "@atlassian/gemini-visual-regression": "*",
59
60
  "@emotion/react": "^11.7.1",
60
61
  "@testing-library/react": "^12.1.5",
62
+ "jest-axe": "^4.0.0",
61
63
  "jscodeshift": "^0.13.0",
62
64
  "react-dom": "^16.8.0",
63
65
  "react-test-renderer": "^16.8.0",