@atlaskit/progress-bar
Advanced tools
Comparing version
# @atlaskit/progress-bar | ||
## 2.0.0 | ||
### Major Changes | ||
- [#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. | ||
## 1.0.2 | ||
@@ -4,0 +10,0 @@ |
@@ -8,8 +8,5 @@ "use strict"; | ||
exports.default = void 0; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = require("@emotion/react"); | ||
var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning"); | ||
var _colors = require("@atlaskit/theme/colors"); | ||
var _theme = require("../theme"); | ||
/** @jsx jsx */ | ||
@@ -102,33 +99,25 @@ | ||
testId = _ref$testId === void 0 ? 'progress-bar' : _ref$testId, | ||
theme = _ref.theme, | ||
_ref$value = _ref.value, | ||
value = _ref$value === void 0 ? 0 : _ref$value; | ||
var valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE)); | ||
(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'); | ||
return (0, _react2.jsx)(_theme.Theme.Provider, { | ||
value: theme | ||
}, (0, _react2.jsx)(_theme.Theme.Consumer, { | ||
value: value | ||
}, function (tokens) { | ||
return (0, _react2.jsx)("div", { | ||
css: [containerStyles, containerAppearance[appearance], tokens.container], | ||
role: "progressbar", | ||
"aria-label": ariaLabel, | ||
"aria-valuemin": MIN_VALUE, | ||
"aria-valuenow": valueParsed, | ||
"aria-valuemax": MAX_VALUE, | ||
tabIndex: 0, | ||
"data-testid": testId | ||
}, isIndeterminate ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", { | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar] | ||
}), (0, _react2.jsx)("span", { | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar] | ||
})) : (0, _react2.jsx)("span", { | ||
style: { | ||
width: "".concat(Number(value) * 100, "%") | ||
}, | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar] | ||
})); | ||
return (0, _react2.jsx)("div", { | ||
css: [containerStyles, containerAppearance[appearance]], | ||
role: "progressbar", | ||
"aria-label": ariaLabel, | ||
"aria-valuemin": MIN_VALUE, | ||
"aria-valuenow": valueParsed, | ||
"aria-valuemax": MAX_VALUE, | ||
tabIndex: 0, | ||
"data-testid": testId | ||
}, isIndeterminate ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", { | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles] | ||
}), (0, _react2.jsx)("span", { | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles] | ||
})) : (0, _react2.jsx)("span", { | ||
style: { | ||
width: "".concat(Number(value) * 100, "%") | ||
}, | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles] | ||
})); | ||
}; | ||
var _default = exports.default = ProgressBar; |
/** @jsx jsx */ | ||
import React from 'react'; | ||
import { css, jsx, keyframes } from '@emotion/react'; | ||
import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning'; | ||
import { G300, N40A, N500 } from '@atlaskit/theme/colors'; | ||
import { Theme } from '../theme'; | ||
const MIN_VALUE = 0; | ||
@@ -89,13 +87,7 @@ const MAX_VALUE = 1; | ||
testId = 'progress-bar', | ||
theme, | ||
value = 0 | ||
}) => { | ||
const valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE)); | ||
propDeprecationWarning("@atlaskit/progress-bar" || '', 'theme', typeof theme !== undefined, 'https://community.developer.atlassian.com/t/theme-prop-in-atlaskit-progress-bar-is-being-deprecated/56198'); | ||
return jsx(Theme.Provider, { | ||
value: theme | ||
}, jsx(Theme.Consumer, { | ||
value: value | ||
}, tokens => jsx("div", { | ||
css: [containerStyles, containerAppearance[appearance], tokens.container], | ||
return jsx("div", { | ||
css: [containerStyles, containerAppearance[appearance]], | ||
role: "progressbar", | ||
@@ -109,5 +101,5 @@ "aria-label": ariaLabel, | ||
}, isIndeterminate ? jsx(React.Fragment, null, jsx("span", { | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar] | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles] | ||
}), jsx("span", { | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar] | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles] | ||
})) : jsx("span", { | ||
@@ -117,5 +109,5 @@ style: { | ||
}, | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar] | ||
})))); | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles] | ||
})); | ||
}; | ||
export default ProgressBar; |
@@ -1,8 +0,5 @@ | ||
import _typeof from "@babel/runtime/helpers/typeof"; | ||
/** @jsx jsx */ | ||
import React from 'react'; | ||
import { css, jsx, keyframes } from '@emotion/react'; | ||
import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning'; | ||
import { G300, N40A, N500 } from '@atlaskit/theme/colors'; | ||
import { Theme } from '../theme'; | ||
var MIN_VALUE = 0; | ||
@@ -93,33 +90,25 @@ var MAX_VALUE = 1; | ||
testId = _ref$testId === void 0 ? 'progress-bar' : _ref$testId, | ||
theme = _ref.theme, | ||
_ref$value = _ref.value, | ||
value = _ref$value === void 0 ? 0 : _ref$value; | ||
var valueParsed = isIndeterminate ? MIN_VALUE : Math.max(MIN_VALUE, Math.min(value, MAX_VALUE)); | ||
propDeprecationWarning("@atlaskit/progress-bar" || '', 'theme', _typeof(theme) !== undefined, 'https://community.developer.atlassian.com/t/theme-prop-in-atlaskit-progress-bar-is-being-deprecated/56198'); | ||
return jsx(Theme.Provider, { | ||
value: theme | ||
}, jsx(Theme.Consumer, { | ||
value: value | ||
}, function (tokens) { | ||
return jsx("div", { | ||
css: [containerStyles, containerAppearance[appearance], tokens.container], | ||
role: "progressbar", | ||
"aria-label": ariaLabel, | ||
"aria-valuemin": MIN_VALUE, | ||
"aria-valuenow": valueParsed, | ||
"aria-valuemax": MAX_VALUE, | ||
tabIndex: 0, | ||
"data-testid": testId | ||
}, isIndeterminate ? jsx(React.Fragment, null, jsx("span", { | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles, tokens.bar, tokens.increasingBar] | ||
}), jsx("span", { | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles, tokens.bar, tokens.decreasingBar] | ||
})) : jsx("span", { | ||
style: { | ||
width: "".concat(Number(value) * 100, "%") | ||
}, | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles, tokens.bar, tokens.determinateBar] | ||
})); | ||
return jsx("div", { | ||
css: [containerStyles, containerAppearance[appearance]], | ||
role: "progressbar", | ||
"aria-label": ariaLabel, | ||
"aria-valuemin": MIN_VALUE, | ||
"aria-valuenow": valueParsed, | ||
"aria-valuemax": MAX_VALUE, | ||
tabIndex: 0, | ||
"data-testid": testId | ||
}, isIndeterminate ? jsx(React.Fragment, null, jsx("span", { | ||
css: [barStyles, barAppearance[appearance], increasingBarStyles] | ||
}), jsx("span", { | ||
css: [barStyles, barAppearance[appearance], decreasingBarStyles] | ||
})) : jsx("span", { | ||
style: { | ||
width: "".concat(Number(value) * 100, "%") | ||
}, | ||
css: [barStyles, barAppearance[appearance], determinateBarStyles] | ||
})); | ||
}; | ||
export default ProgressBar; |
@@ -12,3 +12,3 @@ import { jsx } from '@emotion/react'; | ||
*/ | ||
declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => jsx.JSX.Element; | ||
declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, value, }: DefaultProgressBarProps) => jsx.JSX.Element; | ||
export default ProgressBar; |
@@ -1,19 +0,1 @@ | ||
import { ThemeProp } from '@atlaskit/theme/components'; | ||
/** | ||
* @deprecated | ||
*/ | ||
export type ThemeProps = { | ||
value: string | number; | ||
}; | ||
/** | ||
* @deprecated This allows for users to customize the theme. This is being deprecated, please consider | ||
* migrating to one of progress bar's variants. | ||
*/ | ||
export type ThemeTokens = { | ||
container: any; | ||
bar: any; | ||
determinateBar: any; | ||
increasingBar: any; | ||
decreasingBar: any; | ||
}; | ||
export interface CustomProgressBarProps { | ||
@@ -41,7 +23,2 @@ /** | ||
/** | ||
* @deprecated | ||
* Theme prop is deprecated and will be removed in the future. | ||
*/ | ||
theme?: ThemeProp<ThemeTokens, ThemeProps>; | ||
/** | ||
* Visual style of the progress bar. | ||
@@ -48,0 +25,0 @@ */ |
@@ -12,3 +12,3 @@ import { jsx } from '@emotion/react'; | ||
*/ | ||
declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, theme, value, }: DefaultProgressBarProps) => jsx.JSX.Element; | ||
declare const ProgressBar: ({ appearance, ariaLabel, isIndeterminate, testId, value, }: DefaultProgressBarProps) => jsx.JSX.Element; | ||
export default ProgressBar; |
@@ -1,19 +0,1 @@ | ||
import { ThemeProp } from '@atlaskit/theme/components'; | ||
/** | ||
* @deprecated | ||
*/ | ||
export type ThemeProps = { | ||
value: string | number; | ||
}; | ||
/** | ||
* @deprecated This allows for users to customize the theme. This is being deprecated, please consider | ||
* migrating to one of progress bar's variants. | ||
*/ | ||
export type ThemeTokens = { | ||
container: any; | ||
bar: any; | ||
determinateBar: any; | ||
increasingBar: any; | ||
decreasingBar: any; | ||
}; | ||
export interface CustomProgressBarProps { | ||
@@ -41,7 +23,2 @@ /** | ||
/** | ||
* @deprecated | ||
* Theme prop is deprecated and will be removed in the future. | ||
*/ | ||
theme?: ThemeProp<ThemeTokens, ThemeProps>; | ||
/** | ||
* Visual style of the progress bar. | ||
@@ -48,0 +25,0 @@ */ |
{ | ||
"name": "@atlaskit/progress-bar", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"description": "A progress bar communicates the status of a system process.", | ||
@@ -30,5 +30,4 @@ "publishConfig": { | ||
"dependencies": { | ||
"@atlaskit/ds-lib": "^2.2.0", | ||
"@atlaskit/theme": "^12.6.0", | ||
"@atlaskit/tokens": "^1.28.0", | ||
"@atlaskit/tokens": "^1.29.0", | ||
"@babel/runtime": "^7.0.0", | ||
@@ -35,0 +34,0 @@ "@emotion/react": "^11.7.1" |
5
-16.67%40202
-14.89%34
-17.07%669
-22.57%- Removed
Updated