@atlaskit/progress-bar 1.0.2 → 2.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,17 @@
1
1
  # @atlaskit/progress-bar
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#69022](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69022) [`395c74147990`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/395c74147990) - Migrate packages to use declarative entry points
8
+
9
+ ## 2.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#52318](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/52318) [`71ad9704d42f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/71ad9704d42f) - Removed all remaining legacy theming logic from the ProgressBar component.
14
+
3
15
  ## 1.0.2
4
16
 
5
17
  ### Patch Changes
@@ -5,12 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _react2 = require("@emotion/react");
11
- var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
12
10
  var _colors = require("@atlaskit/theme/colors");
13
- var _theme = require("../theme");
14
11
  /** @jsx jsx */
15
12
 
16
13
  var MIN_VALUE = 0;
@@ -98,35 +95,27 @@ var ProgressBar = function ProgressBar(_ref) {
98
95
  isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate,
99
96
  _ref$testId = _ref.testId,
100
97
  testId = _ref$testId === void 0 ? 'progress-bar' : _ref$testId,
101
- theme = _ref.theme,
102
98
  _ref$value = _ref.value,
103
99
  value = _ref$value === void 0 ? 0 : _ref$value;
104
100
  var valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE));
105
- (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');
106
- return (0, _react2.jsx)(_theme.Theme.Provider, {
107
- value: theme
108
- }, (0, _react2.jsx)(_theme.Theme.Consumer, {
109
- value: value
110
- }, function (tokens) {
111
- return (0, _react2.jsx)("div", {
112
- css: [containerStyles, containerAppearance[appearance], tokens.container],
113
- role: "progressbar",
114
- "aria-label": ariaLabel,
115
- "aria-valuemin": MIN_VALUE,
116
- "aria-valuenow": valueParsed,
117
- "aria-valuemax": MAX_VALUE,
118
- tabIndex: 0,
119
- "data-testid": testId
120
- }, isIndeterminate ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
121
- css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar]
122
- }), (0, _react2.jsx)("span", {
123
- css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar]
124
- })) : (0, _react2.jsx)("span", {
125
- style: {
126
- width: "".concat(Number(value) * 100, "%")
127
- },
128
- css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar]
129
- }));
101
+ return (0, _react2.jsx)("div", {
102
+ css: [containerStyles, containerAppearance[appearance]],
103
+ role: "progressbar",
104
+ "aria-label": ariaLabel,
105
+ "aria-valuemin": MIN_VALUE,
106
+ "aria-valuenow": valueParsed,
107
+ "aria-valuemax": MAX_VALUE,
108
+ tabIndex: 0,
109
+ "data-testid": testId
110
+ }, isIndeterminate ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
111
+ css: [barStyles, barAppearance[appearance], increasingBarStyles]
112
+ }), (0, _react2.jsx)("span", {
113
+ css: [barStyles, barAppearance[appearance], decreasingBarStyles]
114
+ })) : (0, _react2.jsx)("span", {
115
+ style: {
116
+ width: "".concat(Number(value) * 100, "%")
117
+ },
118
+ css: [barStyles, barAppearance[appearance], determinateBarStyles]
130
119
  }));
131
120
  };
132
121
  var _default = exports.default = ProgressBar;
@@ -1,9 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { css, jsx, keyframes } from '@emotion/react';
4
- import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
5
4
  import { G300, N40A, N500 } from '@atlaskit/theme/colors';
6
- import { Theme } from '../theme';
7
5
  const MIN_VALUE = 0;
8
6
  const MAX_VALUE = 1;
9
7
  const increasingBarAnimation = keyframes({
@@ -86,17 +84,11 @@ const ProgressBar = ({
86
84
  ariaLabel,
87
85
  isIndeterminate = false,
88
86
  testId = 'progress-bar',
89
- theme,
90
87
  value = 0
91
88
  }) => {
92
89
  const valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE));
93
- propDeprecationWarning("@atlaskit/progress-bar" || '', 'theme', typeof theme !== undefined, 'https://community.developer.atlassian.com/t/theme-prop-in-atlaskit-progress-bar-is-being-deprecated/56198');
94
- return jsx(Theme.Provider, {
95
- value: theme
96
- }, jsx(Theme.Consumer, {
97
- value: value
98
- }, tokens => jsx("div", {
99
- css: [containerStyles, containerAppearance[appearance], tokens.container],
90
+ return jsx("div", {
91
+ css: [containerStyles, containerAppearance[appearance]],
100
92
  role: "progressbar",
101
93
  "aria-label": ariaLabel,
102
94
  "aria-valuemin": MIN_VALUE,
@@ -105,14 +97,14 @@ const ProgressBar = ({
105
97
  tabIndex: 0,
106
98
  "data-testid": testId
107
99
  }, isIndeterminate ? jsx(React.Fragment, null, jsx("span", {
108
- css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar]
100
+ css: [barStyles, barAppearance[appearance], increasingBarStyles]
109
101
  }), jsx("span", {
110
- css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar]
102
+ css: [barStyles, barAppearance[appearance], decreasingBarStyles]
111
103
  })) : jsx("span", {
112
104
  style: {
113
105
  width: `${Number(value) * 100}%`
114
106
  },
115
- css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar]
116
- }))));
107
+ css: [barStyles, barAppearance[appearance], determinateBarStyles]
108
+ }));
117
109
  };
