@atlaskit/badge 15.1.0 → 15.1.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,17 @@
1
1
  # @atlaskit/badge
2
2
 
3
+ ## 15.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 15.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 15.1.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.0",
3
+ "version": "15.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.0",
3
+ "version": "15.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.0",
3
+ "version": "15.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
- export declare type ThemeAppearance = 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
2
+ export type ThemeAppearance = 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
3
3
  export interface BadgeProps {
4
4
  /**
5
5
  * Affects the visual style of the badge.
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { BadgeProps } from './types';
3
+ /**
4
+ * __Badge__
5
+ *
6
+ * This component gives you the full badge functionality and automatically formats the number you provide in \`children\`.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/badge/examples)
9
+ * - [Code](https://atlassian.design/components/badge/code)
10
+ * - [Usage](https://atlassian.design/components/badge/usage)
11
+ */
12
+ declare const Badge: React.NamedExoticComponent<BadgeProps>;
13
+ export default Badge;
@@ -0,0 +1,2 @@
1
+ export { default } from '../badge';
2
+ export type { BadgeProps } from '../types';
@@ -0,0 +1 @@
1
+ export type { BadgeProps } from '../types';
@@ -0,0 +1,2 @@
1
+ export { default } from './badge';
2
+ export type { BadgeProps } from './types';
@@ -0,0 +1 @@
1
+ export declare function formatValue(value?: string | number, max?: number): string;
@@ -0,0 +1,29 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ export type ThemeAppearance = 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
3
+ export interface BadgeProps {
4
+ /**
5
+ * Affects the visual style of the badge.
6
+ */
7
+ appearance?: ThemeAppearance;
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/badge",
3
- "version": "15.1.0",
3
+ "version": "15.1.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/"
@@ -12,6 +12,14 @@
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
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.tsx",
17
25
  "atlassian": {
@@ -42,16 +50,16 @@
42
50
  "@atlaskit/ssr": "*",
43
51
  "@atlaskit/theme": "*",
44
52
  "@atlaskit/tokens": "*",
45
- "@atlaskit/visual-regression": "*",
46
53
  "@atlaskit/webdriver-runner": "*",
47
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
55
+ "@atlassian/gemini-visual-regression": "*",
48
56
  "@emotion/react": "^11.7.1",
49
57
  "@testing-library/react": "^12.1.5",
50
58
  "jscodeshift": "^0.13.0",
51
59
  "react-dom": "^16.8.0",
52
60
  "react-test-renderer": "^16.8.0",
53
61
  "storybook-addon-performance": "^0.16.0",
54
- "typescript": "4.5.5"
62
+ "typescript": "~4.9.5"
55
63
  },
56
64
  "techstack": {
57
65
  "@atlassian/frontend": {
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/entry-points/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/entry-points/types.d.ts"
11
+ "../dist/types-ts4.5/entry-points/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }