@atlaskit/progress-bar 0.5.7 → 0.5.8

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.
@@ -1,60 +1,28 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
-
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
-
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
-
17
1
  import React from 'react';
18
- import deprecationWarning from '@atlaskit/ds-lib/deprecation-warning';
19
2
  import ProgressBar from './progress-bar';
20
-
21
- var TransparentProgressBar = /*#__PURE__*/function (_React$PureComponent) {
22
- _inherits(TransparentProgressBar, _React$PureComponent);
23
-
24
- var _super = _createSuper(TransparentProgressBar);
25
-
26
- function TransparentProgressBar() {
27
- _classCallCheck(this, TransparentProgressBar);
28
-
29
- return _super.apply(this, arguments);
30
- }
31
-
32
- _createClass(TransparentProgressBar, [{
33
- key: "render",
34
- value: function render() {
35
- deprecationWarning('@atlaskit/progress-bar', '`theme` prop', 'If you depend on `theme`, we recommend migrating to one of its variants.');
36
- return /*#__PURE__*/React.createElement(ProgressBar, _extends({}, this.props, {
37
- theme: function theme(currentTheme, props) {
38
- var theme = currentTheme(props);
39
- return _objectSpread(_objectSpread({}, theme), {}, {
40
- container: _objectSpread(_objectSpread({}, theme.container), {}, {
41
- background: "var(--ds-background-inverse-subtle, rgba(255, 255, 255, 0.5))"
42
- }),
43
- bar: _objectSpread(_objectSpread({}, theme.bar), {}, {
44
- background: "var(--ds-surface, white)"
45
- })
46
- });
47
- }
48
- }));
49
- }
50
- }]);
51
-
52
- return TransparentProgressBar;
53
- }(React.PureComponent);
54
-
55
- _defineProperty(TransparentProgressBar, "defaultProps", {
56
- value: 0,
57
- isIndeterminate: false
58
- });
59
-
60
- export { TransparentProgressBar as default };
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
+
12
+ var TransparentProgressBar = function TransparentProgressBar(_ref) {
13
+ var ariaLabel = _ref.ariaLabel,
14
+ _ref$isIndeterminate = _ref.isIndeterminate,
15
+ isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate,
16
+ testId = _ref.testId,
17
+ _ref$value = _ref.value,
18
+ value = _ref$value === void 0 ? 0 : _ref$value;
19
+ return /*#__PURE__*/React.createElement(ProgressBar, {
20
+ appearance: "inverse",
21
+ value: value,
22
+ isIndeterminate: isIndeterminate,
23
+ ariaLabel: ariaLabel,
24
+ testId: testId
25
+ });
26
+ };
27
+
28
+ export default TransparentProgressBar;
package/dist/esm/theme.js CHANGED
@@ -1,42 +1,16 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject, _templateObject2;
4
-
5
- import { keyframes } from '@emotion/core';
6
- import { N40A, N500 } from '@atlaskit/theme/colors';
7
1
  import { createTheme } from '@atlaskit/theme/components';
8
- var increasingBarAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from { left: -5%; width: 5%; }\n to { left: 130%; width: 100%;}\n"])));
9
- var decreasingBarAnimation = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n from { left: -80%; width: 80%; }\n to { left: 110%; width: 10%;}\n"])));
2
+
10
3
  /**
11
- * @deprecated creates the default theme, which can be customised using the `theme` prop
4
+ * Creates the default theme, which can be customised using the `theme` prop
5
+ *
6
+ * @deprecated
12
7
  */