118
110
  export default ProgressBar;
@@ -1,10 +1,7 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  /** @jsx jsx */
3
2
  import React from 'react';
4
3
  import { css, jsx, keyframes } from '@emotion/react';
5
- import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
6
4
  import { G300, N40A, N500 } from '@atlaskit/theme/colors';
7
- import { Theme } from '../theme';
8
5
  var MIN_VALUE = 0;
9
6
  var MAX_VALUE = 1;
10
7
  var increasingBarAnimation = keyframes({
@@ -90,35 +87,27 @@ var ProgressBar = function ProgressBar(_ref) {
90
87
  isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate,
91
88
  _ref$testId = _ref.testId,
92
89
  testId = _ref$testId === void 0 ? 'progress-bar' : _ref$testId,
93
- theme = _ref.theme,
94
90
  _ref$value = _ref.value,
95
91
  value = _ref$value === void 0 ? 0 : _ref$value;
96
92
  var valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE));
97
- propDeprecationWarning("@atlaskit/progress-bar" || '', 'theme', _typeof(theme) !== undefined, 'https://community.developer.atlassian.com/t/theme-prop-in-atlaskit-progress-bar-is-being-deprecated/56198');
98
- return jsx(Theme.Provider, {
99
- value: theme
100
- }, jsx(Theme.Consumer, {
101
- value: value
102
- }, function (tokens) {
103
- return jsx("div", {
104
- css: [containerStyles, containerAppearance[appearance], tokens.container],
105
- role: "progressbar",
106
- "aria-label": ariaLabel,
107
- "aria-valuemin": MIN_VALUE,
108
- "aria-valuenow": valueParsed,
109
- "aria-valuemax": MAX_VALUE,
110
- tabIndex: 0,
111
- "data-testid": testId
112
- }, isIndeterminate ? jsx(React.Fragment, null, jsx("span", {
113
- css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar]
114
- }), jsx("span", {
115
- css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar]
116
- })) : jsx("span", {
117
- style: {
118
- width: "".concat(Number(value) * 100, "%")
119
- },
120
- css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar]
121
- }));
93
+ return jsx("div", {
94
+ css: [containerStyles, containerAppearance[appearance]],
95
+ role: "progressbar",
96
+ "aria-label": ariaLabel,
97
+ "aria-valuemin": MIN_VALUE,
98
+ "aria-valuenow": valueParsed,
99
+ "aria-valuemax": MAX_VALUE,
100
+ tabIndex: 0,
101
+ "data-testid": testId
102
+ }, isIndeterminate ? jsx(React.Fragment, null, jsx("span", {
103
+ css: [barStyles, barAppearance[appearance], increasingBarStyles]
104
+ }), jsx("span", {
105
+ css: [barStyles, barAppearance[appearance], decreasingBarStyles]
106
+ })) : jsx("span", {
107
+ style: {
108
+ width: "".concat(Number(value) * 100, "%")
109
+ },
110
+ css: [barStyles, barAppearance[appearance], determinateBarStyles]
122
111
  }));
123
112
  };
124
113
  export default ProgressBar;
@@ -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.JSX.Element;
12
+ declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, value, }: DefaultProgressBarProps) => jsx.JSX.Element;
13
13
  export default ProgressBar;
@@ -1,21 +1,3 @@
1
- import { ThemeProp } from '@atlaskit/theme/components';
2
- /**
3
- * @deprecated
4
- */
5
- export 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 type ThemeTokens = {
13
- container: any;
14
- bar: any;
15
- determinateBar: any;
16
- increasingBar: any;
17
- decreasingBar: any;
18
- };
19
1
  export interface CustomProgressBarProps {
20
2
  /**
21
3
  * Sets the value of the progress bar, between `0` and `1` inclusive.
@@ -37,11 +19,6 @@ export interface CustomProgressBarProps {
37
19
  testId?: string;
38
20
  }
39
21
  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
22
  /**
46
23
  * Visual style of the progress bar.
47
24
  */
@@ -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.JSX.Element;
12
+ declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, value, }: DefaultProgressBarProps) => jsx.JSX.Element;
13
13
  export default ProgressBar;
