@spaced-out/ui-design-system 0.6.12 → 0.6.13
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 +7 -0
- package/lib/components/ProgressDonut/ProgressDonut.d.ts +2 -0
- package/lib/components/ProgressDonut/ProgressDonut.d.ts.map +1 -1
- package/lib/components/ProgressDonut/ProgressDonut.js +18 -2
- package/lib/components/ProgressDonut/ProgressDonut.module.css +4 -0
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.6.13](https://github.com/spaced-out/ui-design-system/compare/v0.6.12...v0.6.13) (2026-04-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **ProgressDonut:** add icon support in center slot ([#478](https://github.com/spaced-out/ui-design-system/issues/478)) ([4c1a30e](https://github.com/spaced-out/ui-design-system/commit/4c1a30e5033fa544cea7ac3511b5c250c5f52a7d))
|
|
11
|
+
|
|
5
12
|
### [0.6.12](https://github.com/spaced-out/ui-design-system/compare/v0.6.11...v0.6.12) (2026-04-22)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Flow } from 'flow-to-typescript-codemod';
|
|
2
2
|
import * as COLORS from '../../styles/variables/_color';
|
|
3
|
+
import type { IconProps } from '../../components/Icon';
|
|
3
4
|
type ClassNames = Readonly<{
|
|
4
5
|
wrapper?: string;
|
|
5
6
|
donutChart?: string;
|
|
@@ -9,6 +10,7 @@ export type ProgressDonutProps = {
|
|
|
9
10
|
color?: keyof typeof COLORS;
|
|
10
11
|
size?: 'small' | 'medium';
|
|
11
12
|
testId?: string;
|
|
13
|
+
icon?: Omit<IconProps, 'size'>;
|
|
12
14
|
} & ({
|
|
13
15
|
percentage?: number;
|
|
14
16
|
rating?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressDonut.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressDonut/ProgressDonut.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressDonut.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressDonut/ProgressDonut.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAItD,OAAO,KAAK,EAAC,SAAS,EAAW,MAAM,qBAAqB,CAAC;AA0B7D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAChC,GAAG,CACA;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAC,GACrC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAC,CACvC,CAAC;AAcF,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAChD,kBAAkB,EAClB,cAAc,CAgHf,CAAC"}
|
|
@@ -8,6 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var COLORS = _interopRequireWildcard(require("../../styles/variables/_color"));
|
|
9
9
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
10
10
|
var _qa = require("../../utils/qa");
|
|
11
|
+
var _Icon = require("../Icon");
|
|
11
12
|
var _Text = require("../Text");
|
|
12
13
|
var _ProgressDonutModule = _interopRequireDefault(require("./ProgressDonut.module.css"));
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -31,6 +32,10 @@ const DONUT_CONFIG = {
|
|
|
31
32
|
strokeWidth: 8
|
|
32
33
|
}
|
|
33
34
|
};
|
|
35
|
+
const DONUT_TO_ICON_SIZE = {
|
|
36
|
+
small: 'small',
|
|
37
|
+
medium: 'large'
|
|
38
|
+
};
|
|
34
39
|
const getProgressDonutColor = percentage => {
|
|
35
40
|
if (percentage >= SUCCESS_THRESHOLD) {
|
|
36
41
|
return COLORS.colorSuccess;
|
|
@@ -49,7 +54,8 @@ const ProgressDonut = exports.ProgressDonut = /*#__PURE__*/React.forwardRef((_re
|
|
|
49
54
|
rating,
|
|
50
55
|
color,
|
|
51
56
|
size = 'medium',
|
|
52
|
-
testId
|
|
57
|
+
testId,
|
|
58
|
+
icon
|
|
53
59
|
} = _ref;
|
|
54
60
|
const clampedRating = rating !== undefined ? Math.min(Math.max(Math.round(rating), MIN_RATING), MAX_RATING) : undefined;
|
|
55
61
|
const donutPercentage = React.useMemo(() => {
|
|
@@ -99,7 +105,17 @@ const ProgressDonut = exports.ProgressDonut = /*#__PURE__*/React.forwardRef((_re
|
|
|
99
105
|
stroke: COLORS[color || ''] || donutColor,
|
|
100
106
|
strokeLinecap: "round"
|
|
101
107
|
})]
|
|
102
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
108
|
+
}), icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: _ProgressDonutModule.default.donutChartIcon,
|
|
110
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
111
|
+
base: testId,
|
|
112
|
+
slot: 'icon'
|
|
113
|
+
}),
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
115
|
+
...icon,
|
|
116
|
+
size: DONUT_TO_ICON_SIZE[size]
|
|
117
|
+
})
|
|
118
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(TextComponent, {
|
|
103
119
|
className: (0, _classify.default)(_ProgressDonutModule.default.donutChartPercentage, {
|
|
104
120
|
[_ProgressDonutModule.default.donutChartPercentageSmallPercent]: size === 'small' && rating === undefined
|
|
105
121
|
}),
|
package/mcp/package.json
CHANGED