@synerise/ds-progress-bar 1.0.4 → 1.0.5
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 +11 -0
- package/README.md +1 -0
- package/dist/Multivalue/Multivalue.js +2 -2
- package/dist/ProgressBar.d.ts +1 -12
- package/dist/ProgressBar.js +57 -63
- package/dist/ProgressBar.styles.d.ts +1 -1
- package/dist/ProgressBar.styles.js +2 -2
- package/dist/ProgressBar.types.d.ts +13 -3
- package/dist/ProgressTiles/ProgressTiles.d.ts +1 -1
- package/dist/ProgressTiles/ProgressTiles.js +5 -2
- package/dist/ProgressTiles/ProgressTiles.types.d.ts +3 -2
- package/dist/index.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.0.4...@synerise/ds-progress-bar@1.0.5) (2025-04-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **progress-bar:** rename thick to thin ([fa3c6b2](https://github.com/Synerise/synerise-design/commit/fa3c6b21bf8c13445dc21868f56b726451e217f2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.0.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.0.3...@synerise/ds-progress-bar@1.0.4) (2025-04-02)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-progress-bar
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Progress-Bar UI Component
|
|
|
18
18
|
| amount | Number visibile in progress bar label | number | - |
|
|
19
19
|
| description | Text of description under progress bar | string | - |
|
|
20
20
|
| percent | Value of progress bar, also visible in label | number | - |
|
|
21
|
+
| thin | Displays a thinner line | boolean | - |
|
|
21
22
|
| showLabel | Shows label above progress bar, label contains amount and percentage. | boolean | `false` |
|
|
22
23
|
| type | Type of progress bar | `line` / `circle` / `dashboard` | `line` |
|
|
23
24
|
| strokeLine | To set the style of the progress linecap | `round` / `square` | `round` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["values", "stackedBars"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import * as S from './MultiValue.styles';
|
|
6
6
|
var normalizePercent = function normalizePercent(value) {
|
package/dist/ProgressBar.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProgressProps } from './ProgressBar.types';
|
|
3
|
-
declare
|
|
4
|
-
static defaultProps: {
|
|
5
|
-
type: string;
|
|
6
|
-
status: string;
|
|
7
|
-
strokeLinecap: string;
|
|
8
|
-
strokeColor: string;
|
|
9
|
-
showLabel: boolean;
|
|
10
|
-
description: string;
|
|
11
|
-
maxPercent: boolean;
|
|
12
|
-
};
|
|
13
|
-
render(): React.ReactNode;
|
|
14
|
-
}
|
|
3
|
+
declare const ProgressBar: ({ showLabel, description, amount, percent, type, status, strokeColor, strokeLinecap, className, thick, thin, labelFormatter, containerStyles, style, maxPercent, ...rest }: ProgressProps) => React.JSX.Element;
|
|
15
4
|
export default ProgressBar;
|
package/dist/ProgressBar.js
CHANGED
|
@@ -1,68 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
1
|
+
var _excluded = ["showLabel", "description", "amount", "percent", "type", "status", "strokeColor", "strokeLinecap", "className", "thick", "thin", "labelFormatter", "containerStyles", "style", "maxPercent"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
4
|
import React from 'react';
|
|
5
|
+
import { useTheme } from '@synerise/ds-core';
|
|
4
6
|
import * as S from './ProgressBar.styles';
|
|
5
|
-
var ProgressBar =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"data-testid": "progress-bar-container",
|
|
35
|
-
style: containerStyles
|
|
36
|
-
}, showLabel && (labelFormatter ? labelFormatter(amount, percent) : /*#__PURE__*/React.createElement("span", {
|
|
37
|
-
className: "progress-bar-label",
|
|
38
|
-
"data-testid": "progress-bar-label"
|
|
39
|
-
}, /*#__PURE__*/React.createElement(S.MaxValue, {
|
|
40
|
-
"data-testid": "progress-bar-max-value"
|
|
41
|
-
}, amount), /*#__PURE__*/React.createElement("span", {
|
|
42
|
-
"data-testid": "progress-bar-max-percent"
|
|
43
|
-
}, " (" + percent + "%)"))), /*#__PURE__*/React.createElement(S.AntdProgressBar, {
|
|
44
|
-
percent: percent,
|
|
45
|
-
maxPercent: maxBorderWidth(),
|
|
46
|
-
type: type,
|
|
47
|
-
thick: thick,
|
|
48
|
-
status: status,
|
|
49
|
-
strokeColor: strokeColor,
|
|
50
|
-
strokeLinecap: strokeLinecap,
|
|
51
|
-
showInfo: false
|
|
52
|
-
}), description && /*#__PURE__*/React.createElement("span", {
|
|
53
|
-
className: "progress-bar-description",
|
|
54
|
-
"data-testid": "progress-bar-description"
|
|
55
|
-
}, description));
|
|
7
|
+
var ProgressBar = function ProgressBar(_ref) {
|
|
8
|
+
var _ref$showLabel = _ref.showLabel,
|
|
9
|
+
showLabel = _ref$showLabel === void 0 ? false : _ref$showLabel,
|
|
10
|
+
_ref$description = _ref.description,
|
|
11
|
+
description = _ref$description === void 0 ? '' : _ref$description,
|
|
12
|
+
amount = _ref.amount,
|
|
13
|
+
percent = _ref.percent,
|
|
14
|
+
_ref$type = _ref.type,
|
|
15
|
+
type = _ref$type === void 0 ? 'line' : _ref$type,
|
|
16
|
+
_ref$status = _ref.status,
|
|
17
|
+
status = _ref$status === void 0 ? 'normal' : _ref$status,
|
|
18
|
+
strokeColor = _ref.strokeColor,
|
|
19
|
+
_ref$strokeLinecap = _ref.strokeLinecap,
|
|
20
|
+
strokeLinecap = _ref$strokeLinecap === void 0 ? 'round' : _ref$strokeLinecap,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
thick = _ref.thick,
|
|
23
|
+
thin = _ref.thin,
|
|
24
|
+
labelFormatter = _ref.labelFormatter,
|
|
25
|
+
containerStyles = _ref.containerStyles,
|
|
26
|
+
style = _ref.style,
|
|
27
|
+
_ref$maxPercent = _ref.maxPercent,
|
|
28
|
+
maxPercent = _ref$maxPercent === void 0 ? true : _ref$maxPercent,
|
|
29
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
30
|
+
var theme = useTheme();
|
|
31
|
+
var maxBorderWidth = function maxBorderWidth() {
|
|
32
|
+
if (percent === 100) {
|
|
33
|
+
return maxPercent;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
56
36
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
37
|
+
return /*#__PURE__*/React.createElement(S.Container, _extends({
|
|
38
|
+
className: (className || '') + " progress-bar-container",
|
|
39
|
+
"data-testid": "progress-bar-container",
|
|
40
|
+
style: _extends({}, containerStyles, style)
|
|
41
|
+
}, rest), showLabel && (labelFormatter ? labelFormatter(amount, percent) : /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
className: "progress-bar-label",
|
|
43
|
+
"data-testid": "progress-bar-label"
|
|
44
|
+
}, /*#__PURE__*/React.createElement(S.MaxValue, {
|
|
45
|
+
"data-testid": "progress-bar-max-value"
|
|
46
|
+
}, amount), /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
"data-testid": "progress-bar-max-percent"
|
|
48
|
+
}, " (" + percent + "%)"))), /*#__PURE__*/React.createElement(S.AntdProgressBar, {
|
|
49
|
+
percent: percent,
|
|
50
|
+
maxPercent: maxBorderWidth(),
|
|
51
|
+
type: type,
|
|
52
|
+
thin: thin || thick,
|
|
53
|
+
status: status,
|
|
54
|
+
strokeColor: strokeColor || theme.palette['green-500'],
|
|
55
|
+
strokeLinecap: strokeLinecap,
|
|
56
|
+
showInfo: false
|
|
57
|
+
}), description && /*#__PURE__*/React.createElement("span", {
|
|
58
|
+
className: "progress-bar-description",
|
|
59
|
+
"data-testid": "progress-bar-description"
|
|
60
|
+
}, description));
|
|
67
61
|
};
|
|
68
62
|
export default ProgressBar;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const MaxValue: import("styled-components").StyledComponent<"strong", any, {}, never>;
|
|
4
4
|
export declare const AntdProgressBar: import("styled-components").StyledComponent<import("react").FC<import("antd/lib/progress").ProgressProps>, any, {
|
|
5
|
-
|
|
5
|
+
thin?: boolean | undefined;
|
|
6
6
|
maxPercent?: boolean | undefined;
|
|
7
7
|
}, never>;
|
|
@@ -16,9 +16,9 @@ export var AntdProgressBar = styled(Progress).withConfig({
|
|
|
16
16
|
displayName: "ProgressBarstyles__AntdProgressBar",
|
|
17
17
|
componentId: "sc-1gqovic-2"
|
|
18
18
|
})(["&.ant-progress-line{width:100%;height:", ";margin-top:", ";margin:14px 0;border-radius:3px;color:", ";overflow:hidden;box-sizing:content-box;.ant-progress-outer{display:flex;}.ant-progress-inner{width:100%;}.ant-progress-outer,.ant-progress-inner{background:", ";}.ant-progress-outer,.ant-progress-inner,.ant-progress-bg{height:6px !important;}.ant-progress-bg:first-child{border-top-right-radius:0px;border-bottom-right-radius:0px;border-right:", ";}}"], function (props) {
|
|
19
|
-
return props.
|
|
19
|
+
return props.thin ? '3px' : '6px';
|
|
20
20
|
}, function (props) {
|
|
21
|
-
return props.
|
|
21
|
+
return props.thin ? '3px' : '0px';
|
|
22
22
|
}, function (props) {
|
|
23
23
|
return props.theme.palette['grey-200'];
|
|
24
24
|
}, function (props) {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import type { ProgressProps as AntProgressProps } from 'antd/lib/progress/progress';
|
|
3
|
-
|
|
3
|
+
import { ExactlyOne, WithHTMLAttributes } from '@synerise/ds-utils';
|
|
4
|
+
export type ProgressProps = WithHTMLAttributes<HTMLDivElement, Pick<AntProgressProps, 'percent' | 'type' | 'status' | 'strokeColor' | 'strokeLinecap'> & {
|
|
4
5
|
amount?: number;
|
|
5
6
|
showLabel?: boolean;
|
|
6
7
|
description?: ReactNode;
|
|
7
|
-
thick?: boolean;
|
|
8
8
|
labelFormatter?: (amount?: string | number, percent?: string | number) => ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated - use style prop
|
|
11
|
+
*/
|
|
9
12
|
containerStyles?: CSSProperties;
|
|
10
13
|
maxPercent?: boolean;
|
|
11
|
-
}
|
|
14
|
+
} & ExactlyOne<{
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated - this property has been renamed to thin to reflect it's functionality
|
|
17
|
+
*/
|
|
18
|
+
thick?: boolean;
|
|
19
|
+
}, {
|
|
20
|
+
thin?: boolean;
|
|
21
|
+
}>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProgressTilesProps } from './ProgressTiles.types';
|
|
3
|
-
export declare const ProgressTiles: ({ colors, label, tileWidth, percent }: ProgressTilesProps) => React.JSX.Element;
|
|
3
|
+
export declare const ProgressTiles: ({ colors, label, tileWidth, percent, ...rest }: ProgressTilesProps) => React.JSX.Element;
|
|
4
4
|
export default ProgressTiles;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["colors", "label", "tileWidth", "percent"];
|
|
2
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
3
|
import React, { useCallback } from 'react';
|
|
2
4
|
import { Label } from '@synerise/ds-typography';
|
|
3
5
|
import * as S from './ProgressTiles.styles';
|
|
@@ -6,7 +8,8 @@ export var ProgressTiles = function ProgressTiles(_ref) {
|
|
|
6
8
|
var colors = _ref.colors,
|
|
7
9
|
label = _ref.label,
|
|
8
10
|
tileWidth = _ref.tileWidth,
|
|
9
|
-
percent = _ref.percent
|
|
11
|
+
percent = _ref.percent,
|
|
12
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
10
13
|
var getTilesConfig = useCallback(function () {
|
|
11
14
|
var TILES_COUNT = colors.length;
|
|
12
15
|
var tileWidthRatio = MAX_PERCENT / TILES_COUNT;
|
|
@@ -22,7 +25,7 @@ export var ProgressTiles = function ProgressTiles(_ref) {
|
|
|
22
25
|
};
|
|
23
26
|
});
|
|
24
27
|
}, [colors, percent]);
|
|
25
|
-
return /*#__PURE__*/React.createElement(S.TilesWrapper,
|
|
28
|
+
return /*#__PURE__*/React.createElement(S.TilesWrapper, rest, label && /*#__PURE__*/React.createElement(Label, {
|
|
26
29
|
className: "progress-bar-label"
|
|
27
30
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
28
31
|
className: "progress-bar-wrapper"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
|
-
export type ProgressTilesProps = {
|
|
3
|
+
export type ProgressTilesProps = WithHTMLAttributes<HTMLDivElement, {
|
|
3
4
|
tileWidth: string;
|
|
4
5
|
colors: string[];
|
|
5
6
|
percent: number;
|
|
6
7
|
label?: ReactNode;
|
|
7
|
-
}
|
|
8
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ export { default } from './ProgressBar';
|
|
|
2
2
|
export { default as Multivalue } from './Multivalue/Multivalue';
|
|
3
3
|
export { default as ProgressTiles } from './ProgressTiles/ProgressTiles';
|
|
4
4
|
export type { ProgressProps } from './ProgressBar.types';
|
|
5
|
+
export type { MultivalueProps, ProgressValue } from './Multivalue/Multivalue.types';
|
|
6
|
+
export type { ProgressTilesProps } from './ProgressTiles/ProgressTiles.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-progress-bar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Progress-Bar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"react": ">=16.9.0 <= 18.3.1",
|
|
44
44
|
"styled-components": "^5.3.3"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "55537c6449492265a1d50c1e055ef7cc03c7935e"
|
|
47
47
|
}
|