@synerise/ds-progress-bar 1.1.40 → 1.2.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
@@ -3,6 +3,16 @@
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.2.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.2.0...@synerise/ds-progress-bar@1.2.1) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-progress-bar
9
+
10
+ # [1.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.1.40...@synerise/ds-progress-bar@1.2.0) (2026-03-20)
11
+
12
+ ### Features
13
+
14
+ - **progress-bar:** tooltips in multivalue progress bar ([e37f829](https://github.com/Synerise/synerise-design/commit/e37f829fee9c194abf2312349b563e4a55f78cad))
15
+
6
16
  ## [1.1.40](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@1.1.39...@synerise/ds-progress-bar@1.1.40) (2026-03-09)
7
17
 
8
18
  **Note:** Version bump only for package @synerise/ds-progress-bar
package/README.md CHANGED
@@ -15,14 +15,15 @@ Progress-Bar UI Component
15
15
 
16
16
  | Property | Description | Type | Default |
17
17
  | ----------- | -------------------------------------------- | ------- | ------- |
18
- | steps | Number of steps in progress bar | number | - |
19
- | description | Text of description under progress bar | string | - |
20
- | percent | Value of progress bar, also visible in label | number | - |
21
- | thin | Displays a thinner line | boolean | `false` |
22
- | label | Optional label above progress bar | string | - |
23
- | customColor | Bar color | string | - |
24
- | width | CSS width property of progress-bar | string | - |
25
- | inline | set percent value next to progress bar | boolean | `false` |
18
+ | steps | Number of steps in progress bar | number | `1` |
19
+ | description | Text of description under progress bar | ReactNode | - |
20
+ | percent | Value of progress bar, also visible in label | number | `50` |
21
+ | thin | Displays a thinner line | boolean | `false` |
22
+ | label | Optional label above progress bar | ReactNode | - |
23
+ | customColor | Bar color | string | `''` |
24
+ | width | CSS width of each segment tile | string | `'100%'` |
25
+ | inline | set percent value next to progress bar | boolean | `false` |
26
+ | containerStyles | Container inline styles (**@deprecated** — use `style` prop) | CSSProperties | - |
26
27
 
27
28
  ### ProgressTiles
28
29
 
@@ -42,7 +43,9 @@ Progress-Bar UI Component
42
43
 
43
44
  ### ProgressValue
44
45
 
45
- | Property | Description | Type | Default |
46
- | -------- | -------------------------------- | ------ | ------- |
47
- | percent | Value to display (length of bar) | number | - |
48
- | color | Bar color | string | - |
46
+ | Property | Description | Type | Default |
47
+ | ------------ | ---------------------------------------- | ------------ | ----------- |
48
+ | percent | Value to display (length of bar) | number | - |
49
+ | color | Bar color | string | - |
50
+ | tooltip | Tooltip content shown on hover | ReactNode | `undefined` |
51
+ | tooltipProps | Additional props passed to the Tooltip | TooltipProps | `undefined` |
@@ -1,7 +1,7 @@
1
- export declare const Multivalue: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const Multivalue: import('styled-components').StyledComponent<"div", any, {
2
2
  color: string;
3
3
  percent: number;
4
4
  }, never>;
5
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
5
+ export declare const Container: import('styled-components').StyledComponent<"div", any, {
6
6
  stackedBars: boolean;
7
7
  }, never>;
@@ -1,15 +1,13 @@
1
- import styled, { css } from 'styled-components';
2
- export var Multivalue = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ const Multivalue = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "MultiValuestyles__Multivalue",
4
4
  componentId: "sc-145qx7z-0"
5
- })(["background:", ";width:", "%;height:6px;border-radius:6px;overflow:hidden;margin-top:-6px;"], function (props) {
6
- return props.color;
7
- }, function (props) {
8
- return props.percent;
9
- });
10
- export var Container = styled.div.withConfig({
5
+ })(["background:", ";width:", "%;height:6px;border-radius:6px;overflow:hidden;margin-top:-6px;"], (props) => props.color, (props) => props.percent);
6
+ const Container = /* @__PURE__ */ styled.div.withConfig({
11
7
  displayName: "MultiValuestyles__Container",
12
8
  componentId: "sc-145qx7z-1"
13
- })(["position:relative;height:16px;width:100%;padding-top:11px;", ""], function (props) {
14
- return props.stackedBars ? css(["", ":not(:first-child){border-top-right-radius:0px;border-bottom-right-radius:0px;border-right:2px solid white;}"], Multivalue) : css(["justify-content:flex-start;display:flex;gap:2px;", "{border-radius:0;&:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px;}&:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px;}}"], Multivalue);
15
- });
9
+ })(["position:relative;height:16px;width:100%;padding-top:11px;", ""], (props) => props.stackedBars ? css(["", ":not(:first-child){border-top-right-radius:0px;border-bottom-right-radius:0px;border-right:2px solid white;}"], Multivalue) : css(["justify-content:flex-start;display:flex;gap:2px;", "{border-radius:0;&:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px;}&:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px;}}"], Multivalue));
10
+ export {
11
+ Container,
12
+ Multivalue
13
+ };
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type MultivalueProps } from './Multivalue.types';
1
+ import { default as React } from 'react';
2
+ import { MultivalueProps } from './Multivalue.types';
3
3
  declare const Multivalue: ({ values, stackedBars, ...htmlAttributes }: MultivalueProps) => React.JSX.Element;
