@synerise/ds-estimation 1.4.9 → 1.4.11

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.4.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@1.4.10...@synerise/ds-estimation@1.4.11) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-estimation
9
+
10
+ ## [1.4.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@1.4.9...@synerise/ds-estimation@1.4.10) (2026-03-20)
11
+
12
+ ### Bug Fixes
13
+
14
+ - panel regressions ([c88aad5](https://github.com/Synerise/synerise-design/commit/c88aad5c4584a172c41c50dd8d64e5f86784de65))
15
+
6
16
  ## [1.4.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@1.4.8...@synerise/ds-estimation@1.4.9) (2026-03-09)
7
17
 
8
18
  **Note:** Version bump only for package @synerise/ds-estimation
package/README.md CHANGED
@@ -25,16 +25,17 @@ import Estimation from '@synerise/ds-estimation'
25
25
  <iframe src="/storybook-static/iframe.html?id=components-estimation--default"></iframe>
26
26
 
27
27
  ## API
28
- | Property | Description | Type | Default | |
29
- |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|---------|---|
30
- | value | Main estimation value | `ReactNode` | - | |
31
- | label | Label above the field field | `ReactNode` | - | |
32
- | tooltip | Label tooltip content | `ReactNode` | - | |
33
- | tooltipConfig | Configuration for tooltip, see ds-tooltip | `TooltipConfig` | - | |
34
- | total | Top right corner value (number or formatted content). | `number` | - | |
35
- | isLoading | Renders loading state (skeletons). Can be boolean or object with `total` and `progressBar` flags in order to render skeletons in place of those components | `boolean \ { total?: boolean; progressBar?: boolean }` | - | |
36
- | errorMessage | Renders an inline alert in footer with this message | `ReactNode` | - | |
37
- | footerButtons | Custom buttons to render in footer right side | `ReactNode` | - | |
38
- | texts | Translations to overwrite DS defaults (`calculated`, `loading`) | `Partial<EstimationTexts>` | - | |
39
- | calculatedDate | Renders "calculated date" as relative (if recent) or absolute date using FormattedDate. Alternatively provide any ReactNode to render as calculated date | `Date \ ReactNode` | - | |
40
- | progressBarValues | Render multivalue progressbar. Provide label for each entry to render a legend below multivalue bar | `EstimationProgressValue[]` | - | |
28
+
29
+ | Property | Description | Type | Default |
30
+ |-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|---------|
31
+ | value | Main estimation value | `ReactNode` | - |
32
+ | label | Label above the field | `ReactNode` | - |
33
+ | tooltip | Label tooltip content | `ReactNode` | - |
34
+ | tooltipConfig | Configuration for tooltip, see ds-tooltip | `TooltipConfig` | - |
35
+ | total | Top right corner value (preformatted content) | `ReactNode` | - |
36
+ | isLoading | Renders loading state. `true` = full skeleton; object with `total`/`progressBar` flags for granular control | `boolean \| { total?: boolean; progressBar?: boolean }` | - |
37
+ | errorMessage | Renders an inline alert in footer with this message | `ReactNode` | - |
38
+ | footerButtons | Custom buttons to render in footer right side | `ReactNode` | - |
39
+ | texts | Translations to overwrite DS defaults (`calculated`, `loading`) | `Partial<EstimationTexts>` | - |
40
+ | calculatedDate | `Date` → rendered as relative time; any other `ReactNode` → rendered as-is | `Date \| ReactNode` | - |
41
+ | progressBarValues | Render multivalue progressbar. Provide `label` for each entry to render a colour-dot legend below the bar | `EstimationProgressValue[]` | - |
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import type { EstimationProps } from './Estimation.types';
1
+ import { default as React } from 'react';
2
+ import { EstimationProps } from './Estimation.types';
3
3
  declare const Estimation: ({ value, tooltip, tooltipConfig, label, total, footerButtons, isLoading, progressBarValues, errorMessage, texts: customTexts, calculatedDate, ...rest }: EstimationProps) => React.JSX.Element;
4
4
  export default Estimation;
@@ -1,67 +1,47 @@
1
- var _excluded = ["value", "tooltip", "tooltipConfig", "label", "total", "footerButtons", "isLoading", "progressBarValues", "errorMessage", "texts", "calculatedDate"];
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 from 'react';
5
- import { FormFieldLabel } from '@synerise/ds-form-field';
6
- import InlineAlert from '@synerise/ds-inline-alert';
7
- import * as S from './Estimation.styles';
8
- import { EstimationCalculatedDate } from './components/EstimationCalculated';
9
- import { EstimationProgressBar } from './components/EstimationProgressBar';
10
- import { EstimationProgressBarSkeleton } from './components/EstimationProgressBarSkeleton';
11
- import { useDefaultTexts } from './hooks/useDefaultTexts';
12
- var Estimation = function Estimation(_ref) {
13
- var value = _ref.value,
14
- tooltip = _ref.tooltip,
15
- tooltipConfig = _ref.tooltipConfig,
16
- label = _ref.label,
17
- total = _ref.total,
18
- footerButtons = _ref.footerButtons,
19
- isLoading = _ref.isLoading,
20
- progressBarValues = _ref.progressBarValues,
21
- errorMessage = _ref.errorMessage,
22
- customTexts = _ref.texts,
23
- calculatedDate = _ref.calculatedDate,
24
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
25
- var texts = useDefaultTexts(customTexts);
26
- var footerLeftSide = errorMessage ? /*#__PURE__*/React.createElement(InlineAlert, {
27
- type: "alert",
28
- message: errorMessage
29
- }) : isLoading ? texts.loading : /*#__PURE__*/React.createElement(EstimationCalculatedDate, {
30
- label: texts.calculated,
31
- calculatedDate: calculatedDate
32
- });
33
- var loadingParts = typeof isLoading === 'object' ? isLoading : undefined;
34
- var showTotalSkeleton = loadingParts == null ? void 0 : loadingParts.total;
35
- var showProgressBarSkeleton = loadingParts == null ? void 0 : loadingParts.progressBar;
36
- var shouldRenderTotal = total !== undefined && (!isLoading || showTotalSkeleton);
37
- var shouldRenderFooterLeftSide = Boolean(isLoading || errorMessage || calculatedDate);
38
- return /*#__PURE__*/React.createElement(S.EstimationWrapper, _extends({
39
- isLoading: !!isLoading
40
- }, rest), label && /*#__PURE__*/React.createElement(FormFieldLabel, {
41
- label: label,
42
- tooltip: tooltip,
43
- tooltipConfig: tooltipConfig
44
- }), /*#__PURE__*/React.createElement(S.EstimationContent, {
45
- p: 16,
46
- pb: 12
47
- }, /*#__PURE__*/React.createElement(S.EstimationHead, null, /*#__PURE__*/React.createElement(S.EstimationLeftSide, null, isLoading ? /*#__PURE__*/React.createElement(S.Skeleton, {
48
- numberOfSkeletons: 1,
49
- size: "L",
50
- width: "L",
51
- height: 28
52
- }) : /*#__PURE__*/React.createElement(S.EstimationTitle, {
53
- level: 1
54
- }, value)), shouldRenderTotal && /*#__PURE__*/React.createElement(S.EstimationRightSide, null, showTotalSkeleton ? /*#__PURE__*/React.createElement(S.Skeleton, {
55
- numberOfSkeletons: 1,
56
- size: "L",
57
- width: "L",
58
- height: 18
59
- }) : total)), /*#__PURE__*/React.createElement(S.EstimationBody, null, showProgressBarSkeleton ? /*#__PURE__*/React.createElement(EstimationProgressBarSkeleton, null) : (progressBarValues == null ? void 0 : progressBarValues.length) && !isLoading && /*#__PURE__*/React.createElement(EstimationProgressBar, {
60
- values: progressBarValues
61
- })), (footerButtons || shouldRenderFooterLeftSide) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.EstimationDivider, {
62
- dashed: true
63
- }), /*#__PURE__*/React.createElement(S.EstimationFooter, {
64
- "data-testid": "estimation-footer"
65
- }, /*#__PURE__*/React.createElement(S.EstimationCalculated, null, footerLeftSide), footerButtons && /*#__PURE__*/React.createElement(S.EstimationRightSide, null, footerButtons)))));
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import InlineAlert from "@synerise/ds-inline-alert";
3
+ import Panel from "@synerise/ds-panel";
4
+ import { EstimationWrapper, EstimationInner, EstimationHead, EstimationLeftSide, Skeleton, EstimationTitle, EstimationRightSide, EstimationBody, EstimationDivider, EstimationFooter, EstimationCalculated } from "./Estimation.styles.js";
5
+ import { EstimationCalculatedDate } from "./components/EstimationCalculated.js";
6
+ import { EstimationProgressBar } from "./components/EstimationProgressBar.js";
7
+ import { EstimationProgressBarSkeleton } from "./components/EstimationProgressBarSkeleton.js";
8
+ import { useDefaultTexts } from "./hooks/useDefaultTexts.js";
9
+ const Estimation = ({
10
+ value,
11
+ tooltip,
12
+ tooltipConfig,
13
+ label,
14
+ total,
15
+ footerButtons,
16
+ isLoading,
17
+ progressBarValues,
18
+ errorMessage,
19
+ texts: customTexts,
20
+ calculatedDate,
21
+ ...rest
22
+ }) => {
23
+ const texts = useDefaultTexts(customTexts);
24
+ const footerLeftSide = errorMessage ? /* @__PURE__ */ jsx(InlineAlert, { type: "alert", message: errorMessage }) : isLoading ? texts.loading : /* @__PURE__ */ jsx(EstimationCalculatedDate, { label: texts.calculated, calculatedDate });
25
+ const loadingParts = typeof isLoading === "object" ? isLoading : void 0;
26
+ const showTotalSkeleton = loadingParts?.total;
27
+ const showProgressBarSkeleton = loadingParts?.progressBar;
28
+ const shouldRenderTotal = total !== void 0 && (!isLoading || showTotalSkeleton);
29
+ const shouldRenderFooterLeftSide = Boolean(isLoading || errorMessage || calculatedDate);
30
+ return /* @__PURE__ */ jsx(EstimationWrapper, { ...rest, children: /* @__PURE__ */ jsx(Panel, { p: 16, pb: 12, label, tooltip, tooltipConfig, children: /* @__PURE__ */ jsxs(EstimationInner, { children: [
31
+ /* @__PURE__ */ jsxs(EstimationHead, { children: [
32
+ /* @__PURE__ */ jsx(EstimationLeftSide, { children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "L", width: "L", height: 28 }) : /* @__PURE__ */ jsx(EstimationTitle, { level: 1, children: value }) }),
33
+ shouldRenderTotal && /* @__PURE__ */ jsx(EstimationRightSide, { children: showTotalSkeleton ? /* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "L", width: "L", height: 18 }) : total })
34
+ ] }),
35
+ /* @__PURE__ */ jsx(EstimationBody, { children: showProgressBarSkeleton ? /* @__PURE__ */ jsx(EstimationProgressBarSkeleton, {}) : progressBarValues?.length && !isLoading && /* @__PURE__ */ jsx(EstimationProgressBar, { values: progressBarValues }) }),
36
+ (footerButtons || shouldRenderFooterLeftSide) && /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ /* @__PURE__ */ jsx(EstimationDivider, { dashed: true }),
38
+ /* @__PURE__ */ jsxs(EstimationFooter, { "data-testid": "estimation-footer", children: [
39
+ /* @__PURE__ */ jsx(EstimationCalculated, { children: footerLeftSide }),
40
+ footerButtons && /* @__PURE__ */ jsx(EstimationRightSide, { children: footerButtons })
41
+ ] })
42
+ ] })
43
+ ] }) }) });
44
+ };
45
+ export {
46
+ Estimation as default
66
47
  };
67
- export default Estimation;
@@ -1,17 +1,15 @@
1
- export declare const Skeleton: import("styled-components").StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import("@synerise/ds-skeleton").SkeletonProps) => React.JSX.Element, any, {
1
+ export declare const Skeleton: import('styled-components').StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import('@synerise/ds-skeleton').SkeletonProps) => React.JSX.Element, any, {
2
2
  $width?: number;
3
3
  }, never>;
