@synerise/ds-estimation 1.4.10 → 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 +4 -0
- package/dist/Estimation.d.ts +2 -2
- package/dist/Estimation.js +46 -62
- package/dist/Estimation.styles.d.ts +13 -13
- package/dist/Estimation.styles.js +35 -22
- package/dist/Estimation.types.d.ts +4 -4
- package/dist/Estimation.types.js +1 -1
- package/dist/components/EstimationCalculated.d.ts +2 -2
- package/dist/components/EstimationCalculated.js +17 -13
- package/dist/components/EstimationProgressBar.d.ts +2 -2
- package/dist/components/EstimationProgressBar.js +32 -28
- package/dist/components/EstimationProgressBar.styles.d.ts +3 -3
- package/dist/components/EstimationProgressBar.styles.js +11 -10
- package/dist/components/EstimationProgressBarSkeleton.d.ts +1 -1
- package/dist/components/EstimationProgressBarSkeleton.js +16 -18
- package/dist/hooks/useDefaultTexts.d.ts +1 -1
- package/dist/hooks/useDefaultTexts.js +12 -15
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +12 -12
- package/dist/Estimation.spec.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/dist/Estimation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
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;
|
package/dist/Estimation.js
CHANGED
|
@@ -1,63 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
height: 28
|
|
48
|
-
}) : /*#__PURE__*/React.createElement(S.EstimationTitle, {
|
|
49
|
-
level: 1
|
|
50
|
-
}, value)), shouldRenderTotal && /*#__PURE__*/React.createElement(S.EstimationRightSide, null, showTotalSkeleton ? /*#__PURE__*/React.createElement(S.Skeleton, {
|
|
51
|
-
numberOfSkeletons: 1,
|
|
52
|
-
size: "L",
|
|
53
|
-
width: "L",
|
|
54
|
-
height: 18
|
|
55
|
-
}) : total)), /*#__PURE__*/React.createElement(S.EstimationBody, null, showProgressBarSkeleton ? /*#__PURE__*/React.createElement(EstimationProgressBarSkeleton, null) : (progressBarValues == null ? void 0 : progressBarValues.length) && !isLoading && /*#__PURE__*/React.createElement(EstimationProgressBar, {
|
|
56
|
-
values: progressBarValues
|
|
57
|
-
})), (footerButtons || shouldRenderFooterLeftSide) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.EstimationDivider, {
|
|
58
|
-
dashed: true
|
|
59
|
-
}), /*#__PURE__*/React.createElement(S.EstimationFooter, {
|
|
60
|
-
"data-testid": "estimation-footer"
|
|
61
|
-
}, /*#__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
|
|
62
47
|
};
|
|
63
|
-
export default Estimation;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare const Skeleton: import(
|
|
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(
|
|
5
|
-
export declare const EstimationTitle: import(
|
|
6
|
-
export declare const EstimationWrapper: import(
|
|
7
|
-
export declare const Bold: import(
|
|
8
|
-
export declare const EstimationInner: import(
|
|
9
|
-
export declare const EstimationHead: import(
|
|
10
|
-
export declare const EstimationBody: import(
|
|
11
|
-
export declare const EstimationFooter: import(
|
|
12
|
-
export declare const EstimationCalculated: import(
|
|
13
|
-
export declare const EstimationCalculatedDate: import(
|
|
14
|
-
export declare const EstimationLeftSide: import(
|
|
15
|
-
export declare const EstimationRightSide: import(
|
|
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,59 +1,72 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import Divider from
|
|
3
|
-
import DSSkeleton from
|
|
4
|
-
import { Title } from
|
|
5
|
-
|
|
6
|
-
|
|
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({
|
|
7
7
|
displayName: "Estimationstyles__Skeleton",
|
|
8
8
|
componentId: "sc-scc0bk-0"
|
|
9
|
-
})(["padding:0;width:", "px;"],
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
export var EstimationDivider = styled(Divider).withConfig({
|
|
9
|
+
})(["padding:0;width:", "px;"], (props) => props.$width || "100");
|
|
10
|
+
const EstimationDivider = /* @__PURE__ */ styled(Divider).withConfig({
|
|
13
11
|
displayName: "Estimationstyles__EstimationDivider",
|
|
14
12
|
componentId: "sc-scc0bk-1"
|
|
15
13
|
})(["margin:8px 0;"]);
|
|
16
|
-
|
|
14
|
+
const EstimationTitle = /* @__PURE__ */ styled(Title).withConfig({
|
|
17
15
|
displayName: "Estimationstyles__EstimationTitle",
|
|
18
16
|
componentId: "sc-scc0bk-2"
|
|
19
17
|
})(["margin:0;"]);
|
|
20
|
-
|
|
18
|
+
const EstimationWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
21
19
|
displayName: "Estimationstyles__EstimationWrapper",
|
|
22
20
|
componentId: "sc-scc0bk-3"
|
|
23
21
|
})([""]);
|
|
24
|
-
|
|
22
|
+
const Bold = /* @__PURE__ */ styled.span.withConfig({
|
|
25
23
|
displayName: "Estimationstyles__Bold",
|
|
26
24
|
componentId: "sc-scc0bk-4"
|
|
27
25
|
})(["font-weight:500;"]);
|
|
28
|
-
|
|
26
|
+
const EstimationInner = /* @__PURE__ */ styled.div.withConfig({
|
|
29
27
|
displayName: "Estimationstyles__EstimationInner",
|
|
30
28
|
componentId: "sc-scc0bk-5"
|
|
31
29
|
})(["display:flex;flex-direction:column;gap:4px;"]);
|
|
32
|
-
|
|
30
|
+
const EstimationHead = /* @__PURE__ */ styled.div.withConfig({
|
|
33
31
|
displayName: "Estimationstyles__EstimationHead",
|
|
34
32
|
componentId: "sc-scc0bk-6"
|
|
35
33
|
})(["", ""], splitStyles);
|
|
36
|
-
|
|
34
|
+
const EstimationBody = /* @__PURE__ */ styled.div.withConfig({
|
|
37
35
|
displayName: "Estimationstyles__EstimationBody",
|
|
38
36
|
componentId: "sc-scc0bk-7"
|
|
39
37
|
})([""]);
|
|
40
|
-
|
|
38
|
+
const EstimationFooter = /* @__PURE__ */ styled.div.withConfig({
|
|
41
39
|
displayName: "Estimationstyles__EstimationFooter",
|
|
42
40
|
componentId: "sc-scc0bk-8"
|
|
43
41
|
})(["", ""], splitStyles);
|
|
44
|
-
|
|
42
|
+
const EstimationCalculated = /* @__PURE__ */ styled.div.withConfig({
|
|
45
43
|
displayName: "Estimationstyles__EstimationCalculated",
|
|
46
44
|
componentId: "sc-scc0bk-9"
|
|
47
45
|
})([""]);
|
|
48
|
-
|
|
46
|
+
const EstimationCalculatedDate = /* @__PURE__ */ styled(Title).withConfig({
|
|
49
47
|
displayName: "Estimationstyles__EstimationCalculatedDate",
|
|
50
48
|
componentId: "sc-scc0bk-10"
|
|
51
49
|
})(["margin:0;display:inline;"]);
|
|
52
|
-
|
|
50
|
+
const EstimationLeftSide = /* @__PURE__ */ styled.div.withConfig({
|
|
53
51
|
displayName: "Estimationstyles__EstimationLeftSide",
|
|
54
52
|
componentId: "sc-scc0bk-11"
|
|
55
53
|
})([""]);
|
|
56
|
-
|
|
54
|
+
const EstimationRightSide = /* @__PURE__ */ styled.div.withConfig({
|
|
57
55
|
displayName: "Estimationstyles__EstimationRightSide",
|
|
58
56
|
componentId: "sc-scc0bk-12"
|
|
59
|
-
})(["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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
};
|
package/dist/Estimation.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
|
2
|
-
import { FormattedRelativeDateTimeTo } from
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 {
|
|
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
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
stackedBars: false
|
|
28
|
-
|
|
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(
|
|
2
|
-
export declare const EstimationProgressBarLegend: import(
|
|
3
|
-
export declare const EstimationProgressBarLegendItem: import(
|
|
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
|
|
2
|
-
import { Multivalue } from
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 ", ";}"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
2
|
-
import { useTheme } from
|
|
3
|
-
import { Skeleton } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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[
|
|
9
|
+
color: theme.palette["grey-200"]
|
|
10
10
|
};
|
|
11
|
-
return
|
|
12
|
-
"data-testid": "estimation-progressbar-skeleton",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 {
|
|
1
|
+
import { EstimationTexts } from '../Estimation.types';
|
|
2
2
|
export declare const useDefaultTexts: (defaultTexts?: Partial<EstimationTexts>) => EstimationTexts;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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.
|
|
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": "
|
|
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": "
|
|
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.
|
|
39
|
-
"@synerise/ds-form-field": "^1.3.
|
|
40
|
-
"@synerise/ds-inline-alert": "^1.1.
|
|
41
|
-
"@synerise/ds-panel": "^1.2.
|
|
42
|
-
"@synerise/ds-progress-bar": "^1.2.
|
|
43
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
44
|
-
"@synerise/ds-typography": "^1.1.
|
|
45
|
-
"@synerise/ds-utils": "^1.7.
|
|
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": "
|
|
53
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
54
54
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|