@synerise/ds-progress-bar 1.0.4 → 1.1.0

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
@@ -3,6 +3,28 @@
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.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.0.5...@synerise/ds-progress-bar@1.1.0) (2025-04-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * **form-field:** add form-field component ([7f6b191](https://github.com/Synerise/synerise-design/commit/7f6b191132a3b0d694c21fb4d649f4deea6acb89))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **progress-bar:** rename thick to thin ([fa3c6b2](https://github.com/Synerise/synerise-design/commit/fa3c6b21bf8c13445dc21868f56b726451e217f2))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [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
29
 
8
30
  **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 (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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) {
@@ -1,15 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ProgressProps } from './ProgressBar.types';
3
- declare class ProgressBar extends React.PureComponent<ProgressProps> {
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;
@@ -1,68 +1,62 @@
1
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
2
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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 = /*#__PURE__*/function (_React$PureComponent) {
6
- _inheritsLoose(ProgressBar, _React$PureComponent);
7
- function ProgressBar() {
8
- return _React$PureComponent.apply(this, arguments) || this;
9
- }
10
- var _proto = ProgressBar.prototype;
11
- _proto.render = function render() {
12
- var _this$props = this.props,
13
- showLabel = _this$props.showLabel,
14
- description = _this$props.description,
15
- amount = _this$props.amount,
16
- percent = _this$props.percent,
17
- type = _this$props.type,
18
- status = _this$props.status,
19
- strokeColor = _this$props.strokeColor,
20
- strokeLinecap = _this$props.strokeLinecap,
21
- className = _this$props.className,
22
- thick = _this$props.thick,
23
- labelFormatter = _this$props.labelFormatter,
24
- containerStyles = _this$props.containerStyles,
25
- maxPercent = _this$props.maxPercent;
26
- var maxBorderWidth = function maxBorderWidth() {
27
- if (percent === 100) {
28
- return maxPercent;
29
- }
30
- return false;
31
- };
32
- return /*#__PURE__*/React.createElement(S.Container, {
33
- className: (className || '') + " progress-bar-container",
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 ProgressBar;
58
- }(React.PureComponent);
59
- ProgressBar.defaultProps = {
60
- type: 'line',
61
- status: 'normal',
62
- strokeLinecap: 'round',
63
- strokeColor: '#76dc25',
64
- showLabel: false,
65
- description: '',
66
- maxPercent: true
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
- thick?: boolean | undefined;
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.thick ? '3px' : '6px';
19
+ return props.thin ? '3px' : '6px';
20
20
  }, function (props) {
21
- return props.thick ? '3px' : '0px';
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
- export type ProgressProps = AntProgressProps & {
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,12 +1,15 @@
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
- import { Label } from '@synerise/ds-typography';
4
+ import { FormFieldLabel } from '@synerise/ds-form-field';
3
5
  import * as S from './ProgressTiles.styles';
4
6
  var MAX_PERCENT = 100;
5
7
  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, null, label && /*#__PURE__*/React.createElement(Label, {
28
+ return /*#__PURE__*/React.createElement(S.TilesWrapper, rest, label && /*#__PURE__*/React.createElement(FormFieldLabel, {
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.4",
3
+ "version": "1.1.0",
4
4
  "description": "Progress-Bar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-typography": "^1.0.4",
37
+ "@synerise/ds-form-field": "^1.1.0",
38
38
  "@synerise/ds-utils": "^1.0.1"
39
39
  },
40
40
  "peerDependencies": {
@@ -43,5 +43,5 @@
43
43
  "react": ">=16.9.0 <= 18.3.1",
44
44
  "styled-components": "^5.3.3"
45
45
  },
46
- "gitHead": "dc78b03be09e793ec84f1dafc59c5616e77f1196"
46
+ "gitHead": "6735f9babfeef53122f54ca86cba5f581e8870d9"
47
47
  }