@atlaskit/badge 18.6.0 → 18.7.1

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,32 @@
1
1
  # @atlaskit/badge
2
2
 
3
+ ## 18.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5dd8cc218e393`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5dd8cc218e393) -
8
+ Release packages affected by an issue blocking you from installing <@compiled>/react due to a yarn
9
+ patch.
10
+
11
+ ## 18.7.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`bb9a7cf0620fa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bb9a7cf0620fa) -
16
+ Added 5 new bold semantic Badge appearances behind the
17
+ `platform-dst-lozenge-tag-badge-visual-uplifts` feature gate: `successBold`, `dangerBold`,
18
+ `warningBold`, `informationBold`, and `discoveryBold`.
19
+
20
+ These bold appearances use the new `color.background.<semantic>.subtle` tokens (introduced in
21
+ `@atlaskit/tokens@13.2.0`) as the background and pair with `color.text.<semantic>.bolder` text for
22
+ stronger visual prominence than the existing subtle semantic appearances. The legacy
23
+ `appearanceMapping` and `appearanceMappingToOld` helpers route the new appearances correctly when
24
+ the feature gate is off.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+
3
30
  ## 18.6.0
4
31
 
5
32
  ### Minor Changes
package/badge.docs.tsx CHANGED
@@ -1,53 +1,55 @@
1
1
  import path from 'path';
2
2
 
3
- import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
3
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
4
 
