@alfalab/core-components-circular-progress-bar 2.3.4 → 2.4.3
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 +39 -0
- package/Component.d.ts +93 -0
- package/Component.js +141 -0
- package/cssm/Component.d.ts +93 -0
- package/cssm/Component.js +140 -0
- package/{dist/cssm → cssm}/index.d.ts +0 -0
- package/{dist/cssm → cssm}/index.js +2 -2
- package/cssm/index.module.css +211 -0
- package/esm/Component.d.ts +93 -0
- package/esm/Component.js +132 -0
- package/esm/index.css +212 -0
- package/{dist/esm → esm}/index.d.ts +0 -0
- package/{dist/esm → esm}/index.js +2 -2
- package/index.css +212 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +1 -1
- package/modern/Component.d.ts +93 -0
- package/modern/Component.js +100 -0
- package/modern/index.css +212 -0
- package/{dist/modern → modern}/index.d.ts +0 -0
- package/{dist/modern → modern}/index.js +1 -1
- package/package.json +9 -12
- package/{dist/send-stats.js → send-stats.js} +0 -0
- package/dist/Component.d.ts +0 -38
- package/dist/Component.js +0 -57
- package/dist/cssm/Component.d.ts +0 -38
- package/dist/cssm/Component.js +0 -56
- package/dist/cssm/index.module.css +0 -106
- package/dist/esm/Component.d.ts +0 -38
- package/dist/esm/Component.js +0 -48
- package/dist/esm/index.css +0 -107
- package/dist/index.css +0 -107
- package/dist/modern/Component.d.ts +0 -38
- package/dist/modern/Component.js +0 -47
- package/dist/modern/index.css +0 -107
package/dist/Component.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
type CircularProgressBarProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Уровень прогресса, %
|
|
7
|
-
*/
|
|
8
|
-
value: number;
|
|
9
|
-
/**
|
|
10
|
-
* Дополнительный класс
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Основной текст
|
|
15
|
-
*/
|
|
16
|
-
title?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный текст
|
|
19
|
-
*/
|
|
20
|
-
subtitle?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Цвет заполнения
|
|
23
|
-
*/
|
|
24
|
-
view?: 'positive' | 'negative';
|
|
25
|
-
/**
|
|
26
|
-
* Размер (l — 144×144px, m — 120×120px, s — 96×96px)
|
|
27
|
-
*/
|
|
28
|
-
size?: 'l' | 'm' | 's';
|
|
29
|
-
/**
|
|
30
|
-
* Id компонента для тестов
|
|
31
|
-
*/
|
|
32
|
-
dataTestId?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Компонент круглого прогресс бара.
|
|
36
|
-
*/
|
|
37
|
-
declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
|
|
38
|
-
export { CircularProgressBarProps, CircularProgressBar };
|
package/dist/Component.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var cn = require('classnames');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var coreComponentsTypography = require('@alfalab/core-components-typography');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
|
|
14
|
-
var styles = {"component":"circular-progress-bar__component_17pfh","svg":"circular-progress-bar__svg_17pfh","title":"circular-progress-bar__title_17pfh","subtitle":"circular-progress-bar__subtitle_17pfh","l":"circular-progress-bar__l_17pfh","label":"circular-progress-bar__label_17pfh","m":"circular-progress-bar__m_17pfh","s":"circular-progress-bar__s_17pfh","backgroundCircle":"circular-progress-bar__backgroundCircle_17pfh","progressCircle":"circular-progress-bar__progressCircle_17pfh","positive":"circular-progress-bar__positive_17pfh","negative":"circular-progress-bar__negative_17pfh"};
|
|
15
|
-
require('./index.css')
|
|
16
|
-
|
|
17
|
-
var SIZES = {
|
|
18
|
-
s: 96,
|
|
19
|
-
m: 120,
|
|
20
|
-
l: 144,
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Компонент круглого прогресс бара.
|
|
24
|
-
*/
|
|
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.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
27
|
-
var memorized = React.useMemo(function () {
|
|
28
|
-
var strokeWidth = 8;
|
|
29
|
-
var maxProgress = 100;
|
|
30
|
-
var minProgress = 0;
|
|
31
|
-
var width = SIZES[size];
|
|
32
|
-
var height = SIZES[size];
|
|
33
|
-
var center = width / 2;
|
|
34
|
-
var radius = center - strokeWidth / 2;
|
|
35
|
-
var circumference = Math.PI * radius * 2;
|
|
36
|
-
var progress = Math.min(Math.max(value, minProgress), maxProgress);
|
|
37
|
-
var strokeDasharray = circumference.toFixed(3);
|
|
38
|
-
var strokeDashoffset = (((100 - progress) / 100) * circumference).toFixed(3);
|
|
39
|
-
return {
|
|
40
|
-
width: width,
|
|
41
|
-
height: height,
|
|
42
|
-
center: center,
|
|
43
|
-
radius: radius,
|
|
44
|
-
strokeDasharray: strokeDasharray,
|
|
45
|
-
strokeDashoffset: strokeDashoffset,
|
|
46
|
-
};
|
|
47
|
-
}, [value, size]);
|
|
48
|
-
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.component, styles[size], className), "data-test-id": dataTestId },
|
|
49
|
-
React__default['default'].createElement("svg", { viewBox: "0 0 " + memorized.width + " " + memorized.height, className: styles.svg, xmlns: 'http://www.w3.org/2000/svg' },
|
|
50
|
-
React__default['default'].createElement("circle", { className: styles.backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
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
|
-
React__default['default'].createElement("div", { className: styles.label }, children || (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
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
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.CircularProgressBar = CircularProgressBar;
|
package/dist/cssm/Component.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
type CircularProgressBarProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Уровень прогресса, %
|
|
7
|
-
*/
|
|
8
|
-
value: number;
|
|
9
|
-
/**
|
|
10
|
-
* Дополнительный класс
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Основной текст
|
|
15
|
-
*/
|
|
16
|
-
title?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный текст
|
|
19
|
-
*/
|
|
20
|
-
subtitle?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Цвет заполнения
|
|
23
|
-
*/
|
|
24
|
-
view?: 'positive' | 'negative';
|
|
25
|
-
/**
|
|
26
|
-
* Размер (l — 144×144px, m — 120×120px, s — 96×96px)
|
|
27
|
-
*/
|
|
28
|
-
size?: 'l' | 'm' | 's';
|
|
29
|
-
/**
|
|
30
|
-
* Id компонента для тестов
|
|
31
|
-
*/
|
|
32
|
-
dataTestId?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Компонент круглого прогресс бара.
|
|
36
|
-
*/
|
|
37
|
-
declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
|
|
38
|
-
export { CircularProgressBarProps, CircularProgressBar };
|
package/dist/cssm/Component.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var cn = require('classnames');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var coreComponentsTypography = require('@alfalab/core-components-typography/dist/cssm');
|
|
8
|
-
var styles = require('./index.module.css');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
15
|
-
|
|
16
|
-
var SIZES = {
|
|
17
|
-
s: 96,
|
|
18
|
-
m: 120,
|
|
19
|
-
l: 144,
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Компонент круглого прогресс бара.
|
|
23
|
-
*/
|
|
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.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
26
|
-
var memorized = React.useMemo(function () {
|
|
27
|
-
var strokeWidth = 8;
|
|
28
|
-
var maxProgress = 100;
|
|
29
|
-
var minProgress = 0;
|
|
30
|
-
var width = SIZES[size];
|
|
31
|
-
var height = SIZES[size];
|
|
32
|
-
var center = width / 2;
|
|
33
|
-
var radius = center - strokeWidth / 2;
|
|
34
|
-
var circumference = Math.PI * radius * 2;
|
|
35
|
-
var progress = Math.min(Math.max(value, minProgress), maxProgress);
|
|
36
|
-
var strokeDasharray = circumference.toFixed(3);
|
|
37
|
-
var strokeDashoffset = (((100 - progress) / 100) * circumference).toFixed(3);
|
|
38
|
-
return {
|
|
39
|
-
width: width,
|
|
40
|
-
height: height,
|
|
41
|
-
center: center,
|
|
42
|
-
radius: radius,
|
|
43
|
-
strokeDasharray: strokeDasharray,
|
|
44
|
-
strokeDashoffset: strokeDashoffset,
|
|
45
|
-
};
|
|
46
|
-
}, [value, size]);
|
|
47
|
-
return (React__default['default'].createElement("div", { className: cn__default['default'](styles__default['default'].component, styles__default['default'][size], className), "data-test-id": dataTestId },
|
|
48
|
-
React__default['default'].createElement("svg", { viewBox: "0 0 " + memorized.width + " " + memorized.height, className: styles__default['default'].svg, xmlns: 'http://www.w3.org/2000/svg' },
|
|
49
|
-
React__default['default'].createElement("circle", { className: styles__default['default'].backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
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
|
-
React__default['default'].createElement("div", { className: styles__default['default'].label }, children || (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
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
|
-
};
|
|
55
|
-
|
|
56
|
-
exports.CircularProgressBar = CircularProgressBar;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--color-light-bg-tertiary: #e7e9eb;
|
|
3
|
-
--color-light-graphic-negative: #f15045;
|
|
4
|
-
--color-light-graphic-positive: #2fc26e;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
/* bg */
|
|
9
|
-
--circular-progress-bar-bg-color: var(--color-light-bg-tertiary);
|
|
10
|
-
|
|
11
|
-
/* positive */
|
|
12
|
-
--circular-progress-bar-positive-color: var(--color-light-graphic-positive);
|
|
13
|
-
|
|
14
|
-
/* negative */
|
|
15
|
-
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.component {
|
|
19
|
-
position: relative;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.svg {
|
|
26
|
-
display: block;
|
|
27
|
-
width: 100%;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.title,
|
|
31
|
-
.subtitle {
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
word-break: break-word;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.subtitle {
|
|
37
|
-
max-height: 40px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.l {
|
|
41
|
-
width: 144px;
|
|
42
|
-
height: 144px
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.l .label {
|
|
46
|
-
max-width: 120px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.l .title {
|
|
50
|
-
max-height: 32px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.m {
|
|
54
|
-
width: 120px;
|
|
55
|
-
height: 120px
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.m .label {
|
|
59
|
-
max-width: 96px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.m .title {
|
|
63
|
-
max-height: 24px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.s {
|
|
67
|
-
width: 96px;
|
|
68
|
-
height: 96px
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.s .label {
|
|
72
|
-
max-width: 72px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.s .title {
|
|
76
|
-
max-height: 24px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.label {
|
|
80
|
-
text-align: center;
|
|
81
|
-
position: absolute;
|
|
82
|
-
top: 50%;
|
|
83
|
-
left: 50%;
|
|
84
|
-
width: 100%;
|
|
85
|
-
transform: translate(-50%, -50%);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.backgroundCircle,
|
|
89
|
-
.progressCircle {
|
|
90
|
-
width: 100%;
|
|
91
|
-
height: 100%;
|
|
92
|
-
fill: transparent;
|
|
93
|
-
stroke-width: 8;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.positive {
|
|
97
|
-
stroke: var(--circular-progress-bar-positive-color);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.negative {
|
|
101
|
-
stroke: var(--circular-progress-bar-negative-color);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.backgroundCircle {
|
|
105
|
-
stroke: var(--circular-progress-bar-bg-color);
|
|
106
|
-
}
|
package/dist/esm/Component.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
type CircularProgressBarProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Уровень прогресса, %
|
|
7
|
-
*/
|
|
8
|
-
value: number;
|
|
9
|
-
/**
|
|
10
|
-
* Дополнительный класс
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Основной текст
|
|
15
|
-
*/
|
|
16
|
-
title?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный текст
|
|
19
|
-
*/
|
|
20
|
-
subtitle?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Цвет заполнения
|
|
23
|
-
*/
|
|
24
|
-
view?: 'positive' | 'negative';
|
|
25
|
-
/**
|
|
26
|
-
* Размер (l — 144×144px, m — 120×120px, s — 96×96px)
|
|
27
|
-
*/
|
|
28
|
-
size?: 'l' | 'm' | 's';
|
|
29
|
-
/**
|
|
30
|
-
* Id компонента для тестов
|
|
31
|
-
*/
|
|
32
|
-
dataTestId?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Компонент круглого прогресс бара.
|
|
36
|
-
*/
|
|
37
|
-
declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
|
|
38
|
-
export { CircularProgressBarProps, CircularProgressBar };
|
package/dist/esm/Component.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import { Typography } from '@alfalab/core-components-typography/dist/esm';
|
|
4
|
-
|
|
5
|
-
var styles = {"component":"circular-progress-bar__component_17pfh","svg":"circular-progress-bar__svg_17pfh","title":"circular-progress-bar__title_17pfh","subtitle":"circular-progress-bar__subtitle_17pfh","l":"circular-progress-bar__l_17pfh","label":"circular-progress-bar__label_17pfh","m":"circular-progress-bar__m_17pfh","s":"circular-progress-bar__s_17pfh","backgroundCircle":"circular-progress-bar__backgroundCircle_17pfh","progressCircle":"circular-progress-bar__progressCircle_17pfh","positive":"circular-progress-bar__positive_17pfh","negative":"circular-progress-bar__negative_17pfh"};
|
|
6
|
-
require('./index.css')
|
|
7
|
-
|
|
8
|
-
var SIZES = {
|
|
9
|
-
s: 96,
|
|
10
|
-
m: 120,
|
|
11
|
-
l: 144,
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Компонент круглого прогресс бара.
|
|
15
|
-
*/
|
|
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.toString() : _d, subtitle = _a.subtitle, children = _a.children;
|
|
18
|
-
var memorized = useMemo(function () {
|
|
19
|
-
var strokeWidth = 8;
|
|
20
|
-
var maxProgress = 100;
|
|
21
|
-
var minProgress = 0;
|
|
22
|
-
var width = SIZES[size];
|
|
23
|
-
var height = SIZES[size];
|
|
24
|
-
var center = width / 2;
|
|
25
|
-
var radius = center - strokeWidth / 2;
|
|
26
|
-
var circumference = Math.PI * radius * 2;
|
|
27
|
-
var progress = Math.min(Math.max(value, minProgress), maxProgress);
|
|
28
|
-
var strokeDasharray = circumference.toFixed(3);
|
|
29
|
-
var strokeDashoffset = (((100 - progress) / 100) * circumference).toFixed(3);
|
|
30
|
-
return {
|
|
31
|
-
width: width,
|
|
32
|
-
height: height,
|
|
33
|
-
center: center,
|
|
34
|
-
radius: radius,
|
|
35
|
-
strokeDasharray: strokeDasharray,
|
|
36
|
-
strokeDashoffset: strokeDashoffset,
|
|
37
|
-
};
|
|
38
|
-
}, [value, size]);
|
|
39
|
-
return (React.createElement("div", { className: cn(styles.component, styles[size], className), "data-test-id": dataTestId },
|
|
40
|
-
React.createElement("svg", { viewBox: "0 0 " + memorized.width + " " + memorized.height, className: styles.svg, xmlns: 'http://www.w3.org/2000/svg' },
|
|
41
|
-
React.createElement("circle", { className: styles.backgroundCircle, cx: memorized.center, cy: memorized.center, r: memorized.radius }),
|
|
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
|
-
React.createElement("div", { className: styles.label }, children || (React.createElement(React.Fragment, null,
|
|
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
|
-
};
|
|
47
|
-
|
|
48
|
-
export { CircularProgressBar };
|
package/dist/esm/index.css
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/* hash: 1jvf0 */
|
|
2
|
-
:root {
|
|
3
|
-
--color-light-bg-tertiary: #e7e9eb;
|
|
4
|
-
--color-light-graphic-negative: #f15045;
|
|
5
|
-
--color-light-graphic-positive: #2fc26e;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
/* bg */
|
|
10
|
-
--circular-progress-bar-bg-color: var(--color-light-bg-tertiary);
|
|
11
|
-
|
|
12
|
-
/* positive */
|
|
13
|
-
--circular-progress-bar-positive-color: var(--color-light-graphic-positive);
|
|
14
|
-
|
|
15
|
-
/* negative */
|
|
16
|
-
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.circular-progress-bar__component_17pfh {
|
|
20
|
-
position: relative;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.circular-progress-bar__svg_17pfh {
|
|
27
|
-
display: block;
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.circular-progress-bar__title_17pfh,
|
|
32
|
-
.circular-progress-bar__subtitle_17pfh {
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
word-break: break-word;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.circular-progress-bar__subtitle_17pfh {
|
|
38
|
-
max-height: 40px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.circular-progress-bar__l_17pfh {
|
|
42
|
-
width: 144px;
|
|
43
|
-
height: 144px
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.circular-progress-bar__l_17pfh .circular-progress-bar__label_17pfh {
|
|
47
|
-
max-width: 120px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.circular-progress-bar__l_17pfh .circular-progress-bar__title_17pfh {
|
|
51
|
-
max-height: 32px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.circular-progress-bar__m_17pfh {
|
|
55
|
-
width: 120px;
|
|
56
|
-
height: 120px
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.circular-progress-bar__m_17pfh .circular-progress-bar__label_17pfh {
|
|
60
|
-
max-width: 96px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.circular-progress-bar__m_17pfh .circular-progress-bar__title_17pfh {
|
|
64
|
-
max-height: 24px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.circular-progress-bar__s_17pfh {
|
|
68
|
-
width: 96px;
|
|
69
|
-
height: 96px
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.circular-progress-bar__s_17pfh .circular-progress-bar__label_17pfh {
|
|
73
|
-
max-width: 72px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.circular-progress-bar__s_17pfh .circular-progress-bar__title_17pfh {
|
|
77
|
-
max-height: 24px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.circular-progress-bar__label_17pfh {
|
|
81
|
-
text-align: center;
|
|
82
|
-
position: absolute;
|
|
83
|
-
top: 50%;
|
|
84
|
-
left: 50%;
|
|
85
|
-
width: 100%;
|
|
86
|
-
transform: translate(-50%, -50%);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.circular-progress-bar__backgroundCircle_17pfh,
|
|
90
|
-
.circular-progress-bar__progressCircle_17pfh {
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: 100%;
|
|
93
|
-
fill: transparent;
|
|
94
|
-
stroke-width: 8;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.circular-progress-bar__positive_17pfh {
|
|
98
|
-
stroke: var(--circular-progress-bar-positive-color);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.circular-progress-bar__negative_17pfh {
|
|
102
|
-
stroke: var(--circular-progress-bar-negative-color);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.circular-progress-bar__backgroundCircle_17pfh {
|
|
106
|
-
stroke: var(--circular-progress-bar-bg-color);
|
|
107
|
-
}
|
package/dist/index.css
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/* hash: 1jvf0 */
|
|
2
|
-
:root {
|
|
3
|
-
--color-light-bg-tertiary: #e7e9eb;
|
|
4
|
-
--color-light-graphic-negative: #f15045;
|
|
5
|
-
--color-light-graphic-positive: #2fc26e;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
/* bg */
|
|
10
|
-
--circular-progress-bar-bg-color: var(--color-light-bg-tertiary);
|
|
11
|
-
|
|
12
|
-
/* positive */
|
|
13
|
-
--circular-progress-bar-positive-color: var(--color-light-graphic-positive);
|
|
14
|
-
|
|
15
|
-
/* negative */
|
|
16
|
-
--circular-progress-bar-negative-color: var(--color-light-graphic-negative);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.circular-progress-bar__component_17pfh {
|
|
20
|
-
position: relative;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.circular-progress-bar__svg_17pfh {
|
|
27
|
-
display: block;
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.circular-progress-bar__title_17pfh,
|
|
32
|
-
.circular-progress-bar__subtitle_17pfh {
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
word-break: break-word;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.circular-progress-bar__subtitle_17pfh {
|
|
38
|
-
max-height: 40px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.circular-progress-bar__l_17pfh {
|
|
42
|
-
width: 144px;
|
|
43
|
-
height: 144px
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.circular-progress-bar__l_17pfh .circular-progress-bar__label_17pfh {
|
|
47
|
-
max-width: 120px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.circular-progress-bar__l_17pfh .circular-progress-bar__title_17pfh {
|
|
51
|
-
max-height: 32px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.circular-progress-bar__m_17pfh {
|
|
55
|
-
width: 120px;
|
|
56
|
-
height: 120px
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.circular-progress-bar__m_17pfh .circular-progress-bar__label_17pfh {
|
|
60
|
-
max-width: 96px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.circular-progress-bar__m_17pfh .circular-progress-bar__title_17pfh {
|
|
64
|
-
max-height: 24px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.circular-progress-bar__s_17pfh {
|
|
68
|
-
width: 96px;
|
|
69
|
-
height: 96px
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.circular-progress-bar__s_17pfh .circular-progress-bar__label_17pfh {
|
|
73
|
-
max-width: 72px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.circular-progress-bar__s_17pfh .circular-progress-bar__title_17pfh {
|
|
77
|
-
max-height: 24px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.circular-progress-bar__label_17pfh {
|
|
81
|
-
text-align: center;
|
|
82
|
-
position: absolute;
|
|
83
|
-
top: 50%;
|
|
84
|
-
left: 50%;
|
|
85
|
-
width: 100%;
|
|
86
|
-
transform: translate(-50%, -50%);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.circular-progress-bar__backgroundCircle_17pfh,
|
|
90
|
-
.circular-progress-bar__progressCircle_17pfh {
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: 100%;
|
|
93
|
-
fill: transparent;
|
|
94
|
-
stroke-width: 8;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.circular-progress-bar__positive_17pfh {
|
|
98
|
-
stroke: var(--circular-progress-bar-positive-color);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.circular-progress-bar__negative_17pfh {
|
|
102
|
-
stroke: var(--circular-progress-bar-negative-color);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.circular-progress-bar__backgroundCircle_17pfh {
|
|
106
|
-
stroke: var(--circular-progress-bar-bg-color);
|
|
107
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
type CircularProgressBarProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Уровень прогресса, %
|
|
7
|
-
*/
|
|
8
|
-
value: number;
|
|
9
|
-
/**
|
|
10
|
-
* Дополнительный класс
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Основной текст
|
|
15
|
-
*/
|
|
16
|
-
title?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный текст
|
|
19
|
-
*/
|
|
20
|
-
subtitle?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Цвет заполнения
|
|
23
|
-
*/
|
|
24
|
-
view?: 'positive' | 'negative';
|
|
25
|
-
/**
|
|
26
|
-
* Размер (l — 144×144px, m — 120×120px, s — 96×96px)
|
|
27
|
-
*/
|
|
28
|
-
size?: 'l' | 'm' | 's';
|
|
29
|
-
/**
|
|
30
|
-
* Id компонента для тестов
|
|
31
|
-
*/
|
|
32
|
-
dataTestId?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Компонент круглого прогресс бара.
|
|
36
|
-
*/
|
|
37
|
-
declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
|
|
38
|
-
export { CircularProgressBarProps, CircularProgressBar };
|