@atlaskit/badge 18.7.1 → 19.0.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,40 @@
1
1
  # @atlaskit/badge
2
2
 
3
+ ## 19.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ee28cf33718b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee28cf33718b0) -
8
+ Add @atlassian/react-compiler-gating as a runtime dependency to enable React Compiler platform
9
+ gating.
10
+ - Updated dependencies
11
+
12
+ ## 19.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
17
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
18
+
19
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
20
+
21
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
22
+
23
+ ```diff
24
+ - "typesVersions": {
25
+ - ">=4.5 <4.9": {
26
+ - "*": [
27
+ - "dist/types-ts4.5/*",
28
+ - "dist/types-ts4.5/index.d.ts"
29
+ - ]
30
+ - }
31
+ - },
32
+ ```
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+
3
38
  ## 18.7.1
4
39
 
5
40
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/badge.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/badge.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/badge.d.ts"
17
10
  }
package/badge.docs.tsx CHANGED
@@ -20,7 +20,9 @@ const documentation: StructuredContentSource = {
20
20
  'Use for displaying counts, scores, or status indicators for a single item or label',
21
21
  'Use with one item/label only to avoid ambiguity',
22
22
  'Keep badge content concise and meaningful',
23
- 'Use appropriate appearance variants for different contexts',
23
+ 'Use appropriate appearance variants for different contexts. Default semantic appearances: neutral, success, danger, warning, information, discovery, and inverse.',
24
+ 'Bold semantic appearances (successBold, dangerBold, warningBold, informationBold, discoveryBold) give higher visual prominence.',
25
+ 'Only use bold semantic badges for elements of high importance, such as notification counts. Avoid bold badges for elements that are secondary to other labels (e.g. alongside a lozenge).',
24
26
  'Position badges near relevant content',
25
27
  'Consider maximum value display limits',
26
28
  'Add a tooltip when the badge has an icon or needs extra context.',
@@ -46,7 +48,18 @@ const documentation: StructuredContentSource = {
46
48
  source: path.resolve(__dirname, './examples/ai/badge.tsx'),
47
49
  },
48
50
  ],
49
- keywords: ['badge', 'indicator', 'numeric', 'tally', 'score', 'count', 'status'],
51
+ keywords: [
52
+ 'badge',
53
+ 'indicator',
54
+ 'numeric',
55
+ 'tally',
56
+ 'score',
57
+ 'count',
58
+ 'status',
59
+ 'bold',
60
+ 'appearance',
61
+ 'notification',
62
+ ],
50
63
  categories: ['status-indicators'],
51
64
  },
52
65
  ],
package/new/package.json CHANGED
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/new.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/new.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/new.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "18.7.1",
3
+ "version": "19.0.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/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": [
24
16
  "**/*.compiled.css"
25
17
  ],
@@ -49,9 +41,10 @@
49
41
  }
50
42
  },
51
43
  "dependencies": {
52
- "@atlaskit/platform-feature-flags": "^1.1.0",
53
- "@atlaskit/primitives": "^19.0.0",
54
- "@atlaskit/tokens": "^13.3.0",
44
+ "@atlaskit/platform-feature-flags": "^2.0.0",
45
+ "@atlaskit/primitives": "^20.0.0",
46
+ "@atlaskit/tokens": "^15.0.0",
47
+ "@atlassian/react-compiler-gating": "^0.2.0",
55
48
  "@babel/runtime": "^7.0.0",
56
49
  "@compiled/react": "^0.20.0"
57
50
  },
@@ -62,15 +55,14 @@
62
55
  "@af/accessibility-testing": "workspace:^",
63
56
  "@af/integration-testing": "workspace:^",
64
57
  "@af/visual-regression": "workspace:^",
65
- "@atlaskit/docs": "^11.8.0",
66
- "@atlaskit/link": "^3.4.0",
67
- "@atlaskit/section-message": "^8.13.0",
68
- "@atlaskit/theme": "^25.0.0",
58
+ "@atlaskit/docs": "^12.0.0",
59
+ "@atlaskit/link": "^4.0.0",
60
+ "@atlaskit/section-message": "^9.1.0",
61
+ "@atlaskit/theme": "^26.0.0",
69
62
  "@atlassian/feature-flags-test-utils": "^1.1.0",
70
- "@atlassian/react-compiler-gating": "workspace:^",
71
63
  "@atlassian/ssr-tests": "workspace:*",
72
64
  "@atlassian/structured-docs-types": "workspace:^",
73
- "@atlassian/testing-library": "0.6.1",
65
+ "@atlassian/testing-library": "0.6.2",
74
66
  "react": "^18.2.0",
75
67
  "react-dom": "^18.2.0"