5
- const documentation: ComponentStructuredContentSource[] = [
6
- {
7
- name: 'Badge',
8
- description:
9
- 'A badge is a visual indicator for numeric values such as tallies and scores, providing quick visual feedback.',
10
- status: 'general-availability', // beta badge is feature-flagged
11
- import: {
5
+ const documentation: StructuredContentSource = {
6
+ components: [
7
+ {
12
8
  name: 'Badge',
13
- package: '@atlaskit/badge',
14
- type: 'default',
15
- packagePath: path.resolve(__dirname),
16
- packageJson: require('./package.json'),
17
- },
18
- usageGuidelines: [
19
- 'Use for displaying counts, scores, or status indicators for a single item or label',
20
- 'Use with one item/label only to avoid ambiguity',
21
- 'Keep badge content concise and meaningful',
22
- 'Use appropriate appearance variants for different contexts',
23
- 'Position badges near relevant content',
24
- 'Consider maximum value display limits',
25
- 'Add a tooltip when the badge has an icon or needs extra context.',
26
- 'Use Lozenge for non-numeric status; use Tag for labels',
27
- ],
28
- contentGuidelines: [
29
- 'Use clear, concise numeric or text values',
30
- 'Ensure values are meaningful to users',
31
- 'Use consistent formatting across similar badges',
32
- 'Consider localization for number formatting (locale-aware numbers)',
33
- ],
34
- accessibilityGuidelines: [
35
- 'Ensure badge content is announced by screen readers',
36
- 'Do not rely on color alone for positive/negative meaning',
37
- 'Use appropriate color contrast for text readability',
38
- 'Provide meaningful context for numeric values',
39
- 'Consider alternative text for non-numeric badges',
40
- ],
41
- examples: [
42
- {
9
+ description:
10
+ 'A badge is a visual indicator for numeric values such as tallies and scores, providing quick visual feedback.',
11
+ status: 'general-availability', // beta badge is feature-flagged
12
+ import: {
43
13
  name: 'Badge',
44
- description: 'Badge example',
45
- source: path.resolve(__dirname, './examples/ai/badge.tsx'),
14
+ package: '@atlaskit/badge',
15
+ type: 'default',
16
+ packagePath: path.resolve(__dirname),
17
+ packageJson: require('./package.json'),
46
18
  },
47
- ],
48
- keywords: ['badge', 'indicator', 'numeric', 'tally', 'score', 'count', 'status'],
49
- categories: ['status-indicators'],
50
- },
51
- ];
19
+ usageGuidelines: [
20
+ 'Use for displaying counts, scores, or status indicators for a single item or label',
21
+ 'Use with one item/label only to avoid ambiguity',
22
+ 'Keep badge content concise and meaningful',
23
+ 'Use appropriate appearance variants for different contexts',
24
+ 'Position badges near relevant content',
25
+ 'Consider maximum value display limits',
26
+ 'Add a tooltip when the badge has an icon or needs extra context.',
27
+ 'Use Lozenge for non-numeric status; use Tag for labels',
28
+ ],
29
+ contentGuidelines: [
30
+ 'Use clear, concise numeric or text values',
31
+ 'Ensure values are meaningful to users',
32
+ 'Use consistent formatting across similar badges',
33
+ 'Consider localization for number formatting (locale-aware numbers)',
34
+ ],
35
+ accessibilityGuidelines: [
36
+ 'Ensure badge content is announced by screen readers',
37
+ 'Do not rely on color alone for positive/negative meaning',
38
+ 'Use appropriate color contrast for text readability',
39
+ 'Provide meaningful context for numeric values',
40
+ 'Consider alternative text for non-numeric badges',
41
+ ],
42
+ examples: [
43
+ {
44
+ name: 'Badge',
45
+ description: 'Badge example',
46
+ source: path.resolve(__dirname, './examples/ai/badge.tsx'),
47
+ },
48
+ ],
49
+ keywords: ['badge', 'indicator', 'numeric', 'tally', 'score', 'count', 'status'],
50
+ categories: ['status-indicators'],
51
+ },
52
+ ],
53
+ };
52
54
 
53
55
  export default documentation;
@@ -8,6 +8,7 @@ exports.appearanceMappingToOld = void 0;
8
8
  * @jsxRuntime classic
9
9
  * @jsx jsx
10
10
  */
11
+
11
12
  var appearanceMappingToOld = exports.appearanceMappingToOld = {
12
13
  added: 'added',
13
14
  removed: 'removed',
@@ -21,5 +22,10 @@ var appearanceMappingToOld = exports.appearanceMappingToOld = {
21
22
  inverse: 'primaryInverted',
22
23
  neutral: 'default',
23
24
  warning: 'default',
24
- discovery: 'default'
25
+ discovery: 'default',
26
+ informationBold: 'primary',
27
+ successBold: 'added',
28
+ dangerBold: 'removed',
29
+ warningBold: 'default',
30
+ discoveryBold: 'default'
25
31
  };
@@ -22,5 +22,10 @@ var appearanceMapping = exports.appearanceMapping = {
22
22
  success: 'success',
23
23
  information: 'information',
24
24
  inverse: 'inverse',
25
- neutral: 'neutral'
25
+ neutral: 'neutral',
26
+ informationBold: 'informationBold',
27
+ successBold: 'successBold',
28
+ dangerBold: 'dangerBold',
29
+ warningBold: 'warningBold',
30
+ discoveryBold: 'discoveryBold'
26
31
  };
@@ -8,10 +8,16 @@
8
8
  ._1ul91ejb{min-width:var(--ds-space-300,24px)}
9
9
  ._bfhk10f4{background-color:var(--ds-background-warning-subtler,#fce4a6)}
10
10
  ._bfhk14j0{background-color:var(--ds-background-success-subtler,#d3f1a7)}
11
+ ._bfhk16ib{background-color:var(--ds-background-success-subtle,#b3df72)}
11
12
  ._bfhk18wg{background-color:var(--ds-background-danger-subtler,#ffd5d2)}
13
+ ._bfhk1kmu{background-color:var(--ds-background-warning-bold,#fbc828)}
14
+ ._bfhk5ly7{background-color:var(--ds-background-discovery-subtle,#d8a0f7)}
12
15
  ._bfhk7qp0{background-color:var(--ds-background-accent-gray-subtler,#dddee1)}
13
16
  ._bfhk8lbg{background-color:var(--ds-background-information-subtler,#cfe1fd)}
17
+ ._bfhk9pm7{background-color:var(--ds-background-information-subtle,#8fb8f6)}
14
18
  ._bfhke670{background-color:var(--ds-background-discovery-subtler,#eed7fc)}
19
+ ._bfhkgj02{background-color:var(--ds-background-warning-subtle,#fbd779)}
20
+ ._bfhkud63{background-color:var(--ds-background-danger-subtle,#fd9891)}
15
21
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
16
22
  ._syaz1blx{color:var(--ds-text-danger-bolder,#5d1f1a)}
17
23
  ._syaz1g72{color:var(--ds-text-discovery-bolder,#48245d)}
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _compiled = require("@atlaskit/primitives/compiled");
14
+ var _tokens = require("@atlaskit/tokens");
14
15
  var _formatValue = require("./internal/format-value");
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
17
  /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
@@ -23,7 +24,13 @@ var stylesNew = {
23
24
  information: "_syaz1qd9 _bfhk8lbg",
24
25
  discovery: "_syaz1g72 _bfhke670",
25
26
  neutral: "_syazi7uo _bfhk7qp0",
26
- inverse: "_bfhkvuon _syazi7uo"
27
+ inverse: "_bfhkvuon _syazi7uo",
28
+ informationBold: "_syaz1qd9 _bfhk9pm7",
29
+ successBold: "_syaz1p1e _bfhk16ib",
30
+ dangerBold: "_syaz1blx _bfhkud63",
31
+ warningBold: "_syazmgs1 _bfhk1kmu",
32
+ warningBoldDark: "_syazmgs1 _bfhkgj02",
33
+ discoveryBold: "_syaz1g72 _bfhk5ly7"
27
34
  };
28
35
  /* eslint-enable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
29
36
 
@@ -45,6 +52,11 @@ var badgeValueWithNegativeNumberSupported = function badgeValueWithNegativeNumbe
45
52
  * - inverse (inverted colors)
46
53
  * - warning (orange/yellow)
47
54
  * - discovery (purple)
55
+ * - informationBold (bold blue, color.background.information.subtle)
56
+ * - successBold (bold green, color.background.success.subtle)
57
+ * - dangerBold (bold red, color.background.danger.subtle)
58
+ * - warningBold (bold warning, color.background.warning.bold)
59
+ * - discoveryBold (bold purple, color.background.discovery.subtle)
48
60
  */
49
61
  var BadgeNew = /*#__PURE__*/(0, _react.memo)(function BadgeNew(_ref) {
50
62
  var _ref$appearance = _ref.appearance,
@@ -55,13 +67,19 @@ var BadgeNew = /*#__PURE__*/(0, _react.memo)(function BadgeNew(_ref) {
55
67
  max = _ref$max === void 0 ? 99 : _ref$max,
56
68
  style = _ref.style,
57
69
  testId = _ref.testId;
70
+ var _useThemeObserver = (0, _tokens.useThemeObserver)(),
71
+ colorMode = _useThemeObserver.colorMode;
72
+ // In dark theme, warningBold needs to swap to a lighter background
73
+ // (color.background.warning.subtle / Orange800) for better contrast against
74
+ // the typical dark surface colors.
75
+ var resolvedAppearance = appearance === 'warningBold' && colorMode === 'dark' ? 'warningBoldDark' : appearance;
58
76
  return /*#__PURE__*/React.createElement("span", {
59
77
  "data-testid": testId,
60
78
  style: {
61
79
  background: style === null || style === void 0 ? void 0 : style.backgroundColor,
62
80
  color: style === null || style === void 0 ? void 0 : style.color
63
81
  },
64
- className: (0, _runtime.ax)([stylesNew.root, stylesNew[appearance]])
82
+ className: (0, _runtime.ax)([stylesNew.root, stylesNew[resolvedAppearance]])
65
83
  }, /*#__PURE__*/React.createElement(_compiled.Text, {
66
84
  size: "small",
67
85
  align: "center",
@@ -2,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+
5
6
  export const appearanceMappingToOld = {
6
7
  added: 'added',
7
8
  removed: 'removed',
@@ -15,5 +16,10 @@ export const appearanceMappingToOld = {
15
16
  inverse: 'primaryInverted',
16
17
  neutral: 'default',
17
18
  warning: 'default',
18
- discovery: 'default'
19
+ discovery: 'default',
20
+ informationBold: 'primary',
21
+ successBold: 'added',
22
+ dangerBold: 'removed',
23
+ warningBold: 'default',
24
+ discoveryBold: 'default'
19
25
  };
@@ -16,5 +16,10 @@ export const appearanceMapping = {
16
16
  success: 'success',
17
17
  information: 'information',
18
18
  inverse: 'inverse',
19
- neutral: 'neutral'
19
+ neutral: 'neutral',
20
+ informationBold: 'informationBold',
21
+ successBold: 'successBold',
22
+ dangerBold: 'dangerBold',
23
+ warningBold: 'warningBold',
24
+ discoveryBold: 'discoveryBold'
20
25
  };
@@ -8,10 +8,16 @@
8
8
  ._1ul91ejb{min-width:var(--ds-space-300,24px)}
9
9
  ._bfhk10f4{background-color:var(--ds-background-warning-subtler,#fce4a6)}
10
10
  ._bfhk14j0{background-color:var(--ds-background-success-subtler,#d3f1a7)}
11
+ ._bfhk16ib{background-color:var(--ds-background-success-subtle,#b3df72)}
11
12
  ._bfhk18wg{background-color:var(--ds-background-danger-subtler,#ffd5d2)}
13
+ ._bfhk1kmu{background-color:var(--ds-background-warning-bold,#fbc828)}
14
+ ._bfhk5ly7{background-color:var(--ds-background-discovery-subtle,#d8a0f7)}
12
15
  ._bfhk7qp0{background-color:var(--ds-background-accent-gray-subtler,#dddee1)}
13
16
  ._bfhk8lbg{background-color:var(--ds-background-information-subtler,#cfe1fd)}
17
+ ._bfhk9pm7{background-color:var(--ds-background-information-subtle,#8fb8f6)}
14
18
  ._bfhke670{background-color:var(--ds-background-discovery-subtler,#eed7fc)}
19
+ ._bfhkgj02{background-color:var(--ds-background-warning-subtle,#fbd779)}
20
+ ._bfhkud63{background-color:var(--ds-background-danger-subtle,#fd9891)}
15
21
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
16
22
  ._syaz1blx{color:var(--ds-text-danger-bolder,#5d1f1a)}
17
23
  ._syaz1g72{color:var(--ds-text-discovery-bolder,#48245d)}
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { memo } from 'react';
6
6
  import { Text } from '@atlaskit/primitives/compiled';
7
+ import { useThemeObserver } from '@atlaskit/tokens';
7
8
  import { formatValue } from './internal/format-value';
8
9
  /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
9
10
  // Nested selectors with data attributes are required for theme switching
@@ -15,7 +16,13 @@ const stylesNew = {
15
16
  information: "_syaz1qd9 _bfhk8lbg",
16
17
  discovery: "_syaz1g72 _bfhke670",
17
18
  neutral: "_syazi7uo _bfhk7qp0",
18
- inverse: "_bfhkvuon _syazi7uo"
19
+ inverse: "_bfhkvuon _syazi7uo",
20
+ informationBold: "_syaz1qd9 _bfhk9pm7",
21
+ successBold: "_syaz1p1e _bfhk16ib",
22
+ dangerBold: "_syaz1blx _bfhkud63",
23
+ warningBold: "_syazmgs1 _bfhk1kmu",
24
+ warningBoldDark: "_syazmgs1 _bfhkgj02",
25
+ discoveryBold: "_syaz1g72 _bfhk5ly7"
19
26
  };
20
27
  /* eslint-enable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
21
28
 
@@ -37,6 +44,11 @@ const badgeValueWithNegativeNumberSupported = (children, max) => {
37
44
  * - inverse (inverted colors)
38
45
  * - warning (orange/yellow)
39
46
  * - discovery (purple)
47
+ * - informationBold (bold blue, color.background.information.subtle)
48
+ * - successBold (bold green, color.background.success.subtle)
49
+ * - dangerBold (bold red, color.background.danger.subtle)
50
+ * - warningBold (bold warning, color.background.warning.bold)
51
+ * - discoveryBold (bold purple, color.background.discovery.subtle)
40
52
  */
41
53
  const BadgeNew = /*#__PURE__*/memo(function BadgeNew({
42
54
  appearance = 'neutral',
@@ -45,13 +57,20 @@ const BadgeNew = /*#__PURE__*/memo(function BadgeNew({
45
57
  style,
46
58
  testId
47
59
  }) {
60
+ const {
61
+ colorMode
62
+ } = useThemeObserver();
63
+ // In dark theme, warningBold needs to swap to a lighter background
64
+ // (color.background.warning.subtle / Orange800) for better contrast against
65
+ // the typical dark surface colors.
66
+ const resolvedAppearance = appearance === 'warningBold' && colorMode === 'dark' ? 'warningBoldDark' : appearance;
48
67
  return /*#__PURE__*/React.createElement("span", {
49
68
  "data-testid": testId,
50
69
  style: {
51
70
  background: style === null || style === void 0 ? void 0 : style.backgroundColor,
52
71
  color: style === null || style === void 0 ? void 0 : style.color
53
72
  },
54
- className: ax([stylesNew.root, stylesNew[appearance]])
73
+ className: ax([stylesNew.root, stylesNew[resolvedAppearance]])
55
74
  }, /*#__PURE__*/React.createElement(Text, {
56
75
  size: "small",
57
76
  align: "center",
@@ -2,6 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
+
5
6
  export var appearanceMappingToOld = {
6
7
  added: 'added',
7
8
  removed: 'removed',
@@ -15,5 +16,10 @@ export var appearanceMappingToOld = {
15
16
  inverse: 'primaryInverted',
16
17
  neutral: 'default',
17
18
  warning: 'default',
18
- discovery: 'default'
19
+ discovery: 'default',
20
+ informationBold: 'primary',
21
+ successBold: 'added',
22
+ dangerBold: 'removed',
23
+ warningBold: 'default',
24
+ discoveryBold: 'default'
19
25
  };
@@ -16,5 +16,10 @@ export var appearanceMapping = {
16
16
  success: 'success',
17
17
  information: 'information',
18
18
  inverse: 'inverse',
19
- neutral: 'neutral'
19
+ neutral: 'neutral',
20
+ informationBold: 'informationBold',
21
+ successBold: 'successBold',
22
+ dangerBold: 'dangerBold',
23
+ warningBold: 'warningBold',
24
+ discoveryBold: 'discoveryBold'
20
25
  };
@@ -8,10 +8,16 @@
8
8
  ._1ul91ejb{min-width:var(--ds-space-300,24px)}
9
9
  ._bfhk10f4{background-color:var(--ds-background-warning-subtler,#fce4a6)}
10
10
  ._bfhk14j0{background-color:var(--ds-background-success-subtler,#d3f1a7)}
11
+ ._bfhk16ib{background-color:var(--ds-background-success-subtle,#b3df72)}
11
12
  ._bfhk18wg{background-color:var(--ds-background-danger-subtler,#ffd5d2)}
13
+ ._bfhk1kmu{background-color:var(--ds-background-warning-bold,#fbc828)}
14
+ ._bfhk5ly7{background-color:var(--ds-background-discovery-subtle,#d8a0f7)}
12
15
  ._bfhk7qp0{background-color:var(--ds-background-accent-gray-subtler,#dddee1)}
13
16
  ._bfhk8lbg{background-color:var(--ds-background-information-subtler,#cfe1fd)}
17
+ ._bfhk9pm7{background-color:var(--ds-background-information-subtle,#8fb8f6)}
14
18
  ._bfhke670{background-color:var(--ds-background-discovery-subtler,#eed7fc)}
19
+ ._bfhkgj02{background-color:var(--ds-background-warning-subtle,#fbd779)}
20
+ ._bfhkud63{background-color:var(--ds-background-danger-subtle,#fd9891)}
15
21
  ._bfhkvuon{background-color:var(--ds-surface,#fff)}
16
22
  ._syaz1blx{color:var(--ds-text-danger-bolder,#5d1f1a)}
17
23
  ._syaz1g72{color:var(--ds-text-discovery-bolder,#48245d)}
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { memo } from 'react';
6
6
  import { Text } from '@atlaskit/primitives/compiled';
7
+ import { useThemeObserver } from '@atlaskit/tokens';
7
8
  import { formatValue } from './internal/format-value';
8
9
  /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
9
10
  // Nested selectors with data attributes are required for theme switching
@@ -15,7 +16,13 @@ var stylesNew = {
15
16
  information: "_syaz1qd9 _bfhk8lbg",
16
17
  discovery: "_syaz1g72 _bfhke670",
17
18
  neutral: "_syazi7uo _bfhk7qp0",
18
- inverse: "_bfhkvuon _syazi7uo"
19
+ inverse: "_bfhkvuon _syazi7uo",
20
+ informationBold: "_syaz1qd9 _bfhk9pm7",
21
+ successBold: "_syaz1p1e _bfhk16ib",
22
+ dangerBold: "_syaz1blx _bfhkud63",
23
+ warningBold: "_syazmgs1 _bfhk1kmu",
24
+ warningBoldDark: "_syazmgs1 _bfhkgj02",
25
+ discoveryBold: "_syaz1g72 _bfhk5ly7"
19
26
  };
20
27
  /* eslint-enable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors */
21
28
 
@@ -37,6 +44,11 @@ var badgeValueWithNegativeNumberSupported = function badgeValueWithNegativeNumbe
37
44
  * - inverse (inverted colors)
38
45
  * - warning (orange/yellow)
39
46
  * - discovery (purple)
47
+ * - informationBold (bold blue, color.background.information.subtle)
48
+ * - successBold (bold green, color.background.success.subtle)
49
+ * - dangerBold (bold red, color.background.danger.subtle)
50
+ * - warningBold (bold warning, color.background.warning.bold)
51
+ * - discoveryBold (bold purple, color.background.discovery.subtle)
40
52
  */
41
53
  var BadgeNew = /*#__PURE__*/memo(function BadgeNew(_ref) {
42
54
  var _ref$appearance = _ref.appearance,
@@ -47,13 +59,19 @@ var BadgeNew = /*#__PURE__*/memo(function BadgeNew(_ref) {
47
59
  max = _ref$max === void 0 ? 99 : _ref$max,
48
60
  style = _ref.style,
49
61
  testId = _ref.testId;
62
+ var _useThemeObserver = useThemeObserver(),
63
+ colorMode = _useThemeObserver.colorMode;
64
+ // In dark theme, warningBold needs to swap to a lighter background
65
+ // (color.background.warning.subtle / Orange800) for better contrast against
66
+ // the typical dark surface colors.
67
+ var resolvedAppearance = appearance === 'warningBold' && colorMode === 'dark' ? 'warningBoldDark' : appearance;
50
68
  return /*#__PURE__*/React.createElement("span", {
51
69
  "data-testid": testId,
52
70
  style: {
53
71
  background: style === null || style === void 0 ? void 0 : style.backgroundColor,
54
72
  color: style === null || style === void 0 ? void 0 : style.color
55
73
  },
56
- className: ax([stylesNew.root, stylesNew[appearance]])
74
+ className: ax([stylesNew.root, stylesNew[resolvedAppearance]])
57
75
  }, /*#__PURE__*/React.createElement(Text, {
58
76
  size: "small",
59
77
  align: "center",
@@ -2,4 +2,14 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- export declare const appearanceMappingToOld: Record<'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important' | 'warning' | 'discovery' | 'danger' | 'success' | 'information' | 'inverse' | 'neutral', 'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important'>;
5
+ import type { NewAppearance } from './types';
6
+ type OldAppearance = 'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important';
7
+ export declare const appearanceMappingToOld: Record<NewAppearance, OldAppearance> & {
8
+ added: OldAppearance;
9
+ removed: OldAppearance;
10
+ default: OldAppearance;
11
+ primary: OldAppearance;
12
+ primaryInverted: OldAppearance;
13
+ important: OldAppearance;
14
+ };
15
+ export {};
@@ -3,4 +3,11 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import type { NewAppearance } from './types';
6
- export declare const appearanceMapping: Record<'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important' | 'warning' | 'discovery' | 'danger' | 'success' | 'information' | 'inverse' | 'neutral', NewAppearance>;
6
+ export declare const appearanceMapping: Record<NewAppearance, NewAppearance> & {
7
+ added: NewAppearance;
8
+ removed: NewAppearance;
9
+ default: NewAppearance;
10
+ primary: NewAppearance;
11
+ primaryInverted: NewAppearance;
12
+ important: NewAppearance;
13
+ };
@@ -13,6 +13,11 @@ import type { BadgeNewProps } from './types';
13
13
  * - inverse (inverted colors)
14
14
  * - warning (orange/yellow)
15
15
  * - discovery (purple)
16
+ * - informationBold (bold blue, color.background.information.subtle)
17
+ * - successBold (bold green, color.background.success.subtle)
18
+ * - dangerBold (bold red, color.background.danger.subtle)
19
+ * - warningBold (bold warning, color.background.warning.bold)
20
+ * - discoveryBold (bold purple, color.background.discovery.subtle)
16
21
  */
17
22
  declare const BadgeNew: import('react').NamedExoticComponent<BadgeNewProps>;
18
23
  export default BadgeNew;
@@ -4,7 +4,7 @@ export interface BadgeProps {
4
4
  /**
5
5
  * Affects the visual style of the badge.
6
6
  */
7
- appearance?: ThemeAppearance;
7
+ appearance?: ThemeAppearance | NewAppearance;
8
8
  /**
9
9
  * The value displayed within the badge. A `ReactNode` can be provided for
10
10
  * custom-formatted numbers, however, badge should only be used in cases where you want to represent
@@ -30,7 +30,7 @@ export interface BadgeProps {
30
30
  /**
31
31
  * New appearance types for visual refresh.
32
32
  */
33
- export type NewAppearance = 'success' | 'danger' | 'neutral' | 'information' | 'inverse' | 'warning' | 'discovery';
33
+ export type NewAppearance = 'success' | 'danger' | 'neutral' | 'information' | 'inverse' | 'warning' | 'discovery' | 'informationBold' | 'successBold' | 'dangerBold' | 'warningBold' | 'discoveryBold';
34
34
  /**
35
35
  * Props for BadgeNew component with new appearance names.
36
36
  */
@@ -2,4 +2,14 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- export declare const appearanceMappingToOld: Record<'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important' | 'warning' | 'discovery' | 'danger' | 'success' | 'information' | 'inverse' | 'neutral', 'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important'>;
5
+ import type { NewAppearance } from './types';
6
+ type OldAppearance = 'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important';
7
+ export declare const appearanceMappingToOld: Record<NewAppearance, OldAppearance> & {
8
+ added: OldAppearance;
9
+ removed: OldAppearance;
10
+ default: OldAppearance;
11
+ primary: OldAppearance;
12
+ primaryInverted: OldAppearance;
13
+ important: OldAppearance;
14
+ };
15
+ export {};
@@ -3,4 +3,11 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import type { NewAppearance } from './types';
6
- export declare const appearanceMapping: Record<'added' | 'removed' | 'default' | 'primary' | 'primaryInverted' | 'important' | 'warning' | 'discovery' | 'danger' | 'success' | 'information' | 'inverse' | 'neutral', NewAppearance>;
6
+ export declare const appearanceMapping: Record<NewAppearance, NewAppearance> & {
7
+ added: NewAppearance;
8
+ removed: NewAppearance;
9
+ default: NewAppearance;
10
+ primary: NewAppearance;
11
+ primaryInverted: NewAppearance;
12
+ important: NewAppearance;
13
+ };
@@ -13,6 +13,11 @@ import type { BadgeNewProps } from './types';
13
13
  * - inverse (inverted colors)
14
14
  * - warning (orange/yellow)
15
15
  * - discovery (purple)
16
+ * - informationBold (bold blue, color.background.information.subtle)
17
+ * - successBold (bold green, color.background.success.subtle)
18
+ * - dangerBold (bold red, color.background.danger.subtle)
19
+ * - warningBold (bold warning, color.background.warning.bold)
20
+ * - discoveryBold (bold purple, color.background.discovery.subtle)
16
21
  */
17
22
  declare const BadgeNew: import('react').NamedExoticComponent<BadgeNewProps>;
18
23
  export default BadgeNew;
@@ -4,7 +4,7 @@ export interface BadgeProps {
4
4
  /**
5
5
  * Affects the visual style of the badge.
6
6
  */
7
- appearance?: ThemeAppearance;
7
+ appearance?: ThemeAppearance | NewAppearance;
8
8
  /**
9
9
  * The value displayed within the badge. A `ReactNode` can be provided for
10
10
  * custom-formatted numbers, however, badge should only be used in cases where you want to represent
@@ -30,7 +30,7 @@ export interface BadgeProps {
30
30
  /**
31
31
  * New appearance types for visual refresh.
32
32
  */
33
- export type NewAppearance = 'success' | 'danger' | 'neutral' | 'information' | 'inverse' | 'warning' | 'discovery';
33
+ export type NewAppearance = 'success' | 'danger' | 'neutral' | 'information' | 'inverse' | 'warning' | 'discovery' | 'informationBold' | 'successBold' | 'dangerBold' | 'warningBold' | 'discoveryBold';
34
34
  /**
35
35
  * Props for BadgeNew component with new appearance names.
36
36
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "18.6.0",
3
+ "version": "18.7.1",
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/"
@@ -35,7 +35,7 @@
35
35
  "team": "Design System Team",
36
36
  "website": {
37
37
  "name": "Badge",
38
- "category": "Status indicators",
38
+ "category": "Labels",
39
39
  "subPages": [
40
40
  {
41
41
  "title": "Badge",
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
53
  "@atlaskit/primitives": "^19.0.0",
54
- "@atlaskit/tokens": "^13.0.0",
54
+ "@atlaskit/tokens": "^13.3.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@compiled/react": "^0.20.0"
57
57
  },
@@ -64,13 +64,14 @@
64
64
  "@af/visual-regression": "workspace:^",
65
65
  "@atlaskit/docs": "^11.8.0",
66
66
  "@atlaskit/link": "^3.4.0",
67
- "@atlaskit/section-message": "^8.12.0",
68
- "@atlaskit/theme": "^23.1.0",
69
- "@atlassian/feature-flags-test-utils": "^1.0.0",
67
+ "@atlaskit/section-message": "^8.13.0",
68
+ "@atlaskit/theme": "^25.0.0",
69
+ "@atlassian/feature-flags-test-utils": "^1.1.0",
70
70
  "@atlassian/react-compiler-gating": "workspace:^",
71
71
  "@atlassian/ssr-tests": "workspace:*",
72
72
  "@atlassian/structured-docs-types": "workspace:^",
73
- "@atlassian/testing-library": "0.5.0",
73
+ "@atlassian/testing-library": "0.6.1",
74
+ "react": "^18.2.0",
74
75
  "react-dom": "^18.2.0"
75
76
  },
76
77
  "techstack": {
package/offerings.json DELETED
@@ -1,36 +0,0 @@
1
- [
2
- {
3
- "name": "Badge",
4
- "package": "@atlaskit/badge",
5
- "import": {
6
- "name": "Badge",
7
- "package": "@atlaskit/badge",
8
- "type": "default"
9
- },
10
- "keywords": ["badge", "indicator", "numeric", "tally", "score", "count", "status"],
11
- "categories": ["status-indicators"],
12
- "shortDescription": "A badge is a visual indicator for numeric values such as tallies and scores, providing quick visual feedback.",
13
- "status": "general-availability",
14
- "accessibilityGuidelines": [
15
- "Ensure badge content is announced by screen readers",
16
- "Use appropriate color contrast for text readability",
17
- "Provide meaningful context for numeric values",
18
- "Consider alternative text for non-numeric badges"
19
- ],
20
- "usageGuidelines": [
21
- "Use for displaying counts, scores, or status indicators",
22
- "Keep badge content concise and meaningful",
23
- "Use appropriate appearance variants for different contexts",
24
- "Position badges near relevant content",
25
- "Consider maximum value display limits"
26
- ],
27
- "contentGuidelines": [
28
- "Use clear, concise numeric or text values",
29
- "Ensure values are meaningful to users",
30
- "Consider localization for number formatting",
31
- "Use consistent formatting across similar badges"
32
- ],
33
- "generativeInstructions": "./docs/ai/badge-instructions.md",
34
- "examples": ["./examples/ai/badge.tsx"]
35
- }
36
- ]