@atlaskit/progress-bar 0.5.9 → 0.5.11

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/progress-bar
2
2
 
3
+ ## 0.5.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 0.5.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8eb92195540`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8eb92195540) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
14
+ - Updated dependencies
15
+
3
16
  ## 0.5.9
4
17
 
5
18
  ### Patch Changes
@@ -11,7 +11,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
 
14
- var _core = require("@emotion/core");
14
+ var _react2 = require("@emotion/react");
15
15
 
16
16
  var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
17
17
 
@@ -22,7 +22,7 @@ var _theme = require("../theme");
22
22
  /** @jsx jsx */
23
23
  var MIN_VALUE = 0;
24
24
  var MAX_VALUE = 1;
25
- var increasingBarAnimation = (0, _core.keyframes)({
25
+ var increasingBarAnimation = (0, _react2.keyframes)({
26
26
  from: {
27
27
  left: '-5%',
28
28
  width: '5%'
@@ -32,7 +32,7 @@ var increasingBarAnimation = (0, _core.keyframes)({
32
32
  width: ' 100%'
33
33
  }
34
34
  });
35
- var decreasingBarAnimation = (0, _core.keyframes)({
35
+ var decreasingBarAnimation = (0, _react2.keyframes)({
36
36
  from: {
37
37
  left: '-80%',
38
38
  width: '80%'
@@ -42,7 +42,7 @@ var decreasingBarAnimation = (0, _core.keyframes)({
42
42
  width: '10%'
43
43
  }
44
44
  });
45
- var containerStyles = (0, _core.css)({
45
+ var containerStyles = (0, _react2.css)({
46
46
  width: "100%",
47
47
  height: 6,
48
48
  position: 'relative',
@@ -51,40 +51,40 @@ var containerStyles = (0, _core.css)({
51
51
  overflow: 'hidden'
52
52
  });
53
53
  var containerAppearance = {
54
- default: (0, _core.css)({
54
+ default: (0, _react2.css)({
55
55
  background: "var(--ds-background-neutral, ".concat(_colors.N40A, ")")
56
56
  }),
57
- success: (0, _core.css)({
57
+ success: (0, _react2.css)({
58
58
  background: "var(--ds-background-neutral, ".concat(_colors.N40A, ")")
59
59
  }),
60
- inverse: (0, _core.css)({
60
+ inverse: (0, _react2.css)({
61
61
  background: "var(--ds-background-inverse-subtle, rgba(255, 255, 255, 0.5))"
62
62
  })
63
63
  };
64
64
  var barAppearance = {
65
- default: (0, _core.css)({
65
+ default: (0, _react2.css)({
66
66
  background: "var(--ds-background-neutral-bold, ".concat(_colors.N500, ")")
67
67
  }),
68
- success: (0, _core.css)({
68
+ success: (0, _react2.css)({
69
69
  background: "var(--ds-background-success-bold, ".concat(_colors.G300, ")")
70
70
  }),
71
- inverse: (0, _core.css)({
71
+ inverse: (0, _react2.css)({
72
72
  background: "var(--ds-surface, white)"
73
73
  })
74
74
  };
75
- var barStyles = (0, _core.css)({
75
+ var barStyles = (0, _react2.css)({
76
76
  display: 'block',
77
77
  height: 6,
78
78
  position: 'absolute',
79
79
  borderRadius: 3
80
80
  });
81
- var determinateBarStyles = (0, _core.css)({
81
+ var determinateBarStyles = (0, _react2.css)({
82
82
  transition: 'width 0.2s'
83
83
  });
84
- var increasingBarStyles = (0, _core.css)({
84
+ var increasingBarStyles = (0, _react2.css)({
85
85
  animation: "".concat(increasingBarAnimation, " 2s infinite")
86
86
  });
87
- var decreasingBarStyles = (0, _core.css)({
87
+ var decreasingBarStyles = (0, _react2.css)({
88
88
  animation: "".concat(decreasingBarAnimation, " 2s 0.5s infinite")
89
89
  });
90
90
  /**
@@ -110,12 +110,12 @@ var ProgressBar = function ProgressBar(_ref) {
110
110
  value = _ref$value === void 0 ? 0 : _ref$value;
111
111
  var valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE));
112
112
  (0, _deprecationWarning.propDeprecationWarning)("@atlaskit/progress-bar", 'theme', (0, _typeof2.default)(theme) !== undefined, 'https://community.developer.atlassian.com/t/theme-prop-in-atlaskit-progress-bar-is-being-deprecated/56198');
113
- return (0, _core.jsx)(_theme.Theme.Provider, {
113
+ return (0, _react2.jsx)(_theme.Theme.Provider, {
114
114
  value: theme
115
- }, (0, _core.jsx)(_theme.Theme.Consumer, {
115
+ }, (0, _react2.jsx)(_theme.Theme.Consumer, {
116
116
  value: value
117
117
  }, function (tokens) {
118
- return (0, _core.jsx)("div", {
118
+ return (0, _react2.jsx)("div", {
119
119
  css: [containerStyles, containerAppearance[appearance], tokens.container],
120
120
  role: "progressbar",
121
121
  "aria-label": ariaLabel,
@@ -124,11 +124,11 @@ var ProgressBar = function ProgressBar(_ref) {
124
124
  "aria-valuemax": MAX_VALUE,
125
125
  tabIndex: 0,
126
126
  "data-testid": testId
127
- }, isIndeterminate ? (0, _core.jsx)(_react.default.Fragment, null, (0, _core.jsx)("span", {
127
+ }, isIndeterminate ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
128
128
  css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar]
129
- }), (0, _core.jsx)("span", {
129
+ }), (0, _react2.jsx)("span", {
130
130
  css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar]
131
- })) : (0, _core.jsx)("span", {
131
+ })) : (0, _react2.jsx)("span", {
132
132
  style: {
133
133
  width: "".concat(Number(value) * 100, "%")
134
134
  },
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { css, jsx, keyframes } from '@emotion/core';
3
+ import { css, jsx, keyframes } from '@emotion/react';
4
4
  import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
5
5
  import { G300, N40A, N500 } from '@atlaskit/theme/colors';
6
6
  import { Theme } from '../theme';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import React from 'react';
5
- import { css, jsx, keyframes } from '@emotion/core';
5
+ import { css, jsx, keyframes } from '@emotion/react';
6
6
  import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
7
7
  import { G300, N40A, N500 } from '@atlaskit/theme/colors';
8
8
  import { Theme } from '../theme';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { DefaultProgressBarProps } from '../types';
3
3
  /**
4
4
  * __Progress bar__
@@ -9,5 +9,5 @@ import { DefaultProgressBarProps } from '../types';
9
9
  * - [Code](https://atlassian.design/components/progress-bar/code)
10
10
  * - [Usage](https://atlassian.design/components/progress-bar/usage)
11
11
  */
12
- declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => JSX.Element;
12
+ declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => jsx.JSX.Element;
13
13
  export default ProgressBar;
@@ -0,0 +1,13 @@
1
+ import { jsx } from '@emotion/react';
2
+ import { DefaultProgressBarProps } from '../types';
3
+ /**
4
+ * __Progress bar__
5
+ *
6
+ * A progress bar displays the status of a given process.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/progress-bar/examples)
9
+ * - [Code](https://atlassian.design/components/progress-bar/code)
10
+ * - [Usage](https://atlassian.design/components/progress-bar/usage)
11
+ */
12
+ declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => jsx.JSX.Element;
13
+ export default ProgressBar;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { CustomProgressBarProps } from '../types';
3
+ /**
4
+ * __Success progress bar__
5
+ *
6
+ * A success progress bar indicates the completion of a process.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/progress-bar/success-progress-bar/examples)
9
+ * - [Code](https://atlassian.design/components/progress-bar/success-progress-bar/code)
10
+ */
11
+ declare const SuccessProgressBar: ({ ariaLabel, isIndeterminate, testId, value, }: CustomProgressBarProps) => JSX.Element;
12
+ export default SuccessProgressBar;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { CustomProgressBarProps } from '../types';
3
+ /**
4
+ * __Transparent progress bar__
5
+ *
6
+ * A transparent progress bar is used on bold backgrounds to maintain suitable contrast.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/progress-bar/transparent-progress-bar/examples)
9
+ * - [Code](https://atlassian.design/components/progress-bar/transparent-progress-bar/code)
10
+ */
11
+ declare const TransparentProgressBar: ({ ariaLabel, isIndeterminate, testId, value, }: CustomProgressBarProps) => JSX.Element;
12
+ export default TransparentProgressBar;
@@ -0,0 +1,3 @@
1
+ export { default } from './components/progress-bar';
2
+ export { default as SuccessProgressBar } from './components/success-progress-bar';
3
+ export { default as TransparentProgressBar } from './components/transparent-progress-bar';
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { ThemeProps, ThemeTokens } from './types';
3
+ /**
4
+ * Creates the default theme, which can be customised using the `theme` prop
5
+ *
6
+ * @deprecated
7
+ */
8
+ export declare const Theme: {
9
+ Consumer: import("react").ComponentType<{
10
+ children: (tokens: ThemeTokens) => import("react").ReactNode;
11
+ } & ThemeProps>;
12
+ Provider: import("react").ComponentType<{
13
+ children?: import("react").ReactNode;
14
+ value?: import("@atlaskit/theme/components").ThemeProp<ThemeTokens, ThemeProps> | undefined;
15
+ }>;
16
+ useTheme: (props: ThemeProps) => ThemeTokens;
17
+ };
@@ -0,0 +1,49 @@
1
+ import { ThemeProp } from '@atlaskit/theme/components';
2
+ /**
3
+ * @deprecated
4
+ */
5
+ export declare type ThemeProps = {
6
+ value: string | number;
7
+ };
8
+ /**
9
+ * @deprecated This allows for users to customize the theme. This is being deprecated, please consider
10
+ * migrating to one of progress bar's variants.
11
+ */
12
+ export declare type ThemeTokens = {
13
+ container: any;
14
+ bar: any;
15
+ determinateBar: any;
16
+ increasingBar: any;
17
+ decreasingBar: any;
18
+ };
19
+ export interface CustomProgressBarProps {
20
+ /**
21
+ * Sets the value of the progress bar, between `0` and `1` inclusive.
22
+ */
23
+ value?: number;
24
+ /**
25
+ * Shows the progress bar in an indeterminate state when `true`.
26
+ */
27
+ isIndeterminate?: boolean;
28
+ /**
29
+ * Label associated with the progress bar,
30
+ * read by screen readers.
31
+ */
32
+ ariaLabel?: string;
33
+ /**
34
+ * A `testId` prop is a unique string that appears as a data attribute `data-testid` in the rendered code,
35
+ * serving as a hook for automated tests.
36
+ */
37
+ testId?: string;
38
+ }
39
+ export interface DefaultProgressBarProps extends CustomProgressBarProps {
40
+ /**
41
+ * @deprecated
42
+ * Theme prop is deprecated and will be removed in the future.
43
+ */
44
+ theme?: ThemeProp<ThemeTokens, ThemeProps>;
45
+ /**
46
+ * Visual style of the progress bar.
47
+ */
48
+ appearance?: 'default' | 'success' | 'inverse';
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "description": "A progress bar displays the status of a given process.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
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.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "homepage": "https://atlassian.design/components/progress-bar/",
@@ -26,10 +33,10 @@
26
33
  },
27
34
  "dependencies": {
28
35
  "@atlaskit/ds-lib": "^2.1.0",
29
- "@atlaskit/theme": "^12.1.0",
36
+ "@atlaskit/theme": "^12.2.0",
30
37
  "@atlaskit/tokens": "^0.10.0",
31
38
  "@babel/runtime": "^7.0.0",
32
- "@emotion/core": "^10.0.9"
39
+ "@emotion/react": "^11.7.1"
33
40
  },
34
41
  "peerDependencies": {
35
42
  "react": "^16.8.0"
@@ -37,12 +44,12 @@
37
44
  "devDependencies": {
38
45
  "@atlaskit/button": "^16.3.0",
39
46
  "@atlaskit/docs": "*",
40
- "@atlaskit/section-message": "^6.0.0",
47
+ "@atlaskit/section-message": "^6.2.0",
41
48
  "@atlaskit/visual-regression": "*",
42
49
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
43
- "@testing-library/react": "^8.0.1",
50
+ "@testing-library/react": "^12.1.5",
44
51
  "react-dom": "^16.8.0",
45
- "typescript": "4.3.5"
52
+ "typescript": "4.5.5"
46
53
  },
47
54
  "keywords": [
48
55
  "atlaskit",
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/theme.js",
5
5
  "module:es2019": "../dist/es2019/theme.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/theme.d.ts"
7
+ "types": "../dist/types/theme.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/theme.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }