@alfalab/core-components-circular-progress-bar 2.2.1 → 2.3.2
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/dist/Component.d.ts +3 -2
- package/dist/Component.js +4 -4
- package/dist/cssm/Component.d.ts +3 -2
- package/dist/cssm/Component.js +3 -3
- package/dist/esm/Component.d.ts +3 -2
- package/dist/esm/Component.js +4 -4
- package/dist/esm/index.css +21 -21
- package/dist/index.css +21 -21
- package/dist/modern/Component.d.ts +3 -2
- package/dist/modern/Component.js +4 -4
- package/dist/modern/index.css +21 -21
- package/package.json +4 -4
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.3.1](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.3.0...@alfalab/core-components-circular-progress-bar@2.3.1) (2022-03-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @alfalab/core-components-circular-progress-bar
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.3.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.2.1...@alfalab/core-components-circular-progress-bar@2.3.0) (2022-03-05)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **circular-progress-bar:** ReactNode as title or subtitle ([#1023](https://github.com/alfa-laboratory/core-components/issues/1023)) ([7ae6df9](https://github.com/alfa-laboratory/core-components/commit/7ae6df9d2e4253f9a94532d155e81032cd96c810))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.2.1](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.2.0...@alfalab/core-components-circular-progress-bar@2.2.1) (2022-03-03)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @alfalab/core-components-circular-progress-bar
|
package/dist/Component.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
3
4
|
type CircularProgressBarProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Уровень прогресса, %
|
|
@@ -12,11 +13,11 @@ type CircularProgressBarProps = {
|
|
|
12
13
|
/**
|
|
13
14
|
* Основной текст
|
|
14
15
|
*/
|
|
15
|
-
title?:
|
|
16
|
+
title?: ReactNode;
|
|
16
17
|
/**
|
|
17
18
|
* Дополнительный текст
|
|
18
19
|
*/
|
|
19
|
-
subtitle?:
|
|
20
|
+
subtitle?: ReactNode;
|
|
20
21
|
/**
|
|
21
22
|
* Цвет заполнения
|
|
22
23
|
*/
|
package/dist/Component.js
CHANGED
|
@@ -11,7 +11,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
13
|
|
|
14
|
-
var styles = {"component":"circular-progress-
|
|
14
|
+
var styles = {"component":"circular-progress-bar__component_1bb5m","svg":"circular-progress-bar__svg_1bb5m","title":"circular-progress-bar__title_1bb5m","subtitle":"circular-progress-bar__subtitle_1bb5m","l":"circular-progress-bar__l_1bb5m","label":"circular-progress-bar__label_1bb5m","m":"circular-progress-bar__m_1bb5m","s":"circular-progress-bar__s_1bb5m","backgroundCircle":"circular-progress-bar__backgroundCircle_1bb5m","progressCircle":"circular-progress-bar__progressCircle_1bb5m","positive":"circular-progress-bar__positive_1bb5m","negative":"circular-progress-bar__negative_1bb5m"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var SIZES = {
|
|
@@ -23,7 +23,7 @@ var SIZES = {
|
|
|
23
23
|
* Компонент круглого прогресс бара.
|
|
24
24
|
*/
|
|
25
25
|
var CircularProgressBar = function (_a) {
|
|
26
|
-
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value : _d, subtitle = _a.subtitle, children = _a.children;
|
|
26
|
+
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
27
27
|
var memorized = React.useMemo(function () {
|
|
28
28
|
var strokeWidth = 8;
|
|
29
29
|
var maxProgress = 100;
|
|
@@ -50,8 +50,8 @@ var CircularProgressBar = function (_a) {
|
|
|
50
50
|
React__default['default'].createElement("circle", { className: styles.backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
51
51
|
React__default['default'].createElement("circle", { className: cn__default['default'](styles.progressCircle, styles[view]), cx: memorized.center, cy: memorized.center, r: memorized.radius, strokeDasharray: memorized.strokeDasharray, strokeDashoffset: memorized.strokeDashoffset, transform: "rotate(" + -90 + " " + memorized.center + " " + memorized.center + ")" })),
|
|
52
52
|
React__default['default'].createElement("div", { className: styles.label }, children || (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
53
|
-
title
|
|
54
|
-
subtitle
|
|
53
|
+
typeof title === 'string' ? (React__default['default'].createElement(coreComponentsTypography.Typography.Title, { className: styles.title, color: 'secondary', tag: 'div', view: size === 'l' ? 'small' : 'xsmall' }, title)) : (title),
|
|
54
|
+
typeof subtitle === 'string' ? (React__default['default'].createElement(coreComponentsTypography.Typography.Text, { tag: 'div', className: styles.subtitle, color: 'primary', view: 'primary-small' }, subtitle)) : (subtitle))))));
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
exports.CircularProgressBar = CircularProgressBar;
|
package/dist/cssm/Component.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
3
4
|
type CircularProgressBarProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Уровень прогресса, %
|
|
@@ -12,11 +13,11 @@ type CircularProgressBarProps = {
|
|
|
12
13
|
/**
|
|
13
14
|
* Основной текст
|
|
14
15
|
*/
|
|
15
|
-
title?:
|
|
16
|
+
title?: ReactNode;
|
|
16
17
|
/**
|
|
17
18
|
* Дополнительный текст
|
|
18
19
|
*/
|
|
19
|
-
subtitle?:
|
|
20
|
+
subtitle?: ReactNode;
|
|
20
21
|
/**
|
|
21
22
|
* Цвет заполнения
|
|
22
23
|
*/
|
package/dist/cssm/Component.js
CHANGED
|
@@ -22,7 +22,7 @@ var SIZES = {
|
|
|
22
22
|
* Компонент круглого прогресс бара.
|
|
23
23
|
*/
|
|
24
24
|
var CircularProgressBar = function (_a) {
|
|
25
|
-
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value : _d, subtitle = _a.subtitle, children = _a.children;
|
|
25
|
+
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
26
26
|
var memorized = React.useMemo(function () {
|
|
27
27
|
var strokeWidth = 8;
|
|
28
28
|
var maxProgress = 100;
|
|
@@ -49,8 +49,8 @@ var CircularProgressBar = function (_a) {
|
|
|
49
49
|
React__default['default'].createElement("circle", { className: styles__default['default'].backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
50
50
|
React__default['default'].createElement("circle", { className: cn__default['default'](styles__default['default'].progressCircle, styles__default['default'][view]), cx: memorized.center, cy: memorized.center, r: memorized.radius, strokeDasharray: memorized.strokeDasharray, strokeDashoffset: memorized.strokeDashoffset, transform: "rotate(" + -90 + " " + memorized.center + " " + memorized.center + ")" })),
|
|
51
51
|
React__default['default'].createElement("div", { className: styles__default['default'].label }, children || (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
52
|
-
title
|
|
53
|
-
subtitle
|
|
52
|
+
typeof title === 'string' ? (React__default['default'].createElement(coreComponentsTypography.Typography.Title, { className: styles__default['default'].title, color: 'secondary', tag: 'div', view: size === 'l' ? 'small' : 'xsmall' }, title)) : (title),
|
|
53
|
+
typeof subtitle === 'string' ? (React__default['default'].createElement(coreComponentsTypography.Typography.Text, { tag: 'div', className: styles__default['default'].subtitle, color: 'primary', view: 'primary-small' }, subtitle)) : (subtitle))))));
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
exports.CircularProgressBar = CircularProgressBar;
|
package/dist/esm/Component.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
3
4
|
type CircularProgressBarProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Уровень прогресса, %
|
|
@@ -12,11 +13,11 @@ type CircularProgressBarProps = {
|
|
|
12
13
|
/**
|
|
13
14
|
* Основной текст
|
|
14
15
|
*/
|
|
15
|
-
title?:
|
|
16
|
+
title?: ReactNode;
|
|
16
17
|
/**
|
|
17
18
|
* Дополнительный текст
|
|
18
19
|
*/
|
|
19
|
-
subtitle?:
|
|
20
|
+
subtitle?: ReactNode;
|
|
20
21
|
/**
|
|
21
22
|
* Цвет заполнения
|
|
22
23
|
*/
|
package/dist/esm/Component.js
CHANGED
|
@@ -2,7 +2,7 @@ import cn from 'classnames';
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { Typography } from '@alfalab/core-components-typography/dist/esm';
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"circular-progress-
|
|
5
|
+
var styles = {"component":"circular-progress-bar__component_1bb5m","svg":"circular-progress-bar__svg_1bb5m","title":"circular-progress-bar__title_1bb5m","subtitle":"circular-progress-bar__subtitle_1bb5m","l":"circular-progress-bar__l_1bb5m","label":"circular-progress-bar__label_1bb5m","m":"circular-progress-bar__m_1bb5m","s":"circular-progress-bar__s_1bb5m","backgroundCircle":"circular-progress-bar__backgroundCircle_1bb5m","progressCircle":"circular-progress-bar__progressCircle_1bb5m","positive":"circular-progress-bar__positive_1bb5m","negative":"circular-progress-bar__negative_1bb5m"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var SIZES = {
|
|
@@ -14,7 +14,7 @@ var SIZES = {
|
|
|
14
14
|
* Компонент круглого прогресс бара.
|
|
15
15
|
*/
|
|
16
16
|
var CircularProgressBar = function (_a) {
|
|
17
|
-
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value : _d, subtitle = _a.subtitle, children = _a.children;
|
|
17
|
+
var value = _a.value, _b = _a.view, view = _b === void 0 ? 'positive' : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, className = _a.className, dataTestId = _a.dataTestId, _d = _a.title, title = _d === void 0 ? value.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
18
18
|
var memorized = useMemo(function () {
|
|
19
19
|
var strokeWidth = 8;
|
|
20
20
|
var maxProgress = 100;
|
|
@@ -41,8 +41,8 @@ var CircularProgressBar = function (_a) {
|
|
|
41
41
|
React.createElement("circle", { className: styles.backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
42
42
|
React.createElement("circle", { className: cn(styles.progressCircle, styles[view]), cx: memorized.center, cy: memorized.center, r: memorized.radius, strokeDasharray: memorized.strokeDasharray, strokeDashoffset: memorized.strokeDashoffset, transform: "rotate(" + -90 + " " + memorized.center + " " + memorized.center + ")" })),
|
|
43
43
|
React.createElement("div", { className: styles.label }, children || (React.createElement(React.Fragment, null,
|
|
44
|
-
title
|
|
45
|
-
subtitle
|
|
44
|
+
typeof title === 'string' ? (React.createElement(Typography.Title, { className: styles.title, color: 'secondary', tag: 'div', view: size === 'l' ? 'small' : 'xsmall' }, title)) : (title),
|
|
45
|
+
typeof subtitle === 'string' ? (React.createElement(Typography.Text, { tag: 'div', className: styles.subtitle, color: 'primary', view: 'primary-small' }, subtitle)) : (subtitle))))));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export { CircularProgressBar };
|
package/dist/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nstk */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-tertiary: #e7e9eb;
|
|
4
4
|
--color-light-graphic-negative: #f15045;
|
|
@@ -16,68 +16,68 @@
|
|
|
16
16
|
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.circular-progress-
|
|
19
|
+
.circular-progress-bar__component_1bb5m {
|
|
20
20
|
position: relative;
|
|
21
21
|
display: flex;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
align-items: center;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.circular-progress-
|
|
26
|
+
.circular-progress-bar__svg_1bb5m {
|
|
27
27
|
display: block;
|
|
28
28
|
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.circular-progress-
|
|
32
|
-
.circular-progress-
|
|
31
|
+
.circular-progress-bar__title_1bb5m,
|
|
32
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
33
33
|
overflow: hidden;
|
|
34
34
|
word-break: break-word;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.circular-progress-
|
|
37
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
38
38
|
max-height: 40px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.circular-progress-
|
|
41
|
+
.circular-progress-bar__l_1bb5m {
|
|
42
42
|
width: 144px;
|
|
43
43
|
height: 144px
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.circular-progress-
|
|
46
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__label_1bb5m {
|
|
47
47
|
max-width: 120px;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.circular-progress-
|
|
50
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__title_1bb5m {
|
|
51
51
|
max-height: 32px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.circular-progress-
|
|
54
|
+
.circular-progress-bar__m_1bb5m {
|
|
55
55
|
width: 120px;
|
|
56
56
|
height: 120px
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.circular-progress-
|
|
59
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__label_1bb5m {
|
|
60
60
|
max-width: 96px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.circular-progress-
|
|
63
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__title_1bb5m {
|
|
64
64
|
max-height: 24px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.circular-progress-
|
|
67
|
+
.circular-progress-bar__s_1bb5m {
|
|
68
68
|
width: 96px;
|
|
69
69
|
height: 96px
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.circular-progress-
|
|
72
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__label_1bb5m {
|
|
73
73
|
max-width: 72px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.circular-progress-
|
|
76
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__title_1bb5m {
|
|
77
77
|
max-height: 24px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.circular-progress-
|
|
80
|
+
.circular-progress-bar__label_1bb5m {
|
|
81
81
|
text-align: center;
|
|
82
82
|
position: absolute;
|
|
83
83
|
top: 50%;
|
|
@@ -86,22 +86,22 @@
|
|
|
86
86
|
transform: translate(-50%, -50%);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
.circular-progress-
|
|
90
|
-
.circular-progress-
|
|
89
|
+
.circular-progress-bar__backgroundCircle_1bb5m,
|
|
90
|
+
.circular-progress-bar__progressCircle_1bb5m {
|
|
91
91
|
width: 100%;
|
|
92
92
|
height: 100%;
|
|
93
93
|
fill: transparent;
|
|
94
94
|
stroke-width: 8;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.circular-progress-
|
|
97
|
+
.circular-progress-bar__positive_1bb5m {
|
|
98
98
|
stroke: var(--circular-progress-bar-positive-color);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.circular-progress-
|
|
101
|
+
.circular-progress-bar__negative_1bb5m {
|
|
102
102
|
stroke: var(--circular-progress-bar-negative-color);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.circular-progress-
|
|
105
|
+
.circular-progress-bar__backgroundCircle_1bb5m {
|
|
106
106
|
stroke: var(--circular-progress-bar-bg-color);
|
|
107
107
|
}
|
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nstk */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-tertiary: #e7e9eb;
|
|
4
4
|
--color-light-graphic-negative: #f15045;
|
|
@@ -16,68 +16,68 @@
|
|
|
16
16
|
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.circular-progress-
|
|
19
|
+
.circular-progress-bar__component_1bb5m {
|
|
20
20
|
position: relative;
|
|
21
21
|
display: flex;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
align-items: center;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.circular-progress-
|
|
26
|
+
.circular-progress-bar__svg_1bb5m {
|
|
27
27
|
display: block;
|
|
28
28
|
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.circular-progress-
|
|
32
|
-
.circular-progress-
|
|
31
|
+
.circular-progress-bar__title_1bb5m,
|
|
32
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
33
33
|
overflow: hidden;
|
|
34
34
|
word-break: break-word;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.circular-progress-
|
|
37
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
38
38
|
max-height: 40px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.circular-progress-
|
|
41
|
+
.circular-progress-bar__l_1bb5m {
|
|
42
42
|
width: 144px;
|
|
43
43
|
height: 144px
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.circular-progress-
|
|
46
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__label_1bb5m {
|
|
47
47
|
max-width: 120px;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.circular-progress-
|
|
50
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__title_1bb5m {
|
|
51
51
|
max-height: 32px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.circular-progress-
|
|
54
|
+
.circular-progress-bar__m_1bb5m {
|
|
55
55
|
width: 120px;
|
|
56
56
|
height: 120px
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.circular-progress-
|
|
59
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__label_1bb5m {
|
|
60
60
|
max-width: 96px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.circular-progress-
|
|
63
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__title_1bb5m {
|
|
64
64
|
max-height: 24px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.circular-progress-
|
|
67
|
+
.circular-progress-bar__s_1bb5m {
|
|
68
68
|
width: 96px;
|
|
69
69
|
height: 96px
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.circular-progress-
|
|
72
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__label_1bb5m {
|
|
73
73
|
max-width: 72px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.circular-progress-
|
|
76
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__title_1bb5m {
|
|
77
77
|
max-height: 24px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.circular-progress-
|
|
80
|
+
.circular-progress-bar__label_1bb5m {
|
|
81
81
|
text-align: center;
|
|
82
82
|
position: absolute;
|
|
83
83
|
top: 50%;
|
|
@@ -86,22 +86,22 @@
|
|
|
86
86
|
transform: translate(-50%, -50%);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
.circular-progress-
|
|
90
|
-
.circular-progress-
|
|
89
|
+
.circular-progress-bar__backgroundCircle_1bb5m,
|
|
90
|
+
.circular-progress-bar__progressCircle_1bb5m {
|
|
91
91
|
width: 100%;
|
|
92
92
|
height: 100%;
|
|
93
93
|
fill: transparent;
|
|
94
94
|
stroke-width: 8;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.circular-progress-
|
|
97
|
+
.circular-progress-bar__positive_1bb5m {
|
|
98
98
|
stroke: var(--circular-progress-bar-positive-color);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.circular-progress-
|
|
101
|
+
.circular-progress-bar__negative_1bb5m {
|
|
102
102
|
stroke: var(--circular-progress-bar-negative-color);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.circular-progress-
|
|
105
|
+
.circular-progress-bar__backgroundCircle_1bb5m {
|
|
106
106
|
stroke: var(--circular-progress-bar-bg-color);
|
|
107
107
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
3
4
|
type CircularProgressBarProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Уровень прогресса, %
|
|
@@ -12,11 +13,11 @@ type CircularProgressBarProps = {
|
|
|
12
13
|
/**
|
|
13
14
|
* Основной текст
|
|
14
15
|
*/
|
|
15
|
-
title?:
|
|
16
|
+
title?: ReactNode;
|
|
16
17
|
/**
|
|
17
18
|
* Дополнительный текст
|
|
18
19
|
*/
|
|
19
|
-
subtitle?:
|
|
20
|
+
subtitle?: ReactNode;
|
|
20
21
|
/**
|
|
21
22
|
* Цвет заполнения
|
|
22
23
|
*/
|
package/dist/modern/Component.js
CHANGED
|
@@ -2,7 +2,7 @@ import cn from 'classnames';
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { Typography } from '@alfalab/core-components-typography/dist/modern';
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"circular-progress-
|
|
5
|
+
var styles = {"component":"circular-progress-bar__component_1bb5m","svg":"circular-progress-bar__svg_1bb5m","title":"circular-progress-bar__title_1bb5m","subtitle":"circular-progress-bar__subtitle_1bb5m","l":"circular-progress-bar__l_1bb5m","label":"circular-progress-bar__label_1bb5m","m":"circular-progress-bar__m_1bb5m","s":"circular-progress-bar__s_1bb5m","backgroundCircle":"circular-progress-bar__backgroundCircle_1bb5m","progressCircle":"circular-progress-bar__progressCircle_1bb5m","positive":"circular-progress-bar__positive_1bb5m","negative":"circular-progress-bar__negative_1bb5m"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const SIZES = {
|
|
@@ -13,7 +13,7 @@ const SIZES = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Компонент круглого прогресс бара.
|
|
15
15
|
*/
|
|
16
|
-
const CircularProgressBar = ({ value, view = 'positive', size = 'm', className, dataTestId, title = value, subtitle, children, }) => {
|
|
16
|
+
const CircularProgressBar = ({ value, view = 'positive', size = 'm', className, dataTestId, title = value.toString(), subtitle, children, }) => {
|
|
17
17
|
const memorized = useMemo(() => {
|
|
18
18
|
const strokeWidth = 8;
|
|
19
19
|
const maxProgress = 100;
|
|
@@ -40,8 +40,8 @@ const CircularProgressBar = ({ value, view = 'positive', size = 'm', className,
|
|
|
40
40
|
React.createElement("circle", { className: styles.backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
41
41
|
React.createElement("circle", { className: cn(styles.progressCircle, styles[view]), cx: memorized.center, cy: memorized.center, r: memorized.radius, strokeDasharray: memorized.strokeDasharray, strokeDashoffset: memorized.strokeDashoffset, transform: `rotate(${-90} ${memorized.center} ${memorized.center})` })),
|
|
42
42
|
React.createElement("div", { className: styles.label }, children || (React.createElement(React.Fragment, null,
|
|
43
|
-
title
|
|
44
|
-
subtitle
|
|
43
|
+
typeof title === 'string' ? (React.createElement(Typography.Title, { className: styles.title, color: 'secondary', tag: 'div', view: size === 'l' ? 'small' : 'xsmall' }, title)) : (title),
|
|
44
|
+
typeof subtitle === 'string' ? (React.createElement(Typography.Text, { tag: 'div', className: styles.subtitle, color: 'primary', view: 'primary-small' }, subtitle)) : (subtitle))))));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export { CircularProgressBar };
|
package/dist/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nstk */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-tertiary: #e7e9eb;
|
|
4
4
|
--color-light-graphic-negative: #f15045;
|
|
@@ -16,68 +16,68 @@
|
|
|
16
16
|
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.circular-progress-
|
|
19
|
+
.circular-progress-bar__component_1bb5m {
|
|
20
20
|
position: relative;
|
|
21
21
|
display: flex;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
align-items: center;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.circular-progress-
|
|
26
|
+
.circular-progress-bar__svg_1bb5m {
|
|
27
27
|
display: block;
|
|
28
28
|
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.circular-progress-
|
|
32
|
-
.circular-progress-
|
|
31
|
+
.circular-progress-bar__title_1bb5m,
|
|
32
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
33
33
|
overflow: hidden;
|
|
34
34
|
word-break: break-word;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.circular-progress-
|
|
37
|
+
.circular-progress-bar__subtitle_1bb5m {
|
|
38
38
|
max-height: 40px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.circular-progress-
|
|
41
|
+
.circular-progress-bar__l_1bb5m {
|
|
42
42
|
width: 144px;
|
|
43
43
|
height: 144px
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.circular-progress-
|
|
46
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__label_1bb5m {
|
|
47
47
|
max-width: 120px;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.circular-progress-
|
|
50
|
+
.circular-progress-bar__l_1bb5m .circular-progress-bar__title_1bb5m {
|
|
51
51
|
max-height: 32px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.circular-progress-
|
|
54
|
+
.circular-progress-bar__m_1bb5m {
|
|
55
55
|
width: 120px;
|
|
56
56
|
height: 120px
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.circular-progress-
|
|
59
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__label_1bb5m {
|
|
60
60
|
max-width: 96px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.circular-progress-
|
|
63
|
+
.circular-progress-bar__m_1bb5m .circular-progress-bar__title_1bb5m {
|
|
64
64
|
max-height: 24px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.circular-progress-
|
|
67
|
+
.circular-progress-bar__s_1bb5m {
|
|
68
68
|
width: 96px;
|
|
69
69
|
height: 96px
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.circular-progress-
|
|
72
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__label_1bb5m {
|
|
73
73
|
max-width: 72px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.circular-progress-
|
|
76
|
+
.circular-progress-bar__s_1bb5m .circular-progress-bar__title_1bb5m {
|
|
77
77
|
max-height: 24px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.circular-progress-
|
|
80
|
+
.circular-progress-bar__label_1bb5m {
|
|
81
81
|
text-align: center;
|
|
82
82
|
position: absolute;
|
|
83
83
|
top: 50%;
|
|
@@ -86,22 +86,22 @@
|
|
|
86
86
|
transform: translate(-50%, -50%);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
.circular-progress-
|
|
90
|
-
.circular-progress-
|
|
89
|
+
.circular-progress-bar__backgroundCircle_1bb5m,
|
|
90
|
+
.circular-progress-bar__progressCircle_1bb5m {
|
|
91
91
|
width: 100%;
|
|
92
92
|
height: 100%;
|
|
93
93
|
fill: transparent;
|
|
94
94
|
stroke-width: 8;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.circular-progress-
|
|
97
|
+
.circular-progress-bar__positive_1bb5m {
|
|
98
98
|
stroke: var(--circular-progress-bar-positive-color);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.circular-progress-
|
|
101
|
+
.circular-progress-bar__negative_1bb5m {
|
|
102
102
|
stroke: var(--circular-progress-bar-negative-color);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.circular-progress-
|
|
105
|
+
.circular-progress-bar__backgroundCircle_1bb5m {
|
|
106
106
|
stroke: var(--circular-progress-bar-bg-color);
|
|
107
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-circular-progress-bar",
|
|
3
|
-
"version": "2.2
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@alfalab/core-components-typography": "^2.
|
|
20
|
-
"classnames": "
|
|
19
|
+
"@alfalab/core-components-typography": "^2.5.1",
|
|
20
|
+
"classnames": "2.2.6"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16.9.0 || ^17.0.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "0363f194b7d8e6d2949795b8f0570262d7028aff"
|
|
26
26
|
}
|