4
- export declare const EstimationDivider: import("styled-components").StyledComponent<(props: import("@synerise/ds-divider").DividerProps) => React.JSX.Element, any, {}, never>;
5
- export declare const EstimationTitle: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => React.JSX.Element, any, {}, never>;
6
- export declare const EstimationWrapper: import("styled-components").StyledComponent<"div", any, {
7
- isLoading?: boolean;
8
- }, never>;
9
- export declare const Bold: import("styled-components").StyledComponent<"span", any, {}, never>;
10
- export declare const EstimationContent: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("@synerise/ds-panel").PanelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
11
- export declare const EstimationHead: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const EstimationBody: import("styled-components").StyledComponent<"div", any, {}, never>;
13
- export declare const EstimationFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
14
- export declare const EstimationCalculated: import("styled-components").StyledComponent<"div", any, {}, never>;
15
- export declare const EstimationCalculatedDate: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => React.JSX.Element, any, {}, never>;
16
- export declare const EstimationLeftSide: import("styled-components").StyledComponent<"div", any, {}, never>;
17
- export declare const EstimationRightSide: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const EstimationDivider: import('styled-components').StyledComponent<(props: import('@synerise/ds-divider').DividerProps) => React.JSX.Element, any, {}, never>;
5
+ export declare const EstimationTitle: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
6
+ export declare const EstimationWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
7
+ export declare const Bold: import('styled-components').StyledComponent<"span", any, {}, never>;
8
+ export declare const EstimationInner: import('styled-components').StyledComponent<"div", any, {}, never>;
9
+ export declare const EstimationHead: import('styled-components').StyledComponent<"div", any, {}, never>;
10
+ export declare const EstimationBody: import('styled-components').StyledComponent<"div", any, {}, never>;
11
+ export declare const EstimationFooter: import('styled-components').StyledComponent<"div", any, {}, never>;
12
+ export declare const EstimationCalculated: import('styled-components').StyledComponent<"div", any, {}, never>;
13
+ export declare const EstimationCalculatedDate: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
14
+ export declare const EstimationLeftSide: import('styled-components').StyledComponent<"div", any, {}, never>;
15
+ export declare const EstimationRightSide: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,60 +1,72 @@
1
- import styled, { css } from 'styled-components';
2
- import Divider from '@synerise/ds-divider';
3
- import Panel from '@synerise/ds-panel';
4
- import DSSkeleton from '@synerise/ds-skeleton';
5
- import { Title } from '@synerise/ds-typography';
6
- var splitStyles = css(["display:flex;align-items:center;justify-content:space-between;"]);
7
- export var Skeleton = styled(DSSkeleton).withConfig({
1
+ import styled, { css } from "styled-components";
2
+ import Divider from "@synerise/ds-divider";
3
+ import DSSkeleton from "@synerise/ds-skeleton";
4
+ import { Title } from "@synerise/ds-typography";
5
+ const splitStyles = /* @__PURE__ */ css(["display:flex;align-items:center;justify-content:space-between;"]);
6
+ const Skeleton = /* @__PURE__ */ styled(DSSkeleton).withConfig({
8
7
  displayName: "Estimationstyles__Skeleton",
9
8
  componentId: "sc-scc0bk-0"
10
- })(["padding:0;width:", "px;"], function (props) {
11
- return props.$width || '100';
12
- });
13
- export var EstimationDivider = styled(Divider).withConfig({
9
+ })(["padding:0;width:", "px;"], (props) => props.$width || "100");
10
+ const EstimationDivider = /* @__PURE__ */ styled(Divider).withConfig({
14
11
  displayName: "Estimationstyles__EstimationDivider",
15
12
  componentId: "sc-scc0bk-1"
16
13
  })(["margin:8px 0;"]);
17
- export var EstimationTitle = styled(Title).withConfig({
14
+ const EstimationTitle = /* @__PURE__ */ styled(Title).withConfig({
18
15
  displayName: "Estimationstyles__EstimationTitle",
19
16
  componentId: "sc-scc0bk-2"
20
17
  })(["margin:0;"]);
21
- export var EstimationWrapper = styled.div.withConfig({
18
+ const EstimationWrapper = /* @__PURE__ */ styled.div.withConfig({
22
19
  displayName: "Estimationstyles__EstimationWrapper",
23
20
  componentId: "sc-scc0bk-3"
24
- })(["display:flex;flex-direction:column;gap:8px;"]);
25
- export var Bold = styled.span.withConfig({
21
+ })([""]);
22
+ const Bold = /* @__PURE__ */ styled.span.withConfig({
26
23
  displayName: "Estimationstyles__Bold",
27
24
  componentId: "sc-scc0bk-4"
28
25
  })(["font-weight:500;"]);
29
- export var EstimationContent = styled(Panel).withConfig({
30
- displayName: "Estimationstyles__EstimationContent",
26
+ const EstimationInner = /* @__PURE__ */ styled.div.withConfig({
27
+ displayName: "Estimationstyles__EstimationInner",
31
28
  componentId: "sc-scc0bk-5"
32
29
  })(["display:flex;flex-direction:column;gap:4px;"]);
33
- export var EstimationHead = styled.div.withConfig({
30
+ const EstimationHead = /* @__PURE__ */ styled.div.withConfig({
34
31
  displayName: "Estimationstyles__EstimationHead",
35
32
  componentId: "sc-scc0bk-6"
36
33
  })(["", ""], splitStyles);
37
- export var EstimationBody = styled.div.withConfig({
34
+ const EstimationBody = /* @__PURE__ */ styled.div.withConfig({
38
35
  displayName: "Estimationstyles__EstimationBody",
39
36
  componentId: "sc-scc0bk-7"
40
37
  })([""]);
41
- export var EstimationFooter = styled.div.withConfig({
38
+ const EstimationFooter = /* @__PURE__ */ styled.div.withConfig({
42
39
  displayName: "Estimationstyles__EstimationFooter",
43
40
  componentId: "sc-scc0bk-8"
44
41
  })(["", ""], splitStyles);
45
- export var EstimationCalculated = styled.div.withConfig({
42
+ const EstimationCalculated = /* @__PURE__ */ styled.div.withConfig({
46
43
  displayName: "Estimationstyles__EstimationCalculated",
47
44
  componentId: "sc-scc0bk-9"
48
45
  })([""]);
49
- export var EstimationCalculatedDate = styled(Title).withConfig({
46
+ const EstimationCalculatedDate = /* @__PURE__ */ styled(Title).withConfig({
50
47
  displayName: "Estimationstyles__EstimationCalculatedDate",
51
48
  componentId: "sc-scc0bk-10"
52
49
  })(["margin:0;display:inline;"]);
53
- export var EstimationLeftSide = styled.div.withConfig({
50
+ const EstimationLeftSide = /* @__PURE__ */ styled.div.withConfig({
54
51
  displayName: "Estimationstyles__EstimationLeftSide",
55
52
  componentId: "sc-scc0bk-11"
56
53
  })([""]);
57
- export var EstimationRightSide = styled.div.withConfig({
54
+ const EstimationRightSide = /* @__PURE__ */ styled.div.withConfig({
58
55
  displayName: "Estimationstyles__EstimationRightSide",
59
56
  componentId: "sc-scc0bk-12"
60
- })(["display:flex;gap:8px;"]);
57
+ })(["display:flex;gap:8px;"]);
58
+ export {
59
+ Bold,
60
+ EstimationBody,
61
+ EstimationCalculated,
62
+ EstimationCalculatedDate,
63
+ EstimationDivider,
64
+ EstimationFooter,
65
+ EstimationHead,
66
+ EstimationInner,
67
+ EstimationLeftSide,
68
+ EstimationRightSide,
69
+ EstimationTitle,
70
+ EstimationWrapper,
71
+ Skeleton
72
+ };
@@ -1,7 +1,7 @@
1
- import { type ReactNode } from 'react';
2
- import { type BaseLabelProps } from '@synerise/ds-form-field';
3
- import { type ProgressValue } from '@synerise/ds-progress-bar';
4
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactNode } from 'react';
2
+ import { BaseLabelProps } from '@synerise/ds-form-field';
3
+ import { ProgressValue } from '@synerise/ds-progress-bar';
4
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
5
5
  export type EstimationProgressValue = ProgressValue & {
6
6
  label?: ReactNode;
7
7
  };
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type EstimationCalculatedDateProps } from '../Estimation.types';
1
+ import { default as React } from 'react';
2
+ import { EstimationCalculatedDateProps } from '../Estimation.types';
3
3
  export declare const EstimationCalculatedDate: ({ label, calculatedDate, }: EstimationCalculatedDateProps) => React.JSX.Element;
@@ -1,13 +1,17 @@
1
- import React from 'react';
2
- import { FormattedRelativeDateTimeTo } from '@synerise/ds-core';
3
- import * as S from '../Estimation.styles';
4
- export var EstimationCalculatedDate = function EstimationCalculatedDate(_ref) {
5
- var label = _ref.label,
6
- calculatedDate = _ref.calculatedDate;
7
- var estimationDate = calculatedDate instanceof Date ? /*#__PURE__*/React.createElement(FormattedRelativeDateTimeTo, {
8
- value: calculatedDate
9
- }) : calculatedDate;
10
- return /*#__PURE__*/React.createElement(React.Fragment, null, label, ' ', /*#__PURE__*/React.createElement(S.EstimationCalculatedDate, {
11
- level: 6
12
- }, estimationDate));
13
- };
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { FormattedRelativeDateTimeTo } from "@synerise/ds-core";
3
+ import { EstimationCalculatedDate as EstimationCalculatedDate$1 } from "../Estimation.styles.js";
4
+ const EstimationCalculatedDate = ({
5
+ label,
6
+ calculatedDate
7
+ }) => {
8
+ const estimationDate = calculatedDate instanceof Date ? /* @__PURE__ */ jsx(FormattedRelativeDateTimeTo, { value: calculatedDate }) : calculatedDate;
9
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10
+ label,
11
+ " ",
12
+ /* @__PURE__ */ jsx(EstimationCalculatedDate$1, { level: 6, children: estimationDate })
13
+ ] });
14
+ };
15
+ export {
16
+ EstimationCalculatedDate
17
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type EstimationProgressValue } from '../Estimation.types';
1
+ import { default as React } from 'react';
2
+ import { EstimationProgressValue } from '../Estimation.types';
3
3
  type EstimationProgressBarProps = {
4
4
  values: EstimationProgressValue[];
5
5
  };
@@ -1,29 +1,33 @@
1
- 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); }
2
- import React, { useMemo } from 'react';
3
- import * as S from './EstimationProgressBar.styles';
4
- export var EstimationProgressBar = function EstimationProgressBar(_ref) {
5
- var progressBarValues = _ref.values;
6
- var _useMemo = useMemo(function () {
7
- var values = [];
8
- var legend = [];
9
- progressBarValues.forEach(function (value) {
10
- values.push(_extends({}, value));
11
- if (value.label) {
12
- legend.push(/*#__PURE__*/React.createElement(S.EstimationProgressBarLegendItem, {
13
- dotColor: value.color
14
- }, /*#__PURE__*/React.createElement("span", null, value.label)));
15
- }
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { EstimationProgressBarLegendItem, EstimationProgressBar as EstimationProgressBar$1, EstimationProgressBarLegend } from "./EstimationProgressBar.styles.js";
4
+ const EstimationProgressBar = ({
5
+ values: progressBarValues
6
+ }) => {
7
+ const {
8
+ progressValues,
9
+ progressLegend
10
+ } = useMemo(() => {
11
+ const values = [];
12
+ const legend = [];
13
+ progressBarValues.forEach((value) => {
14
+ values.push({
15
+ ...value
16
16
  });
17
- return {
18
- progressValues: values,
19
- progressLegend: legend
20
- };
21
- }, [progressBarValues]),
22
- progressValues = _useMemo.progressValues,
23
- progressLegend = _useMemo.progressLegend;
24
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.EstimationProgressBar, {
25
- "data-testid": "estimation-progressbar",
26
- values: progressValues,
27
- stackedBars: false
28
- }), (progressLegend == null ? void 0 : progressLegend.length) > 0 && /*#__PURE__*/React.createElement(S.EstimationProgressBarLegend, null, progressLegend));
29
- };
17
+ if (value.label) {
18
+ legend.push(/* @__PURE__ */ jsx(EstimationProgressBarLegendItem, { dotColor: value.color, children: /* @__PURE__ */ jsx("span", { children: value.label }) }));
19
+ }
20
+ });
21
+ return {
22
+ progressValues: values,
23
+ progressLegend: legend
24
+ };
25
+ }, [progressBarValues]);
26
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
27
+ /* @__PURE__ */ jsx(EstimationProgressBar$1, { "data-testid": "estimation-progressbar", values: progressValues, stackedBars: false }),
28
+ progressLegend?.length > 0 && /* @__PURE__ */ jsx(EstimationProgressBarLegend, { children: progressLegend })
29
+ ] });
30
+ };
31
+ export {
32
+ EstimationProgressBar
33
+ };
@@ -1,5 +1,5 @@
1
- export declare const EstimationProgressBar: import("styled-components").StyledComponent<({ values, stackedBars, ...htmlAttributes }: import("@synerise/ds-progress-bar").MultivalueProps) => React.JSX.Element, any, {}, never>;
2
- export declare const EstimationProgressBarLegend: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const EstimationProgressBarLegendItem: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const EstimationProgressBar: import('styled-components').StyledComponent<({ values, stackedBars, ...htmlAttributes }: import('@synerise/ds-progress-bar').MultivalueProps) => React.JSX.Element, any, {}, never>;
2
+ export declare const EstimationProgressBarLegend: import('styled-components').StyledComponent<"div", any, {}, never>;
3
+ export declare const EstimationProgressBarLegendItem: import('styled-components').StyledComponent<"div", any, {
4
4
  dotColor: string;
5
5
  }, never>;
@@ -1,18 +1,19 @@
1
- import styled from 'styled-components';
2
- import { Multivalue } from '@synerise/ds-progress-bar';
3
- export var EstimationProgressBar = styled(Multivalue).withConfig({
1
+ import styled from "styled-components";
2
+ import { Multivalue } from "@synerise/ds-progress-bar";
3
+ const EstimationProgressBar = /* @__PURE__ */ styled(Multivalue).withConfig({
4
4
  displayName: "EstimationProgressBarstyles__EstimationProgressBar",
5
5
  componentId: "sc-10gbufd-0"
6
6
  })(["height:auto;padding:0;margin:14px 0 8px;"]);
7
- export var EstimationProgressBarLegend = styled.div.withConfig({
7
+ const EstimationProgressBarLegend = /* @__PURE__ */ styled.div.withConfig({
8
8
  displayName: "EstimationProgressBarstyles__EstimationProgressBarLegend",
9
9
  componentId: "sc-10gbufd-1"
10
10
  })(["display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding-top:4px;"]);
11
- export var EstimationProgressBarLegendItem = styled.div.withConfig({
11
+ const EstimationProgressBarLegendItem = /* @__PURE__ */ styled.div.withConfig({
12
12
  displayName: "EstimationProgressBarstyles__EstimationProgressBarLegendItem",
13
13
  componentId: "sc-10gbufd-2"
14
- })(["display:flex;align-items:center;gap:8px;&:before{content:'';width:10px;height:10px;background:", ";border-radius:0.5em;border:solid 2px ", ";}"], function (props) {
15
- return props.dotColor;
16
- }, function (props) {
17
- return props.theme.palette['white'];
18
- });
14
+ })(["display:flex;align-items:center;gap:8px;&:before{content:'';width:10px;height:10px;background:", ";border-radius:0.5em;border:solid 2px ", ";}"], (props) => props.dotColor, (props) => props.theme.palette["white"]);
15
+ export {
16
+ EstimationProgressBar,
17
+ EstimationProgressBarLegend,
18
+ EstimationProgressBarLegendItem
19
+ };
@@ -1,2 +1,2 @@
1
- import React from 'react';
1
+ import { default as React } from 'react';
2
2
  export declare const EstimationProgressBarSkeleton: () => React.JSX.Element;
@@ -1,20 +1,18 @@
1
- import React from 'react';
2
- import { useTheme } from '@synerise/ds-core';
3
- import { Skeleton } from '../Estimation.styles';
4
- import * as S from './EstimationProgressBar.styles';
5
- export var EstimationProgressBarSkeleton = function EstimationProgressBarSkeleton() {
6
- var theme = useTheme();
7
- var EMPTY_VALUE = {
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "@synerise/ds-core";
3
+ import { Skeleton } from "../Estimation.styles.js";
4
+ import { EstimationProgressBar, EstimationProgressBarLegend } from "./EstimationProgressBar.styles.js";
5
+ const EstimationProgressBarSkeleton = () => {
6
+ const theme = useTheme();
7
+ const EMPTY_VALUE = {
8
8
  percent: 100,
9
- color: theme.palette['grey-200']
9
+ color: theme.palette["grey-200"]
10
10
  };
11
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.EstimationProgressBar, {
12
- "data-testid": "estimation-progressbar-skeleton",
13
- values: [EMPTY_VALUE],
14
- stackedBars: false
15
- }), /*#__PURE__*/React.createElement(S.EstimationProgressBarLegend, null, /*#__PURE__*/React.createElement(Skeleton, {
16
- height: 18,
17
- numberOfSkeletons: 1,
18
- $width: 142
19
- })));
20
- };
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsx(EstimationProgressBar, { "data-testid": "estimation-progressbar-skeleton", values: [EMPTY_VALUE], stackedBars: false }),
13
+ /* @__PURE__ */ jsx(EstimationProgressBarLegend, { children: /* @__PURE__ */ jsx(Skeleton, { height: 18, numberOfSkeletons: 1, $width: 142 }) })
14
+ ] });
15
+ };
16
+ export {
17
+ EstimationProgressBarSkeleton
18
+ };
@@ -1,2 +1,2 @@
1
- import { type EstimationTexts } from '../Estimation.types';
1
+ import { EstimationTexts } from '../Estimation.types';
2
2
  export declare const useDefaultTexts: (defaultTexts?: Partial<EstimationTexts>) => EstimationTexts;
@@ -1,15 +1,12 @@
1
- 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); }
2
- import React from 'react';
3
- import { FormattedMessage } from 'react-intl';
4
- export var useDefaultTexts = function useDefaultTexts(defaultTexts) {
5
- return _extends({
6
- loading: /*#__PURE__*/React.createElement(FormattedMessage, {
7
- id: "DS.ESTIMATION.LOADING",
8
- defaultMessage: "Loading..."
9
- }),
10
- calculated: /*#__PURE__*/React.createElement(FormattedMessage, {
11
- id: "DS.ESTIMATION.CALCULATED",
12
- defaultMessage: "Calculated:"
13
- })
14
- }, defaultTexts || {});
15
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ const useDefaultTexts = (defaultTexts) => {
4
+ return {
5
+ loading: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.ESTIMATION.LOADING", defaultMessage: "Loading..." }),
6
+ calculated: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.ESTIMATION.CALCULATED", defaultMessage: "Calculated:" }),
7
+ ...defaultTexts || {}
8
+ };
9
+ };
10
+ export {
11
+ useDefaultTexts
12
+ };
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './Estimation';
1
+ import { default as default2 } from "./Estimation.js";
2
+ export {
3
+ default2 as default
4
+ };
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-estimation",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "Estimation 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
  "prepublish": "pnpm run build",
25
25
  "types": "tsc --noEmit",
@@ -35,14 +35,14 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-divider": "^1.3.0",
39
- "@synerise/ds-form-field": "^1.3.8",
40
- "@synerise/ds-inline-alert": "^1.1.13",
41
- "@synerise/ds-panel": "^1.2.1",
42
- "@synerise/ds-progress-bar": "^1.1.40",
43
- "@synerise/ds-skeleton": "^1.0.43",
44
- "@synerise/ds-typography": "^1.1.11",
45
- "@synerise/ds-utils": "^1.6.0"
38
+ "@synerise/ds-divider": "^1.3.2",
39
+ "@synerise/ds-form-field": "^1.3.10",
40
+ "@synerise/ds-inline-alert": "^1.1.15",
41
+ "@synerise/ds-panel": "^1.2.3",
42
+ "@synerise/ds-progress-bar": "^1.2.1",
43
+ "@synerise/ds-skeleton": "^1.0.45",
44
+ "@synerise/ds-typography": "^1.1.13",
45
+ "@synerise/ds-utils": "^1.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@synerise/ds-core": "*",
@@ -50,5 +50,5 @@
50
50
  "react-intl": ">=3.12.0 <= 6.8",
51
51
  "styled-components": "^5.3.3"
52
52
  },
53
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
53
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
54
54
  }
@@ -1 +0,0 @@
1
- export {};