76
68
  },
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,15 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
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 {};
@@ -1,13 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import type { NewAppearance } from './types';
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
- };
@@ -1,23 +0,0 @@
1
- import type { BadgeNewProps } from './types';
2
- /**
3
- * __BadgeNew__
4
- *
5
- * New visual refresh implementation of Badge component for the labelling system.
6
- * This component is used when the 'platform-dst-lozenge-tag-badge-visual-uplifts' feature flag is enabled.
7
- *
8
- * Uses new appearance naming convention:
9
- * - success (green)
10
- * - danger (red)
11
- * - neutral (gray)
12
- * - information (blue)
13
- * - inverse (inverted colors)
14
- * - warning (orange/yellow)
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)
21
- */
22
- declare const BadgeNew: import('react').NamedExoticComponent<BadgeNewProps>;
23
- export default BadgeNew;
@@ -1,12 +0,0 @@
1
- import type { BadgeProps } from './types';
2
- /**
3
- * __Badge__
4
- *
5
- * This component gives you the full badge functionality and automatically formats the number you provide in \`children\`.
6
- *
7
- * - [Examples](https://atlassian.design/components/badge/examples)
8
- * - [Code](https://atlassian.design/components/badge/code)
9
- * - [Usage](https://atlassian.design/components/badge/usage)
10
- */
11
- declare const Badge: import('react').NamedExoticComponent<BadgeProps>;
12
- export default Badge;
@@ -1 +0,0 @@
1
- export { default } from '../badge';
@@ -1,2 +0,0 @@
1
- export { default } from '../badge-new';
2
- export type { BadgeNewProps } from '../types';
@@ -1 +0,0 @@
1
- export type { BadgeNewProps, BadgeProps, NewAppearance, ThemeAppearance } from '../types';
@@ -1,2 +0,0 @@
1
- export { default } from './badge';
2
- export type { BadgeProps, BadgeNewProps } from './types';
@@ -1 +0,0 @@
1
- export declare function formatValueWithNegativeSupport(value?: string | number, max?: number): string;
@@ -1 +0,0 @@
1
- export declare function formatValue(value?: string | number, max?: number): string;
@@ -1,69 +0,0 @@
1
- import type { CSSProperties, ReactNode } from 'react';
2
- export type ThemeAppearance = 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed' | 'warning' | 'discovery' | 'danger' | 'neutral' | 'success' | 'information' | 'inverse';
3
- export interface BadgeProps {
4
- /**
5
- * Affects the visual style of the badge.
6
- */
7
- appearance?: ThemeAppearance | NewAppearance;
8
- /**
9
- * The value displayed within the badge. A `ReactNode` can be provided for
10
- * custom-formatted numbers, however, badge should only be used in cases where you want to represent
11
- * a number.
12
- * Use a [lozenge](/packages/design-system/lozenge) for non-numeric information.
13
- */
14
- children?: number | ReactNode;
15
- /**
16
- * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
17
- * This value should be greater than 0. If set to `false` the original value will be displayed regardless of
18
- * whether it is larger than the default maximum value.
19
- */
20
- max?: number | false;
21
- /**
22
- * Style customization to apply to the badge. Only `backgroundColor` and `color` are supported.
23
- */
24
- style?: Pick<CSSProperties, 'backgroundColor' | 'color'>;
25
- /**
26
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
27
- */
28
- testId?: string;
29
- }
30
- /**
31
- * New appearance types for visual refresh.
32
- */
33
- export type NewAppearance = 'success' | 'danger' | 'neutral' | 'information' | 'inverse' | 'warning' | 'discovery' | 'informationBold' | 'successBold' | 'dangerBold' | 'warningBold' | 'discoveryBold';
34
- /**
35
- * Props for BadgeNew component with new appearance names.
36
- */
37
- export interface BadgeNewProps {
38
- /**
39
- * Affects the visual style of the badge.
40
- * Uses the new naming convention:
41
- * - success: Green (replaces "added")
42
- * - danger: Red (replaces "removed" and "important")
43
- * - neutral: Gray (replaces "default")
44
- * - information: Blue (replaces "primary")
45
- * - inverse: Inverted colors (replaces "primaryInverted")
46
- */
47
- appearance?: NewAppearance;
48
- /**
49
- * The value displayed within the badge. A `ReactNode` can be provided for
50
- * custom-formatted numbers, however, badge should only be used in cases where you want to represent
51
- * a number.
52
- * Use a [lozenge](/packages/design-system/lozenge/lozenge) for non-numeric information.
53
- */
54
- children?: number | ReactNode;
55
- /**
56
- * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
57
- * This value should be greater than 0. If set to `false` the original value will be displayed regardless of
58
- * whether it is larger than the default maximum value.
59
- */
60
- max?: number | false;
61
- /**
62
- * Style customization to apply to the badge. Only `backgroundColor` and `color` are supported.
63
- */
64
- style?: Pick<CSSProperties, 'backgroundColor' | 'color'>;
65
- /**
66
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
67
- */
68
- testId?: string;
69
- }