@synerise/ds-estimation 2.0.12 → 2.1.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 +19 -0
- package/CLAUDE.md +4 -2
- package/dist/Estimation.styles.d.ts +2 -2
- package/dist/components/EstimationProgressBar.js +12 -3
- package/dist/components/EstimationProgressBar.styles.d.ts +0 -3
- package/dist/components/EstimationProgressBar.styles.js +1 -6
- package/dist/components/EstimationProgressBarSkeleton.js +1 -3
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [2.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@2.1.0...@synerise/ds-estimation@2.1.1) (2026-11-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-estimation
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@2.0.12...@synerise/ds-estimation@2.1.0) (2026-10-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.12](https://github.com/Synerise/synerise-design/compare/@synerise/ds-estimation@2.0.11...@synerise/ds-estimation@2.0.12) (2026-10-28)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-estimation
|
package/CLAUDE.md
CHANGED
|
@@ -84,7 +84,7 @@ import Estimation from '@synerise/ds-estimation';
|
|
|
84
84
|
|
|
85
85
|
## Styling
|
|
86
86
|
|
|
87
|
-
All styles are in `Estimation.styles.ts`. The card body uses `Panel` from `@synerise/ds-panel` as the container. The dashed divider between content and footer is `Divider` from `@synerise/ds-divider`.
|
|
87
|
+
All styles are in `Estimation.styles.ts`. The card body uses `Panel` from `@synerise/ds-panel` as the container. The dashed divider between content and footer is `Divider` from `@synerise/ds-divider`. The styles set no colours of their own; the progress-bar skeleton track uses `var(--ds-progressbar-bar-bg-track)`. No hardcoded colour values.
|
|
88
88
|
|
|
89
89
|
## Custom hooks
|
|
90
90
|
|
|
@@ -100,10 +100,11 @@ Returns a complete `EstimationTexts` object. Requires an `IntlProvider` in the t
|
|
|
100
100
|
|
|
101
101
|
- `@synerise/ds-form-field` — `FormFieldLabel` and `BaseLabelProps` for the label/tooltip
|
|
102
102
|
- `@synerise/ds-progress-bar` — `Multivalue` component and `ProgressValue` type
|
|
103
|
+
- `@synerise/ds-badge` — `BadgeWithLabel` renders each colour-dot legend entry (dot + label); the dot colour is the per-value `color` passed via `customColor`
|
|
103
104
|
- `@synerise/ds-panel` — card container
|
|
104
105
|
- `@synerise/ds-inline-alert` — error state display
|
|
105
106
|
- `@synerise/ds-skeleton` — loading placeholders
|
|
106
|
-
- `@synerise/ds-core` — `FormattedRelativeDateTimeTo` for relative date
|
|
107
|
+
- `@synerise/ds-core` — `FormattedRelativeDateTimeTo` for relative date
|
|
107
108
|
- `react-intl` — i18n for default button labels
|
|
108
109
|
|
|
109
110
|
## Implementation notes
|
|
@@ -112,6 +113,7 @@ Returns a complete `EstimationTexts` object. Requires an `IntlProvider` in the t
|
|
|
112
113
|
- **`total` hidden when `isLoading=true`**: When `isLoading` is a plain `true` boolean, `total` is not rendered (not skeletonized). The skeleton variant `{ total: true }` replaces it with a skeleton.
|
|
113
114
|
- **Footer is conditional**: The footer (divider + footer row) only renders when `footerButtons` is provided OR at least one of `isLoading`, `errorMessage`, or `calculatedDate` is truthy.
|
|
114
115
|
- **`calculatedDate` type discrimination**: `calculatedDate instanceof Date` check determines whether to wrap with `FormattedRelativeDateTimeTo`. Any non-Date `ReactNode` is rendered verbatim.
|
|
116
|
+
- **Legend dot reuses `ds-badge`** — each labelled `progressBarValues` entry renders a `<BadgeWithLabel dot customColor={value.color}>{label}</BadgeWithLabel>` (dot + label, 8px gap owned by the badge). This replaced the old bespoke `EstimationProgressBarLegendItem` `:before` dot. Note: the DS-standard badge dot is a 6px ring-less dot, so the legend dot is slightly smaller and loses the old 2px white ring (flagged for Chromatic/UX).
|
|
115
117
|
- **`EstimationProgressValue` and `EstimationTexts` types are not exported** from `index.ts` — consumers must import them from the deep path or declare locally.
|
|
116
118
|
- **Uses Vitest** for testing.
|
|
117
119
|
- **`react-intl` is a peer dependency** — component will throw at runtime without an `IntlProvider` ancestor.
|
|
@@ -2,7 +2,7 @@ export declare const Skeleton: import('styled-components').StyledComponent<({ si
|
|
|
2
2
|
$width?: number;
|
|
3
3
|
}, never>;
|
|
4
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, ...rest }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
|
|
5
|
+
export declare const EstimationTitle: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...rest }: import('@synerise/ds-typography/dist/Title.types.js').Props) => React.JSX.Element, any, {}, never>;
|
|
6
6
|
export declare const EstimationWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
7
7
|
export declare const Bold: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
8
8
|
export declare const EstimationInner: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -10,6 +10,6 @@ export declare const EstimationHead: import('styled-components').StyledComponent
|
|
|
10
10
|
export declare const EstimationBody: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
11
11
|
export declare const EstimationFooter: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
12
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, ...rest }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
|
|
13
|
+
export declare const EstimationCalculatedDate: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...rest }: import('@synerise/ds-typography/dist/Title.types.js').Props) => React.JSX.Element, any, {}, never>;
|
|
14
14
|
export declare const EstimationLeftSide: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
15
15
|
export declare const EstimationRightSide: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { BadgeWithLabel } from "@synerise/ds-badge";
|
|
4
|
+
import { EstimationProgressBar as EstimationProgressBar$1, EstimationProgressBarLegend } from "./EstimationProgressBar.styles.js";
|
|
4
5
|
const EstimationProgressBar = ({
|
|
5
6
|
values: progressBarValues
|
|
6
7
|
}) => {
|
|
@@ -10,12 +11,20 @@ const EstimationProgressBar = ({
|
|
|
10
11
|
} = useMemo(() => {
|
|
11
12
|
const values = [];
|
|
12
13
|
const legend = [];
|
|
13
|
-
progressBarValues.forEach((value) => {
|
|
14
|
+
progressBarValues.forEach((value, index) => {
|
|
14
15
|
values.push({
|
|
15
16
|
...value
|
|
16
17
|
});
|
|
17
18
|
if (value.label) {
|
|
18
|
-
legend.push(/* @__PURE__ */ jsx(
|
|
19
|
+
legend.push(/* @__PURE__ */ jsx(
|
|
20
|
+
BadgeWithLabel,
|
|
21
|
+
{
|
|
22
|
+
dot: true,
|
|
23
|
+
customColor: value.color,
|
|
24
|
+
children: value.label
|
|
25
|
+
},
|
|
26
|
+
`${value.color}-${index}`
|
|
27
|
+
));
|
|
19
28
|
}
|
|
20
29
|
});
|
|
21
30
|
return {
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
export declare const EstimationProgressBar: import('styled-components').StyledComponent<({ values, stackedBars, ...htmlAttributes }: import('@synerise/ds-progress-bar').MultivalueProps) => React.JSX.Element, any, {}, never>;
|
|
2
2
|
export declare const EstimationProgressBarLegend: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const EstimationProgressBarLegendItem: import('styled-components').StyledComponent<"div", any, {
|
|
4
|
-
dotColor: string;
|
|
5
|
-
}, never>;
|
|
@@ -8,12 +8,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
|
-
const EstimationProgressBarLegendItem = /* @__PURE__ */ styled.div.withConfig({
|
|
12
|
-
displayName: "EstimationProgressBarstyles__EstimationProgressBarLegendItem",
|
|
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 ", ";}"], (props) => props.dotColor, (props) => props.theme.palette["white"]);
|
|
15
11
|
export {
|
|
16
12
|
EstimationProgressBar,
|
|
17
|
-
EstimationProgressBarLegend
|
|
18
|
-
EstimationProgressBarLegendItem
|
|
13
|
+
EstimationProgressBarLegend
|
|
19
14
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@synerise/ds-core";
|
|
3
2
|
import { Skeleton } from "../Estimation.styles.js";
|
|
4
3
|
import { EstimationProgressBar, EstimationProgressBarLegend } from "./EstimationProgressBar.styles.js";
|
|
5
4
|
const EstimationProgressBarSkeleton = () => {
|
|
6
|
-
const theme = useTheme();
|
|
7
5
|
const EMPTY_VALUE = {
|
|
8
6
|
percent: 100,
|
|
9
|
-
color:
|
|
7
|
+
color: "var(--ds-progressbar-bar-bg-track)"
|
|
10
8
|
};
|
|
11
9
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
10
|
/* @__PURE__ */ jsx(EstimationProgressBar, { "data-testid": "estimation-progressbar-skeleton", values: [EMPTY_VALUE], stackedBars: false }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-estimation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Estimation UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,14 +42,15 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-
|
|
46
|
-
"@synerise/ds-
|
|
47
|
-
"@synerise/ds-
|
|
48
|
-
"@synerise/ds-
|
|
49
|
-
"@synerise/ds-
|
|
50
|
-
"@synerise/ds-
|
|
51
|
-
"@synerise/ds-
|
|
52
|
-
"@synerise/ds-
|
|
45
|
+
"@synerise/ds-badge": "^2.1.1",
|
|
46
|
+
"@synerise/ds-divider": "^2.1.1",
|
|
47
|
+
"@synerise/ds-form-field": "^2.1.1",
|
|
48
|
+
"@synerise/ds-inline-alert": "^2.1.1",
|
|
49
|
+
"@synerise/ds-panel": "^2.1.1",
|
|
50
|
+
"@synerise/ds-progress-bar": "^2.1.1",
|
|
51
|
+
"@synerise/ds-skeleton": "^2.1.1",
|
|
52
|
+
"@synerise/ds-typography": "^2.1.1",
|
|
53
|
+
"@synerise/ds-utils": "^2.3.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"vitest": "4"
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
61
62
|
"styled-components": "^5.3.3"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
|
|
64
65
|
}
|