@atlaskit/badge 18.4.0 → 18.4.2

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,20 @@
1
1
  # @atlaskit/badge
2
2
 
3
+ ## 18.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`22bf79dbdcdca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22bf79dbdcdca) -
8
+ Internal changes to remove unnecessary token fallbacks and imports from `@atlaskit/theme`
9
+
10
+ ## 18.4.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`5db9e3f21a52f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5db9e3f21a52f) -
15
+ Internal refactoring
16
+ - Updated dependencies
17
+
3
18
  ## 18.4.0
4
19
 
5
20
  ### Minor Changes
package/badge.docs.tsx ADDED
@@ -0,0 +1,53 @@
1
+ import path from 'path';
2
+
3
+ import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
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: {
12
+ 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
+ {
43
+ name: 'Badge',
44
+ description: 'Badge example',
45
+ source: path.resolve(__dirname, './examples/ai/badge.tsx'),
46
+ },
47
+ ],
48
+ keywords: ['badge', 'indicator', 'numeric', 'tally', 'score', 'count', 'status'],
49
+ categories: ['status-indicators'],
50
+ },
51
+ ];
52
+
53
+ export default documentation;
@@ -1,4 +1,4 @@
1
- /* badge-new.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge-new.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
package/dist/cjs/badge.js CHANGED
@@ -1,4 +1,4 @@
1
- /* badge.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -60,16 +60,12 @@ var Badge = /*#__PURE__*/(0, _react.memo)(function Badge(_ref) {
60
60
  if ((0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts')) {
61
61
  // Map old appearance names to new ones
62
62
  var newAppearance = _badgeNew.appearanceMapping[appearance];
63
- return (
64
- /*#__PURE__*/
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
66
- React.createElement(_badgeNew.default, {
67
- appearance: newAppearance,
68
- max: max,
69
- style: style,
70
- testId: testId
71
- }, children)
72
- );
63
+ return /*#__PURE__*/React.createElement(_badgeNew.default, {
64
+ appearance: newAppearance,
65
+ max: max,
66
+ style: style,
67
+ testId: testId
68
+ }, children);
73
69
  }
74
70
  var oldAppearance = _badgeNew.appearanceMappingToOld[appearance];
75
71
  return /*#__PURE__*/React.createElement("span", {
@@ -1,4 +1,4 @@
1
- /* badge-new.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge-new.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./badge-new.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* badge.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./badge.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -50,16 +50,12 @@ const Badge = /*#__PURE__*/memo(function Badge({
50
50
  if (fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
51
51
  // Map old appearance names to new ones
52
52
  const newAppearance = appearanceMapping[appearance];
53
- return (
54
- /*#__PURE__*/
55
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
56
- React.createElement(BadgeNew, {
57
- appearance: newAppearance,
58
- max: max,
59
- style: style,
60
- testId: testId
61
- }, children)
62
- );
53
+ return /*#__PURE__*/React.createElement(BadgeNew, {
54
+ appearance: newAppearance,
55
+ max: max,
56
+ style: style,
57
+ testId: testId
58
+ }, children);
63
59
  }
64
60
  const oldAppearance = appearanceMappingToOld[appearance];
65
61
  return /*#__PURE__*/React.createElement("span", {
@@ -1,4 +1,4 @@
1
- /* badge-new.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge-new.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./badge-new.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
package/dist/esm/badge.js CHANGED
@@ -1,4 +1,4 @@
1
- /* badge.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* badge.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./badge.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -52,16 +52,12 @@ var Badge = /*#__PURE__*/memo(function Badge(_ref) {
52
52
  if (fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
53
53
  // Map old appearance names to new ones
54
54
  var newAppearance = appearanceMapping[appearance];
55
- return (
56
- /*#__PURE__*/
57
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
58
- React.createElement(BadgeNew, {
59
- appearance: newAppearance,
60
- max: max,
61
- style: style,
62
- testId: testId
63
- }, children)
64
- );
55
+ return /*#__PURE__*/React.createElement(BadgeNew, {
56
+ appearance: newAppearance,
57
+ max: max,
58
+ style: style,
59
+ testId: testId
60
+ }, children);
65
61
  }
66
62
  var oldAppearance = appearanceMappingToOld[appearance];
67
63
  return /*#__PURE__*/React.createElement("span", {
@@ -24,5 +24,5 @@ export declare const appearanceMappingToOld: Record<'added' | 'removed' | 'defau
24
24
  * - warning (orange/yellow)
25
25
  * - discovery (purple)
26
26
  */
27
- declare const BadgeNew: import("react").NamedExoticComponent<BadgeNewProps>;
27
+ declare const BadgeNew: import('react').NamedExoticComponent<BadgeNewProps>;
28
28
  export default BadgeNew;
@@ -8,5 +8,5 @@ import type { BadgeProps } from './types';
8
8
  * - [Code](https://atlassian.design/components/badge/code)
9
9
  * - [Usage](https://atlassian.design/components/badge/usage)
10
10
  */
11
- declare const Badge: import("react").NamedExoticComponent<BadgeProps>;
11
+ declare const Badge: import('react').NamedExoticComponent<BadgeProps>;
12
12
  export default Badge;
@@ -24,5 +24,5 @@ export declare const appearanceMappingToOld: Record<'added' | 'removed' | 'defau
24
24
  * - warning (orange/yellow)
25
25
  * - discovery (purple)
26
26
  */
27
- declare const BadgeNew: import("react").NamedExoticComponent<BadgeNewProps>;
27
+ declare const BadgeNew: import('react').NamedExoticComponent<BadgeNewProps>;
28
28
  export default BadgeNew;
@@ -8,5 +8,5 @@ import type { BadgeProps } from './types';
8
8
  * - [Code](https://atlassian.design/components/badge/code)
9
9
  * - [Usage](https://atlassian.design/components/badge/usage)
10
10
  */
11
- declare const Badge: import("react").NamedExoticComponent<BadgeProps>;
11
+ declare const Badge: import('react').NamedExoticComponent<BadgeProps>;
12
12
  export default Badge;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "18.4.0",
3
+ "version": "18.4.2",
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/"
@@ -34,8 +34,8 @@
34
34
  "title": "Badge",
35
35
  "id": "badge",
36
36
  "status": {
37
- "type": "alpha",
38
- "description": "This is an experiment under a feature flag. We may make frequent breaking changes with limited notice. We don't recommend using this without support from our team."
37
+ "type": "beta",
38
+ "description": "New and ready to use. These visual updates are currently behind the feature flag: `platform-dst-lozenge-tag-badge-visual-uplifts`. We'll provide comms and support for any major changes."
39
39
  }
40
40
  }
41
41
  ]
@@ -43,10 +43,10 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
- "@atlaskit/primitives": "^18.0.0",
47
- "@atlaskit/tokens": "^11.0.0",
46
+ "@atlaskit/primitives": "^18.1.0",
47
+ "@atlaskit/tokens": "^11.4.0",
48
48
  "@babel/runtime": "^7.0.0",
49
- "@compiled/react": "^0.18.6"
49
+ "@compiled/react": "^0.20.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^18.2.0"
@@ -55,13 +55,14 @@
55
55
  "@af/accessibility-testing": "workspace:^",
56
56
  "@af/integration-testing": "workspace:^",
57
57
  "@af/visual-regression": "workspace:^",
58
- "@atlaskit/docs": "^11.3.0",
58
+ "@atlaskit/docs": "^11.7.0",
59
59
  "@atlaskit/link": "^3.3.0",
60
60
  "@atlaskit/section-message": "^8.12.0",
61
- "@atlaskit/theme": "^21.0.0",
61
+ "@atlaskit/theme": "^22.0.0",
62
62
  "@atlassian/feature-flags-test-utils": "^1.0.0",
63
63
  "@atlassian/ssr-tests": "workspace:*",
64
- "@atlassian/testing-library": "0.4.0",
64
+ "@atlassian/structured-docs-types": "workspace:^",
65
+ "@atlassian/testing-library": "0.5.0",
65
66
  "react-dom": "^18.2.0"
66
67
  },
67
68
  "techstack": {