4
4
  export default Multivalue;
@@ -1,9 +1,8 @@
1
- var _excluded = ["values", "stackedBars"];
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
- import React, { useMemo } from 'react';
5
- import * as S from './MultiValue.styles';
6
- var normalizePercent = function normalizePercent(value) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import Tooltip from "@synerise/ds-tooltip";
4
+ import { Container, Multivalue as Multivalue$1 } from "./MultiValue.styles.js";
5
+ const normalizePercent = (value) => {
7
6
  if (value < 0) {
8
7
  return 0;
9
8
  }
@@ -12,24 +11,16 @@ var normalizePercent = function normalizePercent(value) {
12
11
  }
13
12
  return value;
14
13
  };
15
- var Multivalue = function Multivalue(_ref) {
16
- var values = _ref.values,
17
- _ref$stackedBars = _ref.stackedBars,
18
- stackedBars = _ref$stackedBars === void 0 ? true : _ref$stackedBars,
19
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
20
- var finalValues = useMemo(function () {
21
- return stackedBars ? values.sort(function (a, b) {
22
- return b.percent - a.percent;
23
- }) : values;
24
- }, [stackedBars, values]);
25
- return /*#__PURE__*/React.createElement(S.Container, _extends({
26
- stackedBars: stackedBars
27
- }, htmlAttributes), finalValues.map(function (val, index) {
28
- return /*#__PURE__*/React.createElement(S.Multivalue, {
29
- key: val.color + "-" + val.percent + "-" + index,
30
- color: val.color,
31
- percent: normalizePercent(val.percent)
32
- });
33
- }));
14
+ const Multivalue = ({
15
+ values,
16
+ stackedBars = true,
17
+ ...htmlAttributes
18
+ }) => {
19
+ const finalValues = useMemo(() => stackedBars ? values.sort((a, b) => {
20
+ return b.percent - a.percent;
21
+ }) : values, [stackedBars, values]);
22
+ return /* @__PURE__ */ jsx(Container, { stackedBars, ...htmlAttributes, children: finalValues.map((val, index) => /* @__PURE__ */ jsx(Tooltip, { title: val.tooltip, ...val?.tooltipProps, children: /* @__PURE__ */ jsx(Multivalue$1, { color: val.color, percent: normalizePercent(val.percent) }, `${val.color}-${val.percent}-${index}`) })) });
23
+ };
24
+ export {
25
+ Multivalue as default
34
26
  };
35
- export default Multivalue;
@@ -1,4 +1,6 @@
1
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactNode } from 'react';
2
+ import { TooltipProps } from '@synerise/ds-tooltip';
3
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
4
  export type MultivalueProps = WithHTMLAttributes<HTMLDivElement, {
3
5
  values: ProgressValue[];
4
6
  stackedBars?: boolean;
@@ -6,4 +8,6 @@ export type MultivalueProps = WithHTMLAttributes<HTMLDivElement, {
6
8
  export type ProgressValue = {
7
9
  percent: number;
8
10
  color: string;
11
+ tooltip?: ReactNode;
12
+ tooltipProps?: TooltipProps;
9
13
  };
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ProgressProps } from './ProgressBar.types';
1
+ import { default as React } from 'react';
2
+ import { ProgressProps } from './ProgressBar.types';
3
3
  declare const ProgressBar: ({ description, label, steps, width, customColor, percent, className, thin, containerStyles, inline, ...rest }: ProgressProps) => React.JSX.Element;
4
4
  export default ProgressBar;
@@ -1,63 +1,41 @@
1
- var _excluded = ["description", "label", "steps", "width", "customColor", "percent", "className", "thin", "containerStyles", "inline"];
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
- import React, { useMemo } from 'react';
5
- import { v4 as uuid } from 'uuid';
6
- import * as S from './ProgressBar.styles';
7
- var MAX_PERCENT = 100;
8
- var ProgressBar = function ProgressBar(_ref) {
9
- var _ref$description = _ref.description,
10
- description = _ref$description === void 0 ? '' : _ref$description,
11
- label = _ref.label,
12
- _ref$steps = _ref.steps,
13
- steps = _ref$steps === void 0 ? 1 : _ref$steps,
14
- _ref$width = _ref.width,
15
- width = _ref$width === void 0 ? '100%' : _ref$width,
16
- _ref$customColor = _ref.customColor,
17
- customColor = _ref$customColor === void 0 ? '' : _ref$customColor,
18
- _ref$percent = _ref.percent,
19
- percent = _ref$percent === void 0 ? 50 : _ref$percent,
20
- className = _ref.className,
21
- _ref$thin = _ref.thin,
22
- thin = _ref$thin === void 0 ? false : _ref$thin,
23
- containerStyles = _ref.containerStyles,
24
- _ref$inline = _ref.inline,
25
- inline = _ref$inline === void 0 ? false : _ref$inline,
26
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
27
- var tiles = useMemo(function () {
28
- return Array.from({
29
- length: steps
30
- }, function () {
31
- return {
32
- id: uuid()
33
- };
34
- });
35
- }, [steps]);
36
- var tileWidthRatio = MAX_PERCENT / steps;
37
- var currentProgress = percent / tileWidthRatio;
38
- var tileWidths = Array(Math.floor(currentProgress)).fill(1);
39
- var lastTileWidth = currentProgress % 1;
40
- var tilesWidthRatios = [].concat(tileWidths, [lastTileWidth]);
41
- return /*#__PURE__*/React.createElement(S.Container, _extends({
42
- className: (className || '') + " progress-bar-container",
43
- "data-testid": "progress-bar-container",
44
- $steps: steps,
45
- $inline: inline
46
- }, rest), label && !inline && /*#__PURE__*/React.createElement(S.LabelWrapper, null, label && /*#__PURE__*/React.createElement(S.Label, {
47
- "data-testid": "progress-bar-label"
48
- }, label), /*#__PURE__*/React.createElement(S.Percent, {
49
- "data-testid": "progress-bar-max-percent"
50
- }, percent + "%")), /*#__PURE__*/React.createElement(S.ProgressOuter, null, tiles.map(function (tile, i) {
51
- return /*#__PURE__*/React.createElement(S.ProgressWrapper, {
52
- $thin: thin,
53
- key: "key-" + tile.id,
54
- $width: width
55
- }, /*#__PURE__*/React.createElement(S.ProgressBar, {
56
- customColor: customColor,
57
- $width: (tilesWidthRatios[i] || 0) * MAX_PERCENT + "%"
58
- }));
59
- })), inline && /*#__PURE__*/React.createElement(S.PercentWrapper, null, label || percent + "%"), description && !inline && /*#__PURE__*/React.createElement(S.ProgressBarDescription, {
60
- "data-testid": "progress-bar-description"
61
- }, description));
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { v4 } from "uuid";
4
+ import { Container, LabelWrapper, Label, Percent, ProgressOuter, ProgressWrapper, ProgressBar as ProgressBar$1, PercentWrapper, ProgressBarDescription } from "./ProgressBar.styles.js";
5
+ const MAX_PERCENT = 100;
6
+ const ProgressBar = ({
7
+ description = "",
8
+ label,
9
+ steps = 1,
10
+ width = "100%",
11
+ customColor = "",
12
+ percent = 50,
13
+ className,
14
+ thin = false,
15
+ containerStyles,
16
+ inline = false,
17
+ ...rest
18
+ }) => {
19
+ const tiles = useMemo(() => Array.from({
20
+ length: steps
21
+ }, () => ({
22
+ id: v4()
23
+ })), [steps]);
24
+ const tileWidthRatio = MAX_PERCENT / steps;
25
+ const currentProgress = percent / tileWidthRatio;
26
+ const tileWidths = Array(Math.floor(currentProgress)).fill(1);
27
+ const lastTileWidth = currentProgress % 1;
28
+ const tilesWidthRatios = [...tileWidths, lastTileWidth];
29
+ return /* @__PURE__ */ jsxs(Container, { className: `${className || ""} progress-bar-container`, "data-testid": "progress-bar-container", $steps: steps, $inline: inline, ...rest, children: [
30
+ label && !inline && /* @__PURE__ */ jsxs(LabelWrapper, { children: [
31
+ label && /* @__PURE__ */ jsx(Label, { "data-testid": "progress-bar-label", children: label }),
32
+ /* @__PURE__ */ jsx(Percent, { "data-testid": "progress-bar-max-percent", children: `${percent}%` })
33
+ ] }),
34
+ /* @__PURE__ */ jsx(ProgressOuter, { children: tiles.map((tile, i) => /* @__PURE__ */ jsx(ProgressWrapper, { $thin: thin, $width: width, children: /* @__PURE__ */ jsx(ProgressBar$1, { customColor, $width: `${(tilesWidthRatios[i] || 0) * MAX_PERCENT}%` }) }, `key-${tile.id}`)) }),
35
+ inline && /* @__PURE__ */ jsx(PercentWrapper, { children: label || `${percent}%` }),
36
+ description && !inline && /* @__PURE__ */ jsx(ProgressBarDescription, { "data-testid": "progress-bar-description", children: description })
37
+ ] });
38
+ };
39
+ export {
40
+ ProgressBar as default
62
41
  };
63
- export default ProgressBar;
@@ -1,18 +1,18 @@
1
- export declare const LabelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const Label: import("styled-components").StyledComponent<({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: import("@synerise/ds-form-field").FormFieldLabelProps) => React.JSX.Element, any, {}, never>;
3
- export declare const ProgressWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const LabelWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const Label: import('styled-components').StyledComponent<({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: import('@synerise/ds-form-field').FormFieldLabelProps) => React.JSX.Element, any, {}, never>;
3
+ export declare const ProgressWrapper: import('styled-components').StyledComponent<"div", any, {
4
4
  $width: string;
5
5
  $thin: boolean;
6
6
  }, never>;
7
- export declare const ProgressOuter: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const Percent: import("styled-components").StyledComponent<"span", any, {}, never>;
9
- export declare const ProgressBarDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
10
- export declare const ProgressBar: import("styled-components").StyledComponent<"div", any, {
7
+ export declare const ProgressOuter: import('styled-components').StyledComponent<"div", any, {}, never>;
8
+ export declare const Percent: import('styled-components').StyledComponent<"span", any, {}, never>;
9
+ export declare const ProgressBarDescription: import('styled-components').StyledComponent<"span", any, {}, never>;
10
+ export declare const ProgressBar: import('styled-components').StyledComponent<"div", any, {
11
11
  customColor: string;
12
12
  $width: string;
13
13
  }, never>;
14
- export declare const PercentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
15
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
14
+ export declare const PercentWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
15
+ export declare const Container: import('styled-components').StyledComponent<"div", any, {
16
16
  $steps?: number;
17
17
  $inline?: boolean;
18
18
  }, never>;
@@ -1,54 +1,49 @@
1
- import styled, { css } from 'styled-components';
2
- import { FormFieldLabel } from '@synerise/ds-form-field';
3
- export var LabelWrapper = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ import { FormFieldLabel } from "@synerise/ds-form-field";
3
+ const LabelWrapper = /* @__PURE__ */ styled.div.withConfig({
4
4
  displayName: "ProgressBarstyles__LabelWrapper",
5
5
  componentId: "sc-1gqovic-0"
6
6
  })(["display:flex;align-items:center;margin-bottom:8px;"]);
7
- export var Label = styled(FormFieldLabel).withConfig({
7
+ const Label = /* @__PURE__ */ styled(FormFieldLabel).withConfig({
8
8
  displayName: "ProgressBarstyles__Label",
9
9
  componentId: "sc-1gqovic-1"
10
10
  })(["&&&{margin:0 8px 0 0;align-items:center;}"]);
11
- export var ProgressWrapper = styled.div.withConfig({
11
+ const ProgressWrapper = /* @__PURE__ */ styled.div.withConfig({
12
12
  displayName: "ProgressBarstyles__ProgressWrapper",
13
13
  componentId: "sc-1gqovic-2"
14
- })(["position:relative;margin-right:2px;width:", ";height:", ";background:", ";"], function (props) {
15
- return props.$width;
16
- }, function (props) {
17
- return props.$thin ? '4px' : '6px';
18
- }, function (props) {
19
- return props.theme.palette['grey-200'];
20
- });
21
- export var ProgressOuter = styled.div.withConfig({
14
+ })(["position:relative;margin-right:2px;width:", ";height:", ";background:", ";"], (props) => props.$width, (props) => props.$thin ? "4px" : "6px", (props) => props.theme.palette["grey-200"]);
15
+ const ProgressOuter = /* @__PURE__ */ styled.div.withConfig({
22
16
  displayName: "ProgressBarstyles__ProgressOuter",
23
17
  componentId: "sc-1gqovic-3"
24
18
  })(["display:flex;align-items:center;min-width:0;flex:1 1 auto;"]);
25
- export var Percent = styled.span.withConfig({
19
+ const Percent = /* @__PURE__ */ styled.span.withConfig({
26
20
  displayName: "ProgressBarstyles__Percent",
27
21
  componentId: "sc-1gqovic-4"
28
22
  })([""]);
29
- export var ProgressBarDescription = styled.span.withConfig({
23
+ const ProgressBarDescription = /* @__PURE__ */ styled.span.withConfig({
30
24
  displayName: "ProgressBarstyles__ProgressBarDescription",
31
25
  componentId: "sc-1gqovic-5"
32
26
  })(["margin-top:8px;"]);
33
- export var ProgressBar = styled.div.withConfig({
27
+ const ProgressBar = /* @__PURE__ */ styled.div.withConfig({
34
28
  displayName: "ProgressBarstyles__ProgressBar",
35
29
  componentId: "sc-1gqovic-6"
36
- })(["position:absolute;height:100%;width:", ";background-color:", ";"], function (props) {
37
- return props.$width;
38
- }, function (props) {
39
- return props.customColor ? props.customColor : props.theme.palette['green-500'];
40
- });
41
- export var PercentWrapper = styled.div.withConfig({
30
+ })(["position:absolute;height:100%;width:", ";background-color:", ";"], (props) => props.$width, (props) => props.customColor ? props.customColor : props.theme.palette["green-500"]);
31
+ const PercentWrapper = /* @__PURE__ */ styled.div.withConfig({
42
32
  displayName: "ProgressBarstyles__PercentWrapper",
43
33
  componentId: "sc-1gqovic-7"
44
- })(["margin-left:8px;color:", ";font-weight:400;"], function (props) {
45
- return props.theme.palette['grey-800'];
46
- });
47
- export var Container = styled.div.withConfig({
34
+ })(["margin-left:8px;color:", ";font-weight:400;"], (props) => props.theme.palette["grey-800"]);
35
+ const Container = /* @__PURE__ */ styled.div.withConfig({
48
36
  displayName: "ProgressBarstyles__Container",
49
37
  componentId: "sc-1gqovic-8"
50
- })(["width:100%;display:flex;justify-content:center;flex-direction:", ";", ":last-of-type{border-radius:3px;", ":last-of-type{border-radius:3px;}}", ""], function (props) {
51
- return props.$inline ? 'row' : 'column';
52
- }, ProgressWrapper, ProgressBar, function (props) {
53
- return props.$steps !== 1 && css(["", ":first-of-type{border-radius:3px 0 0 3px;", ":first-of-type{border-radius:3px 0 0 3px;}}", ":last-of-type{border-radius:0 3px 3px 0;", ":last-of-type{border-radius:0 3px 3px 0;}}"], ProgressWrapper, ProgressBar, ProgressWrapper, ProgressBar);
54
- });
38
+ })(["width:100%;display:flex;justify-content:center;flex-direction:", ";", ":last-of-type{border-radius:3px;", ":last-of-type{border-radius:3px;}}", ""], (props) => props.$inline ? "row" : "column", ProgressWrapper, ProgressBar, (props) => props.$steps !== 1 && css(["", ":first-of-type{border-radius:3px 0 0 3px;", ":first-of-type{border-radius:3px 0 0 3px;}}", ":last-of-type{border-radius:0 3px 3px 0;", ":last-of-type{border-radius:0 3px 3px 0;}}"], ProgressWrapper, ProgressBar, ProgressWrapper, ProgressBar));
39
+ export {
40
+ Container,
41
+ Label,
42
+ LabelWrapper,
43
+ Percent,
44
+ PercentWrapper,
45
+ ProgressBar,
46
+ ProgressBarDescription,
47
+ ProgressOuter,
48
+ ProgressWrapper
49
+ };
@@ -1,5 +1,5 @@
1
- import type { CSSProperties, ReactNode } from 'react';
2
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
3
  export type ProgressProps = WithHTMLAttributes<HTMLDivElement, {
4
4
  label?: ReactNode;
5
5
  steps?: number;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ProgressTilesProps } from './ProgressTiles.types';
1
+ import { default as React } from 'react';
2
+ import { ProgressTilesProps } from './ProgressTiles.types';
3
3
  export declare const ProgressTiles: ({ colors, label, tileWidth, percent, ...rest }: ProgressTilesProps) => React.JSX.Element;
4
4
  export default ProgressTiles;
@@ -1,39 +1,33 @@
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; }
3
- import React, { useCallback } from 'react';
4
- import * as S from './ProgressTiles.styles';
5
- var MAX_PERCENT = 100;
6
- export var ProgressTiles = function ProgressTiles(_ref) {
7
- var colors = _ref.colors,
8
- label = _ref.label,
9
- tileWidth = _ref.tileWidth,
10
- percent = _ref.percent,
11
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
12
- var getTilesConfig = useCallback(function () {
13
- var TILES_COUNT = colors.length;
14
- var tileWidthRatio = MAX_PERCENT / TILES_COUNT;
15
- var currentProgress = percent / tileWidthRatio;
16
- var tileWidths = Array(Math.floor(currentProgress)).fill(1);
17
- var lastTileWidth = currentProgress % 1;
18
- var tilesWidthRatios = [].concat(tileWidths, [lastTileWidth]);
19
- return colors.map(function (color, i) {
20
- return {
21
- key: i,
22
- color: color,
23
- width: (tilesWidthRatios[i] || 0) * MAX_PERCENT + "%"
24
- };
25
- });
26
- }, [colors, percent]);
27
- return /*#__PURE__*/React.createElement(S.TilesWrapper, rest, label && /*#__PURE__*/React.createElement(S.Label, null, label), /*#__PURE__*/React.createElement("div", {
28
- className: "progress-bar-wrapper"
29
- }, getTilesConfig().map(function (tile) {
30
- return /*#__PURE__*/React.createElement(S.TileContainer, {
31
- key: "key-" + tile.key,
32
- width: tileWidth
33
- }, /*#__PURE__*/React.createElement(S.TileProgress, {
34
- color: tile.color,
35
- width: tile.width
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { TilesWrapper, Label, TileContainer, TileProgress } from "./ProgressTiles.styles.js";
4
+ const MAX_PERCENT = 100;
5
+ const ProgressTiles = ({
6
+ colors,
7
+ label,
8
+ tileWidth,
9
+ percent,
10
+ ...rest
11
+ }) => {
12
+ const getTilesConfig = useCallback(() => {
13
+ const TILES_COUNT = colors.length;
14
+ const tileWidthRatio = MAX_PERCENT / TILES_COUNT;
15
+ const currentProgress = percent / tileWidthRatio;
16
+ const tileWidths = Array(Math.floor(currentProgress)).fill(1);
17
+ const lastTileWidth = currentProgress % 1;
18
+ const tilesWidthRatios = [...tileWidths, lastTileWidth];
19
+ return colors.map((color, i) => ({
20
+ key: i,
21
+ color,
22
+ width: `${(tilesWidthRatios[i] || 0) * MAX_PERCENT}%`
36
23
  }));
37
- })));
24
+ }, [colors, percent]);
25
+ return /* @__PURE__ */ jsxs(TilesWrapper, { ...rest, children: [
26
+ label && /* @__PURE__ */ jsx(Label, { children: label }),
27
+ /* @__PURE__ */ jsx("div", { className: "progress-bar-wrapper", children: getTilesConfig().map((tile) => /* @__PURE__ */ jsx(TileContainer, { width: tileWidth, children: /* @__PURE__ */ jsx(TileProgress, { color: tile.color, width: tile.width }) }, `key-${tile.key}`)) })
28
+ ] });
29
+ };
30
+ export {
31
+ ProgressTiles,
32
+ ProgressTiles as default
38
33
  };
39
- export default ProgressTiles;
@@ -1,9 +1,9 @@
1
- export declare const TileContainer: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const TileContainer: import('styled-components').StyledComponent<"div", any, {
2
2
  width: string;
3
3
  }, never>;
4
- export declare const TileProgress: import("styled-components").StyledComponent<"div", any, {
4
+ export declare const TileProgress: import('styled-components').StyledComponent<"div", any, {
5
5
  color: string;
6
6
  width: string;
7
7
  }, never>;
8
- export declare const Label: import("styled-components").StyledComponent<({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: import("@synerise/ds-form-field").FormFieldLabelProps) => React.JSX.Element, any, {}, never>;
9
- export declare const TilesWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const Label: import('styled-components').StyledComponent<({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: import('@synerise/ds-form-field').FormFieldLabelProps) => React.JSX.Element, any, {}, never>;
9
+ export declare const TilesWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,26 +1,24 @@
1
- import styled from 'styled-components';
2
- import { FormFieldLabel } from '@synerise/ds-form-field';
3
- export var TileContainer = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ import { FormFieldLabel } from "@synerise/ds-form-field";
3
+ const TileContainer = /* @__PURE__ */ styled.div.withConfig({
4
4
  displayName: "ProgressTilesstyles__TileContainer",
5
5
  componentId: "sc-sod9jl-0"
6
- })(["position:relative;margin-right:2px;width:", ";height:6px;background:", ";"], function (props) {
7
- return props.width;
8
- }, function (props) {
9
- return props.theme.palette['grey-200'];
10
- });
11
- export var TileProgress = styled.div.withConfig({
6
+ })(["position:relative;margin-right:2px;width:", ";height:6px;background:", ";"], (props) => props.width, (props) => props.theme.palette["grey-200"]);
7
+ const TileProgress = /* @__PURE__ */ styled.div.withConfig({
12
8
  displayName: "ProgressTilesstyles__TileProgress",
13
9
  componentId: "sc-sod9jl-1"
14
- })(["position:absolute;height:100%;width:", ";background-color:", ";"], function (props) {
15
- return props.width;
16
- }, function (props) {
17
- return props.color;
18
- });
19
- export var Label = styled(FormFieldLabel).withConfig({
10
+ })(["position:absolute;height:100%;width:", ";background-color:", ";"], (props) => props.width, (props) => props.color);
11
+ const Label = /* @__PURE__ */ styled(FormFieldLabel).withConfig({
20
12
  displayName: "ProgressTilesstyles__Label",
21
13
  componentId: "sc-sod9jl-2"
22
14
  })(["margin-bottom:12px;cursor:pointer;"]);
23
- export var TilesWrapper = styled.div.withConfig({
15
+ const TilesWrapper = /* @__PURE__ */ styled.div.withConfig({
24
16
  displayName: "ProgressTilesstyles__TilesWrapper",
25
17
  componentId: "sc-sod9jl-3"
26
- })(["width:100%;display:flex;justify-content:center;flex-direction:column;.progress-bar-wrapper{display:flex;}", ":first-of-type{border-radius:3px 0 0 3px;", ":first-of-type{border-radius:3px 0 0 3px;}}", ":last-of-type{border-radius:0 3px 3px 0;", ":last-of-type{border-radius:0 3px 3px 0;}}"], TileContainer, TileProgress, TileContainer, TileProgress);
18
+ })(["width:100%;display:flex;justify-content:center;flex-direction:column;.progress-bar-wrapper{display:flex;}", ":first-of-type{border-radius:3px 0 0 3px;", ":first-of-type{border-radius:3px 0 0 3px;}}", ":last-of-type{border-radius:0 3px 3px 0;", ":last-of-type{border-radius:0 3px 3px 0;}}"], TileContainer, TileProgress, TileContainer, TileProgress);
19
+ export {
20
+ Label,
21
+ TileContainer,
22
+ TileProgress,
23
+ TilesWrapper
24
+ };
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactNode } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
3
  export type ProgressTilesProps = WithHTMLAttributes<HTMLDivElement, {
4
4
  tileWidth: string;
5
5
  colors: string[];
@@ -1 +1 @@
1
- export {};
1
+
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
- export { default } from './ProgressBar';
2
- export { default as Multivalue } from './Multivalue/Multivalue';
3
- export { default as ProgressTiles } from './ProgressTiles/ProgressTiles';
1
+ import { default as default2 } from "./ProgressBar.js";
2
+ import { default as default3 } from "./Multivalue/Multivalue.js";
3
+ import { ProgressTiles } from "./ProgressTiles/ProgressTiles.js";
4
+ export {
5
+ default3 as Multivalue,
6
+ ProgressTiles,
7
+ default2 as default
8
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-progress-bar",
3
- "version": "1.1.40",
3
+ "version": "1.2.1",
4
4
  "description": "Progress-Bar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -16,10 +16,10 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
22
+ "build:watch": "vite build --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
@@ -35,13 +35,15 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-form-field": "^1.3.8",
39
- "@synerise/ds-utils": "^1.6.0"
38
+ "@synerise/ds-form-field": "^1.3.10",
39
+ "@synerise/ds-tooltip": "^1.4.10",
40
+ "@synerise/ds-utils": "^1.7.1",
41
+ "uuid": "^8.3.2"
40
42
  },
41
43
  "peerDependencies": {
42
44
  "@synerise/ds-core": "*",
43
45
  "react": ">=16.9.0 <= 18.3.1",
44
46
  "styled-components": "^5.3.3"
45
47
  },
46
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
48
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
47
49
  }