@@ -1,21 +1,3 @@
1
- import { ThemeProp } from '@atlaskit/theme/components';
2
- /**
3
- * @deprecated
4
- */
5
- export 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 type ThemeTokens = {
13
- container: any;
14
- bar: any;
15
- determinateBar: any;
16
- increasingBar: any;
17
- decreasingBar: any;
18
- };
19
1
  export interface CustomProgressBarProps {
20
2
  /**
21
3
  * Sets the value of the progress bar, between `0` and `1` inclusive.
@@ -37,11 +19,6 @@ export interface CustomProgressBarProps {
37
19
  testId?: string;
38
20
  }
39
21
  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
22
  /**
46
23
  * Visual style of the progress bar.
47
24
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "1.0.2",
3
+ "version": "2.0.1",
4
4
  "description": "A progress bar communicates the status of a system process.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -14,9 +14,12 @@
14
14
  "types": "dist/types/index.d.ts",
15
15
  "sideEffects": false,
16
16
  "atlaskit:src": "src/index.tsx",
17
+ "af:exports": {
18
+ ".": "./src/index.tsx",
19
+ "./types": "./src/types.tsx"
20
+ },
17
21
  "atlassian": {
18
22
  "team": "Design System Team",
19
- "deprecatedAutoEntryPoints": true,
20
23
  "releaseModel": "continuous",
21
24
  "productPushConsumption": [
22
25
  "jira"
@@ -27,9 +30,8 @@
27
30
  }
28
31
  },
29
32
  "dependencies": {
30
- "@atlaskit/ds-lib": "^2.2.0",
31
33
  "@atlaskit/theme": "^12.6.0",
32
- "@atlaskit/tokens": "^1.28.0",
34
+ "@atlaskit/tokens": "^1.34.0",
33
35
  "@babel/runtime": "^7.0.0",
34
36
  "@emotion/react": "^11.7.1"
35
37
  },
@@ -78,4 +80,4 @@
78
80
  },
79
81
  "homepage": "https://atlassian.design/components/progress-bar/",
80
82
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
81
- }
83
+ }
package/dist/cjs/theme.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Theme = void 0;
7
- var _components = require("@atlaskit/theme/components");
8
- /**
9
- * Creates the default theme, which can be customised using the `theme` prop
10
- *
11
- * @deprecated
12
- */
13
- var Theme = exports.Theme = (0, _components.createTheme)(function (props) {
14
- return {
15
- container: {},
16
- bar: {},
17
- determinateBar: {},
18
- increasingBar: {},
19
- decreasingBar: {}
20
- };
21
- });
@@ -1,13 +0,0 @@
1
- import { createTheme } from '@atlaskit/theme/components';
2
- /**
3
- * Creates the default theme, which can be customised using the `theme` prop
4
- *
5
- * @deprecated
6
- */
7
- export const Theme = createTheme(props => ({
8
- container: {},
9
- bar: {},
10
- determinateBar: {},
11
- increasingBar: {},
12
- decreasingBar: {}
13
- }));
package/dist/esm/theme.js DELETED
@@ -1,15 +0,0 @@
1
- import { createTheme } from '@atlaskit/theme/components';
2
- /**
3
- * Creates the default theme, which can be customised using the `theme` prop
4
- *
5
- * @deprecated
6
- */
7
- export var Theme = createTheme(function (props) {
8
- return {
9
- container: {},
10
- bar: {},
11
- determinateBar: {},
12
- increasingBar: {},
13
- decreasingBar: {}
14
- };
15
- });
@@ -1,17 +0,0 @@
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
- };
@@ -1,17 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
1
- {
2
- "name": "@atlaskit/progress-bar/theme",
3
- "main": "../dist/cjs/theme.js",
4
- "module": "../dist/esm/theme.js",
5
- "module:es2019": "../dist/es2019/theme.js",
6
- "sideEffects": false,
7
- "types": "../dist/types/theme.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <4.9": {
10
- "*": [
11
- "../dist/types-ts4.5/theme.d.ts"
12
- ]
13
- }
14
- }
15
- }
@@ -1,53 +0,0 @@
1
- ## API Report File for "@atlaskit/progress-bar"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import { jsx } from '@emotion/react';
10
- import { ThemeProp } from '@atlaskit/theme/components';
11
-
12
- // @public (undocumented)
13
- interface CustomProgressBarProps {
14
- ariaLabel?: string;
15
- isIndeterminate?: boolean;
16
- testId?: string;
17
- value?: number;
18
- }
19
-
20
- // @public (undocumented)
21
- interface DefaultProgressBarProps extends CustomProgressBarProps {
22
- appearance?: 'default' | 'inverse' | 'success';
23
- // @deprecated (undocumented)
24
- theme?: ThemeProp<ThemeTokens, ThemeProps>;
25
- }
26
-
27
- // @public
28
- const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => jsx.JSX.Element;
29
- export default ProgressBar;
30
-
31
- // @public
32
- export const SuccessProgressBar: ({ ariaLabel, isIndeterminate, testId, value, }: CustomProgressBarProps) => JSX.Element;
33
-
34
- // @public @deprecated (undocumented)
35
- type ThemeProps = {
36
- value: number | string;
37
- };
38
-
39
- // @public @deprecated (undocumented)
40
- type ThemeTokens = {
41
- container: any;
42
- bar: any;
43
- determinateBar: any;
44
- increasingBar: any;
45
- decreasingBar: any;
46
- };
47
-
48
- // @public
49
- export const TransparentProgressBar: ({ ariaLabel, isIndeterminate, testId, value, }: CustomProgressBarProps) => JSX.Element;
50
-
51
- // (No @packageDocumentation comment for this package)
52
-
53
- ```