13
-
14
8
  export var Theme = createTheme(function (props) {
15
9
  return {
16
- container: {
17
- background: "var(--ds-background-neutral, ".concat(N40A, ")"),
18
- borderRadius: 3,
19
- height: 6,
20
- overflow: 'hidden',
21
- position: 'relative',
22
- width: "100%"
23
- },
24
- bar: {
25
- borderRadius: 3,
26
- display: 'block',
27
- height: 6,
28
- position: 'absolute',
29
- background: "var(--ds-background-neutral-bold, ".concat(N500, ")")
30
- },
31
- determinateBar: {
32
- transition: 'width 0.2s',
33
- width: "".concat(Number(props.value) * 100, "%")
34
- },
35
- increasingBar: {
36
- animation: "".concat(increasingBarAnimation, " 2s infinite")
37
- },
38
- decreasingBar: {
39
- animation: "".concat(decreasingBarAnimation, " 2s 0.5s infinite")
40
- }
10
+ container: {},
11
+ bar: {},
12
+ determinateBar: {},
13
+ increasingBar: {},
14
+ decreasingBar: {}
41
15
  };
42
16
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,13 @@
1
- /** @jsx jsx */
2
- import React from 'react';
1
+ /// <reference types="react" />
3
2
  import { DefaultProgressBarProps } from '../types';
4
- export default class ProgressBar extends React.PureComponent<DefaultProgressBarProps> {
5
- static defaultProps: {
6
- value: number;
7
- isIndeterminate: boolean;
8
- };
9
- render(): JSX.Element;
10
- }
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.Element;
13
+ export default ProgressBar;
@@ -1,9 +1,12 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { CustomProgressBarProps } from '../types';
3
- export default class SuccessProgressBar extends React.PureComponent<CustomProgressBarProps> {
4
- static defaultProps: {
5
- value: number;
6
- isIndeterminate: boolean;
7
- };
8
- render(): JSX.Element;
9
- }
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;
@@ -1,9 +1,12 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { CustomProgressBarProps } from '../types';
3
- export default class TransparentProgressBar extends React.PureComponent<CustomProgressBarProps> {
4
- static defaultProps: {
5
- value: number;
6
- isIndeterminate: boolean;
7
- };
8
- render(): JSX.Element;
9
- }
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;
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ThemeProps, ThemeTokens } from './types';
3
3
  /**
4
- * @deprecated creates the default theme, which can be customised using the `theme` prop
4
+ * Creates the default theme, which can be customised using the `theme` prop
5
+ *
6
+ * @deprecated
5
7
  */
6
8
  export declare const Theme: {
7
9
  Consumer: import("react").ComponentType<{
@@ -1,4 +1,7 @@
1
1
  import { ThemeProp } from '@atlaskit/theme/components';
2
+ /**
3
+ * @deprecated
4
+ */
2
5
  export declare type ThemeProps = {
3
6
  value: string | number;
4
7
  };
@@ -15,22 +18,32 @@ export declare type ThemeTokens = {
15
18
  };
16
19
  export interface CustomProgressBarProps {
17
20
  /**
18
- * Current progress, a number between 0 and 1.
21
+ * Sets the value of the progress bar, between `0` and `1` inclusive.
19
22
  */
20
- value: number;
23
+ value?: number;
21
24
  /**
22
- * When true the component is in indeterminate state.
25
+ * Shows the progress bar in an indeterminate state when `true`.
23
26
  */
24
- isIndeterminate: boolean;
27
+ isIndeterminate?: boolean;
25
28
  /**
26
- * The aria-label attribute associated with the progress bar.
29
+ * Label associated with the progress bar,
30
+ * read by screen readers.
27
31
  */
28
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;
29
38
  }
30
39
  export interface DefaultProgressBarProps extends CustomProgressBarProps {
31
40
  /**
32
- * The theme the component should use. NOTE: This is being deprecated and will be removed after 13 May 2022. Please consider migrating to
33
- * one of progress bar's variants.
41
+ * @deprecated
42
+ * Theme prop is deprecated and will be removed in the future.
34
43
  */
35
44
  theme?: ThemeProp<ThemeTokens, ThemeProps>;
45
+ /**
46
+ * Visual style of the progress bar.
47
+ */
48
+ appearance?: 'default' | 'success' | 'inverse';
36
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-bar",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "A progress bar displays the status of a given process.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@atlaskit/ds-lib": "^2.0.0",
28
+ "@atlaskit/ds-lib": "^2.1.0",
29
29
  "@atlaskit/theme": "^12.1.0",
30
30
  "@atlaskit/tokens": "^0.10.0",
31
31
  "@babel/runtime": "^7.0.0",
@@ -38,6 +38,7 @@
38
38
  "@atlaskit/button": "^16.3.0",
39
39
  "@atlaskit/docs": "*",
40
40
  "@atlaskit/section-message": "^6.0.0",
41
+ "@atlaskit/visual-regression": "*",
41
42
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
42
43
  "@testing-library/react": "^8.0.1",
43
44
  "react-dom": "^16.8.0",
@@ -54,9 +55,11 @@
54
55
  },
55
56
  "@repo/internal": {
56
57
  "dom-events": "use-bind-event-listener",
58
+ "design-system": "v1",
57
59
  "theming": "tokens",
58
60
  "deprecation": "no-deprecated-imports",
59
61
  "styling": [
62
+ "static",
60
63
  "emotion"
61
64
  ]
62
65
  }
package/report.api.md ADDED
@@ -0,0 +1,80 @@
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
+ import { default as React_2 } from 'react';
7
+ import { ThemeProp } from '@atlaskit/theme/components';
8
+
9
+ declare interface CustomProgressBarProps {
10
+ /**
11
+ * Current progress, a number between 0 and 1.
12
+ */
13
+ value: number;
14
+ /**
15
+ * When true the component is in indeterminate state.
16
+ */
17
+ isIndeterminate: boolean;
18
+ /**
19
+ * The aria-label attribute associated with the progress bar.
20
+ */
21
+ ariaLabel?: string;
22
+ }
23
+
24
+ declare interface DefaultProgressBarProps extends CustomProgressBarProps {
25
+ /**
26
+ * The theme the component should use. NOTE: This is being deprecated and will be removed after 13 May 2022. Please consider migrating to
27
+ * one of progress bar's variants.
28
+ */
29
+ theme?: ThemeProp<ThemeTokens, ThemeProps>;
30
+ }
31
+
32
+ declare class ProgressBar extends React_2.PureComponent<
33
+ DefaultProgressBarProps
34
+ > {
35
+ static defaultProps: {
36
+ value: number;
37
+ isIndeterminate: boolean;
38
+ };
39
+ render(): JSX.Element;
40
+ }
41
+ export default ProgressBar;
42
+
43
+ export declare class SuccessProgressBar extends React_2.PureComponent<
44
+ CustomProgressBarProps
45
+ > {
46
+ static defaultProps: {
47
+ value: number;
48
+ isIndeterminate: boolean;
49
+ };
50
+ render(): JSX.Element;
51
+ }
52
+
53
+ declare type ThemeProps = {
54
+ value: string | number;
55
+ };
56
+
57
+ /**
58
+ * @deprecated This allows for users to customize the theme. This is being deprecated, please consider
59
+ * migrating to one of progress bar's variants.
60
+ */
61
+ declare type ThemeTokens = {
62
+ container: any;
63
+ bar: any;
64
+ determinateBar: any;
65
+ increasingBar: any;
66
+ decreasingBar: any;
67
+ };
68
+
69
+ export declare class TransparentProgressBar extends React_2.PureComponent<
70
+ CustomProgressBarProps
71
+ > {
72
+ static defaultProps: {
73
+ value: number;
74
+ isIndeterminate: boolean;
75
+ };
76
+ render(): JSX.Element;
77
+ }
78
+
79
+ export {};
80
+ ```