@alfalab/core-components-circular-progress-bar 2.0.0 → 2.1.0

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 CHANGED
@@ -3,30 +3,47 @@
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.0.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@1.2.11...@alfalab/core-components-circular-progress-bar@2.0.0) (2021-07-08)
6
+ # [2.1.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.0.3...@alfalab/core-components-circular-progress-bar@2.1.0) (2021-11-30)
7
7
 
8
8
 
9
9
  ### Features
10
10
 
11
- * upgrade storybook ([#696](https://github.com/alfa-laboratory/core-components/issues/696)) ([bf8350e](https://github.com/alfa-laboratory/core-components/commit/bf8350ebfd238b6c63ac30545ac32ca933f498d6)), closes [#708](https://github.com/alfa-laboratory/core-components/issues/708) [#707](https://github.com/alfa-laboratory/core-components/issues/707) [#714](https://github.com/alfa-laboratory/core-components/issues/714) [#716](https://github.com/alfa-laboratory/core-components/issues/716) [#690](https://github.com/alfa-laboratory/core-components/issues/690) [#701](https://github.com/alfa-laboratory/core-components/issues/701) [#699](https://github.com/alfa-laboratory/core-components/issues/699) [#698](https://github.com/alfa-laboratory/core-components/issues/698) [#693](https://github.com/alfa-laboratory/core-components/issues/693) [#699](https://github.com/alfa-laboratory/core-components/issues/699) [#698](https://github.com/alfa-laboratory/core-components/issues/698) [#693](https://github.com/alfa-laboratory/core-components/issues/693) [#705](https://github.com/alfa-laboratory/core-components/issues/705) [#705](https://github.com/alfa-laboratory/core-components/issues/705) [#709](https://github.com/alfa-laboratory/core-components/issues/709) [#703](https://github.com/alfa-laboratory/core-components/issues/703) [#695](https://github.com/alfa-laboratory/core-components/issues/695) [#673](https://github.com/alfa-laboratory/core-components/issues/673) [#703](https://github.com/alfa-laboratory/core-components/issues/703) [#709](https://github.com/alfa-laboratory/core-components/issues/709) [#673](https://github.com/alfa-laboratory/core-components/issues/673) [#695](https://github.com/alfa-laboratory/core-components/issues/695) [#645](https://github.com/alfa-laboratory/core-components/issues/645) [#642](https://github.com/alfa-laboratory/core-components/issues/642) [#642](https://github.com/alfa-laboratory/core-components/issues/642) [#646](https://github.com/alfa-laboratory/core-components/issues/646) [#646](https://github.com/alfa-laboratory/core-components/issues/646) [#634](https://github.com/alfa-laboratory/core-components/issues/634) [#635](https://github.com/alfa-laboratory/core-components/issues/635) [#634](https://github.com/alfa-laboratory/core-components/issues/634) [#635](https://github.com/alfa-laboratory/core-components/issues/635) [#648](https://github.com/alfa-laboratory/core-components/issues/648) [#647](https://github.com/alfa-laboratory/core-components/issues/647) [#630](https://github.com/alfa-laboratory/core-components/issues/630) [#648](https://github.com/alfa-laboratory/core-components/issues/648) [#630](https://github.com/alfa-laboratory/core-components/issues/630) [#669](https://github.com/alfa-laboratory/core-components/issues/669) [#712](https://github.com/alfa-laboratory/core-components/issues/712) [#713](https://github.com/alfa-laboratory/core-components/issues/713) [#719](https://github.com/alfa-laboratory/core-components/issues/719) [#720](https://github.com/alfa-laboratory/core-components/issues/720) [#718](https://github.com/alfa-laboratory/core-components/issues/718) [#712](https://github.com/alfa-laboratory/core-components/issues/712) [#713](https://github.com/alfa-laboratory/core-components/issues/713) [#719](https://github.com/alfa-laboratory/core-components/issues/719) [#642](https://github.com/alfa-laboratory/core-components/issues/642) [#642](https://github.com/alfa-laboratory/core-components/issues/642) [#646](https://github.com/alfa-laboratory/core-components/issues/646) [#646](https://github.com/alfa-laboratory/core-components/issues/646) [#634](https://github.com/alfa-laboratory/core-components/issues/634) [#635](https://github.com/alfa-laboratory/core-components/issues/635) [#634](https://github.com/alfa-laboratory/core-components/issues/634) [#635](https://github.com/alfa-laboratory/core-components/issues/635) [#648](https://github.com/alfa-laboratory/core-components/issues/648) [#647](https://github.com/alfa-laboratory/core-components/issues/647) [#630](https://github.com/alfa-laboratory/core-components/issues/630) [#648](https://github.com/alfa-laboratory/core-components/issues/648) [#630](https://github.com/alfa-laboratory/core-components/issues/630) [#669](https://github.com/alfa-laboratory/core-components/issues/669) [#720](https://github.com/alfa-laboratory/core-components/issues/720) [#718](https://github.com/alfa-laboratory/core-components/issues/718) [#691](https://github.com/alfa-laboratory/core-components/issues/691) [#691](https://github.com/alfa-laboratory/core-components/issues/691) [#723](https://github.com/alfa-laboratory/core-components/issues/723) [#702](https://github.com/alfa-laboratory/core-components/issues/702) [#723](https://github.com/alfa-laboratory/core-components/issues/723) [#702](https://github.com/alfa-laboratory/core-components/issues/702) [#708](https://github.com/alfa-laboratory/core-components/issues/708) [#707](https://github.com/alfa-laboratory/core-components/issues/707) [#714](https://github.com/alfa-laboratory/core-components/issues/714) [#722](https://github.com/alfa-laboratory/core-components/issues/722)
11
+ * **circular-progress-bar:** new size S ([d34db5c](https://github.com/alfa-laboratory/core-components/commit/d34db5cca682bc63f948a0dad322604c8044a6b8))
12
12
 
13
13
 
14
- ### BREAKING CHANGES
15
14
 
16
- * buttonRetryText renamed to buttonReturnText
17
15
 
18
- Co-authored-by: Alexander Soldatov <aesoldatov@alfabank.ru>
19
- * inline-block changes to block
20
16
 
21
- * chore(release): 18.0.0 [skip ci]
17
+ ## [2.0.3](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.0.2...@alfalab/core-components-circular-progress-bar@2.0.3) (2021-09-14)
18
+
19
+ **Note:** Version bump only for package @alfalab/core-components-circular-progress-bar
20
+
21
+
22
+
23
+
24
+
25
+ ## [2.0.2](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.0.1...@alfalab/core-components-circular-progress-bar@2.0.2) (2021-07-19)
26
+
27
+ **Note:** Version bump only for package @alfalab/core-components-circular-progress-bar
22
28
 
23
- # [18.0.0](https://github.com/alfa-laboratory/core-components/compare/v17.6.0...v18.0.0) (2021-06-28)
24
29
 
25
- ### Bug Fixes
26
30
 
27
31
 
28
32
 
33
+ ## [2.0.1](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@2.0.0...@alfalab/core-components-circular-progress-bar@2.0.1) (2021-07-09)
34
+
35
+ **Note:** Version bump only for package @alfalab/core-components-circular-progress-bar
36
+
37
+
38
+
39
+
40
+
41
+ # [2.0.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@1.2.11...@alfalab/core-components-circular-progress-bar@2.0.0) (2021-07-08)
42
+
43
+
44
+ ### Features
29
45
 
46
+ * upgrade storybook ([#696](https://github.com/alfa-laboratory/core-components/issues/696))
30
47
 
31
48
  ## [1.2.11](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-circular-progress-bar@1.2.10...@alfalab/core-components-circular-progress-bar@1.2.11) (2021-06-28)
32
49
 
@@ -22,9 +22,9 @@ type CircularProgressBarProps = {
22
22
  */
23
23
  view?: 'positive' | 'negative';
24
24
  /**
25
- * Размер (l - 144x144px, m - 120x120px)
25
+ * Размер (l 144×144px, m 120×120px, s — 96×96px)
26
26
  */
27
- size?: 'l' | 'm';
27
+ size?: 'l' | 'm' | 's';
28
28
  /**
29
29
  * Id компонента для тестов
30
30
  */
package/dist/Component.js CHANGED
@@ -11,9 +11,14 @@ 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-bar__component_7xvdi","svg":"circular-progress-bar__svg_7xvdi","title":"circular-progress-bar__title_7xvdi","subtitle":"circular-progress-bar__subtitle_7xvdi","l":"circular-progress-bar__l_7xvdi","label":"circular-progress-bar__label_7xvdi","m":"circular-progress-bar__m_7xvdi","backgroundCircle":"circular-progress-bar__backgroundCircle_7xvdi","progressCircle":"circular-progress-bar__progressCircle_7xvdi","positive":"circular-progress-bar__positive_7xvdi","negative":"circular-progress-bar__negative_7xvdi"};
14
+ var styles = {"component":"circular-progress-bar__component_tn1xj","svg":"circular-progress-bar__svg_tn1xj","title":"circular-progress-bar__title_tn1xj","subtitle":"circular-progress-bar__subtitle_tn1xj","l":"circular-progress-bar__l_tn1xj","label":"circular-progress-bar__label_tn1xj","m":"circular-progress-bar__m_tn1xj","s":"circular-progress-bar__s_tn1xj","backgroundCircle":"circular-progress-bar__backgroundCircle_tn1xj","progressCircle":"circular-progress-bar__progressCircle_tn1xj","positive":"circular-progress-bar__positive_tn1xj","negative":"circular-progress-bar__negative_tn1xj"};
15
15
  require('./index.css')
16
16
 
17
+ var SIZES = {
18
+ s: 96,
19
+ m: 120,
20
+ l: 144,
21
+ };
17
22
  /**
18
23
  * Компонент круглого прогресс бара.
19
24
  */
@@ -23,8 +28,8 @@ var CircularProgressBar = function (_a) {
23
28
  var strokeWidth = 8;
24
29
  var maxProgress = 100;
25
30
  var minProgress = 0;
26
- var width = size === 'l' ? 144 : 120;
27
- var height = size === 'l' ? 144 : 120;
31
+ var width = SIZES[size];
32
+ var height = SIZES[size];
28
33
  var center = width / 2;
29
34
  var radius = center - strokeWidth / 2;
30
35
  var circumference = Math.PI * radius * 2;
@@ -22,9 +22,9 @@ type CircularProgressBarProps = {
22
22
  */
23
23
  view?: 'positive' | 'negative';
24
24
  /**
25
- * Размер (l - 144x144px, m - 120x120px)
25
+ * Размер (l 144×144px, m 120×120px, s — 96×96px)
26
26
  */
27
- size?: 'l' | 'm';
27
+ size?: 'l' | 'm' | 's';
28
28
  /**
29
29
  * Id компонента для тестов
30
30
  */
@@ -13,6 +13,11 @@ var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
13
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
  var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
15
15
 
16
+ var SIZES = {
17
+ s: 96,
18
+ m: 120,
19
+ l: 144,
20
+ };
16
21
  /**
17
22
  * Компонент круглого прогресс бара.
18
23
  */
@@ -22,8 +27,8 @@ var CircularProgressBar = function (_a) {
22
27
  var strokeWidth = 8;
23
28
  var maxProgress = 100;
24
29
  var minProgress = 0;
25
- var width = size === 'l' ? 144 : 120;
26
- var height = size === 'l' ? 144 : 120;
30
+ var width = SIZES[size];
31
+ var height = SIZES[size];
27
32
  var center = width / 2;
28
33
  var radius = center - strokeWidth / 2;
29
34
  var circumference = Math.PI * radius * 2;
@@ -63,6 +63,19 @@
63
63
  max-height: 24px;
64
64
  }
65
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
+
66
79
  .label {
67
80
  text-align: center;
68
81
  position: absolute;
@@ -22,9 +22,9 @@ type CircularProgressBarProps = {
22
22
  */
23
23
  view?: 'positive' | 'negative';
24
24
  /**
25
- * Размер (l - 144x144px, m - 120x120px)
25
+ * Размер (l 144×144px, m 120×120px, s — 96×96px)
26
26
  */
27
- size?: 'l' | 'm';
27
+ size?: 'l' | 'm' | 's';
28
28
  /**
29
29
  * Id компонента для тестов
30
30
  */
@@ -2,9 +2,14 @@ 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-bar__component_7xvdi","svg":"circular-progress-bar__svg_7xvdi","title":"circular-progress-bar__title_7xvdi","subtitle":"circular-progress-bar__subtitle_7xvdi","l":"circular-progress-bar__l_7xvdi","label":"circular-progress-bar__label_7xvdi","m":"circular-progress-bar__m_7xvdi","backgroundCircle":"circular-progress-bar__backgroundCircle_7xvdi","progressCircle":"circular-progress-bar__progressCircle_7xvdi","positive":"circular-progress-bar__positive_7xvdi","negative":"circular-progress-bar__negative_7xvdi"};
5
+ var styles = {"component":"circular-progress-bar__component_tn1xj","svg":"circular-progress-bar__svg_tn1xj","title":"circular-progress-bar__title_tn1xj","subtitle":"circular-progress-bar__subtitle_tn1xj","l":"circular-progress-bar__l_tn1xj","label":"circular-progress-bar__label_tn1xj","m":"circular-progress-bar__m_tn1xj","s":"circular-progress-bar__s_tn1xj","backgroundCircle":"circular-progress-bar__backgroundCircle_tn1xj","progressCircle":"circular-progress-bar__progressCircle_tn1xj","positive":"circular-progress-bar__positive_tn1xj","negative":"circular-progress-bar__negative_tn1xj"};
6
6
  require('./index.css')
7
7
 
8
+ var SIZES = {
9
+ s: 96,
10
+ m: 120,
11
+ l: 144,
12
+ };
8
13
  /**
9
14
  * Компонент круглого прогресс бара.
10
15
  */
@@ -14,8 +19,8 @@ var CircularProgressBar = function (_a) {
14
19
  var strokeWidth = 8;
15
20
  var maxProgress = 100;
16
21
  var minProgress = 0;
17
- var width = size === 'l' ? 144 : 120;
18
- var height = size === 'l' ? 144 : 120;
22
+ var width = SIZES[size];
23
+ var height = SIZES[size];
19
24
  var center = width / 2;
20
25
  var radius = center - strokeWidth / 2;
21
26
  var circumference = Math.PI * radius * 2;
@@ -1,4 +1,4 @@
1
- /* hash: 7xvdi */
1
+ /* hash: tdnhd */
2
2
  :root {
3
3
  --color-light-bg-tertiary: #e7e9eb;
4
4
  --color-light-graphic-negative: #f15045;
@@ -16,55 +16,68 @@
16
16
  --circular-progress-bar-negative-color: var(--color-light-graphic-negative);
17
17
  }
18
18
 
19
- .circular-progress-bar__component_7xvdi {
19
+ .circular-progress-bar__component_tn1xj {
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-bar__svg_7xvdi {
26
+ .circular-progress-bar__svg_tn1xj {
27
27
  display: block;
28
28
  width: 100%;
29
29
  }
30
30
 
31
- .circular-progress-bar__title_7xvdi,
32
- .circular-progress-bar__subtitle_7xvdi {
31
+ .circular-progress-bar__title_tn1xj,
32
+ .circular-progress-bar__subtitle_tn1xj {
33
33
  overflow: hidden;
34
34
  word-break: break-word;
35
35
  }
36
36
 
37
- .circular-progress-bar__subtitle_7xvdi {
37
+ .circular-progress-bar__subtitle_tn1xj {
38
38
  max-height: 40px;
39
39
  }
40
40
 
41
- .circular-progress-bar__l_7xvdi {
41
+ .circular-progress-bar__l_tn1xj {
42
42
  width: 144px;
43
43
  height: 144px
44
44
  }
45
45
 
46
- .circular-progress-bar__l_7xvdi .circular-progress-bar__label_7xvdi {
46
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__label_tn1xj {
47
47
  max-width: 120px;
48
48
  }
49
49
 
50
- .circular-progress-bar__l_7xvdi .circular-progress-bar__title_7xvdi {
50
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__title_tn1xj {
51
51
  max-height: 32px;
52
52
  }
53
53
 
54
- .circular-progress-bar__m_7xvdi {
54
+ .circular-progress-bar__m_tn1xj {
55
55
  width: 120px;
56
56
  height: 120px
57
57
  }
58
58
 
59
- .circular-progress-bar__m_7xvdi .circular-progress-bar__label_7xvdi {
59
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__label_tn1xj {
60
60
  max-width: 96px;
61
61
  }
62
62
 
63
- .circular-progress-bar__m_7xvdi .circular-progress-bar__title_7xvdi {
63
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__title_tn1xj {
64
64
  max-height: 24px;
65
65
  }
66
66
 
67
- .circular-progress-bar__label_7xvdi {
67
+ .circular-progress-bar__s_tn1xj {
68
+ width: 96px;
69
+ height: 96px
70
+ }
71
+
72
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__label_tn1xj {
73
+ max-width: 72px;
74
+ }
75
+
76
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__title_tn1xj {
77
+ max-height: 24px;
78
+ }
79
+
80
+ .circular-progress-bar__label_tn1xj {
68
81
  text-align: center;
69
82
  position: absolute;
70
83
  top: 50%;
@@ -73,22 +86,22 @@
73
86
  transform: translate(-50%, -50%);
74
87
  }
75
88
 
76
- .circular-progress-bar__backgroundCircle_7xvdi,
77
- .circular-progress-bar__progressCircle_7xvdi {
89
+ .circular-progress-bar__backgroundCircle_tn1xj,
90
+ .circular-progress-bar__progressCircle_tn1xj {
78
91
  width: 100%;
79
92
  height: 100%;
80
93
  fill: transparent;
81
94
  stroke-width: 8;
82
95
  }
83
96
 
84
- .circular-progress-bar__positive_7xvdi {
97
+ .circular-progress-bar__positive_tn1xj {
85
98
  stroke: var(--circular-progress-bar-positive-color);
86
99
  }
87
100
 
88
- .circular-progress-bar__negative_7xvdi {
101
+ .circular-progress-bar__negative_tn1xj {
89
102
  stroke: var(--circular-progress-bar-negative-color);
90
103
  }
91
104
 
92
- .circular-progress-bar__backgroundCircle_7xvdi {
105
+ .circular-progress-bar__backgroundCircle_tn1xj {
93
106
  stroke: var(--circular-progress-bar-bg-color);
94
107
  }
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7xvdi */
1
+ /* hash: tdnhd */
2
2
  :root {
3
3
  --color-light-bg-tertiary: #e7e9eb;
4
4
  --color-light-graphic-negative: #f15045;
@@ -16,55 +16,68 @@
16
16
  --circular-progress-bar-negative-color: var(--color-light-graphic-negative);
17
17
  }
18
18
 
19
- .circular-progress-bar__component_7xvdi {
19
+ .circular-progress-bar__component_tn1xj {
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-bar__svg_7xvdi {
26
+ .circular-progress-bar__svg_tn1xj {
27
27
  display: block;
28
28
  width: 100%;
29
29
  }
30
30
 
31
- .circular-progress-bar__title_7xvdi,
32
- .circular-progress-bar__subtitle_7xvdi {
31
+ .circular-progress-bar__title_tn1xj,
32
+ .circular-progress-bar__subtitle_tn1xj {
33
33
  overflow: hidden;
34
34
  word-break: break-word;
35
35
  }
36
36
 
37
- .circular-progress-bar__subtitle_7xvdi {
37
+ .circular-progress-bar__subtitle_tn1xj {
38
38
  max-height: 40px;
39
39
  }
40
40
 
41
- .circular-progress-bar__l_7xvdi {
41
+ .circular-progress-bar__l_tn1xj {
42
42
  width: 144px;
43
43
  height: 144px
44
44
  }
45
45
 
46
- .circular-progress-bar__l_7xvdi .circular-progress-bar__label_7xvdi {
46
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__label_tn1xj {
47
47
  max-width: 120px;
48
48
  }
49
49
 
50
- .circular-progress-bar__l_7xvdi .circular-progress-bar__title_7xvdi {
50
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__title_tn1xj {
51
51
  max-height: 32px;
52
52
  }
53
53
 
54
- .circular-progress-bar__m_7xvdi {
54
+ .circular-progress-bar__m_tn1xj {
55
55
  width: 120px;
56
56
  height: 120px
57
57
  }
58
58
 
59
- .circular-progress-bar__m_7xvdi .circular-progress-bar__label_7xvdi {
59
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__label_tn1xj {
60
60
  max-width: 96px;
61
61
  }
62
62
 
63
- .circular-progress-bar__m_7xvdi .circular-progress-bar__title_7xvdi {
63
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__title_tn1xj {
64
64
  max-height: 24px;
65
65
  }
66
66
 
67
- .circular-progress-bar__label_7xvdi {
67
+ .circular-progress-bar__s_tn1xj {
68
+ width: 96px;
69
+ height: 96px
70
+ }
71
+
72
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__label_tn1xj {
73
+ max-width: 72px;
74
+ }
75
+
76
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__title_tn1xj {
77
+ max-height: 24px;
78
+ }
79
+
80
+ .circular-progress-bar__label_tn1xj {
68
81
  text-align: center;
69
82
  position: absolute;
70
83
  top: 50%;
@@ -73,22 +86,22 @@
73
86
  transform: translate(-50%, -50%);
74
87
  }
75
88
 
76
- .circular-progress-bar__backgroundCircle_7xvdi,
77
- .circular-progress-bar__progressCircle_7xvdi {
89
+ .circular-progress-bar__backgroundCircle_tn1xj,
90
+ .circular-progress-bar__progressCircle_tn1xj {
78
91
  width: 100%;
79
92
  height: 100%;
80
93
  fill: transparent;
81
94
  stroke-width: 8;
82
95
  }
83
96
 
84
- .circular-progress-bar__positive_7xvdi {
97
+ .circular-progress-bar__positive_tn1xj {
85
98
  stroke: var(--circular-progress-bar-positive-color);
86
99
  }
87
100
 
88
- .circular-progress-bar__negative_7xvdi {
101
+ .circular-progress-bar__negative_tn1xj {
89
102
  stroke: var(--circular-progress-bar-negative-color);
90
103
  }
91
104
 
92
- .circular-progress-bar__backgroundCircle_7xvdi {
105
+ .circular-progress-bar__backgroundCircle_tn1xj {
93
106
  stroke: var(--circular-progress-bar-bg-color);
94
107
  }
@@ -22,9 +22,9 @@ type CircularProgressBarProps = {
22
22
  */
23
23
  view?: 'positive' | 'negative';
24
24
  /**
25
- * Размер (l - 144x144px, m - 120x120px)
25
+ * Размер (l 144×144px, m 120×120px, s — 96×96px)
26
26
  */
27
- size?: 'l' | 'm';
27
+ size?: 'l' | 'm' | 's';
28
28
  /**
29
29
  * Id компонента для тестов
30
30
  */
@@ -2,9 +2,14 @@ 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-bar__component_7xvdi","svg":"circular-progress-bar__svg_7xvdi","title":"circular-progress-bar__title_7xvdi","subtitle":"circular-progress-bar__subtitle_7xvdi","l":"circular-progress-bar__l_7xvdi","label":"circular-progress-bar__label_7xvdi","m":"circular-progress-bar__m_7xvdi","backgroundCircle":"circular-progress-bar__backgroundCircle_7xvdi","progressCircle":"circular-progress-bar__progressCircle_7xvdi","positive":"circular-progress-bar__positive_7xvdi","negative":"circular-progress-bar__negative_7xvdi"};
5
+ var styles = {"component":"circular-progress-bar__component_tn1xj","svg":"circular-progress-bar__svg_tn1xj","title":"circular-progress-bar__title_tn1xj","subtitle":"circular-progress-bar__subtitle_tn1xj","l":"circular-progress-bar__l_tn1xj","label":"circular-progress-bar__label_tn1xj","m":"circular-progress-bar__m_tn1xj","s":"circular-progress-bar__s_tn1xj","backgroundCircle":"circular-progress-bar__backgroundCircle_tn1xj","progressCircle":"circular-progress-bar__progressCircle_tn1xj","positive":"circular-progress-bar__positive_tn1xj","negative":"circular-progress-bar__negative_tn1xj"};
6
6
  require('./index.css')
7
7
 
8
+ const SIZES = {
9
+ s: 96,
10
+ m: 120,
11
+ l: 144,
12
+ };
8
13
  /**
9
14
  * Компонент круглого прогресс бара.
10
15
  */
@@ -13,8 +18,8 @@ const CircularProgressBar = ({ value, view = 'positive', size = 'm', className,
13
18
  const strokeWidth = 8;
14
19
  const maxProgress = 100;
15
20
  const minProgress = 0;
16
- const width = size === 'l' ? 144 : 120;
17
- const height = size === 'l' ? 144 : 120;
21
+ const width = SIZES[size];
22
+ const height = SIZES[size];
18
23
  const center = width / 2;
19
24
  const radius = center - strokeWidth / 2;
20
25
  const circumference = Math.PI * radius * 2;
@@ -1,4 +1,4 @@
1
- /* hash: 7xvdi */
1
+ /* hash: tdnhd */
2
2
  :root {
3
3
  --color-light-bg-tertiary: #e7e9eb;
4
4
  --color-light-graphic-negative: #f15045;
@@ -16,55 +16,68 @@
16
16
  --circular-progress-bar-negative-color: var(--color-light-graphic-negative);
17
17
  }
18
18
 
19
- .circular-progress-bar__component_7xvdi {
19
+ .circular-progress-bar__component_tn1xj {
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-bar__svg_7xvdi {
26
+ .circular-progress-bar__svg_tn1xj {
27
27
  display: block;
28
28
  width: 100%;
29
29
  }
30
30
 
31
- .circular-progress-bar__title_7xvdi,
32
- .circular-progress-bar__subtitle_7xvdi {
31
+ .circular-progress-bar__title_tn1xj,
32
+ .circular-progress-bar__subtitle_tn1xj {
33
33
  overflow: hidden;
34
34
  word-break: break-word;
35
35
  }
36
36
 
37
- .circular-progress-bar__subtitle_7xvdi {
37
+ .circular-progress-bar__subtitle_tn1xj {
38
38
  max-height: 40px;
39
39
  }
40
40
 
41
- .circular-progress-bar__l_7xvdi {
41
+ .circular-progress-bar__l_tn1xj {
42
42
  width: 144px;
43
43
  height: 144px
44
44
  }
45
45
 
46
- .circular-progress-bar__l_7xvdi .circular-progress-bar__label_7xvdi {
46
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__label_tn1xj {
47
47
  max-width: 120px;
48
48
  }
49
49
 
50
- .circular-progress-bar__l_7xvdi .circular-progress-bar__title_7xvdi {
50
+ .circular-progress-bar__l_tn1xj .circular-progress-bar__title_tn1xj {
51
51
  max-height: 32px;
52
52
  }
53
53
 
54
- .circular-progress-bar__m_7xvdi {
54
+ .circular-progress-bar__m_tn1xj {
55
55
  width: 120px;
56
56
  height: 120px
57
57
  }
58
58
 
59
- .circular-progress-bar__m_7xvdi .circular-progress-bar__label_7xvdi {
59
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__label_tn1xj {
60
60
  max-width: 96px;
61
61
  }
62
62
 
63
- .circular-progress-bar__m_7xvdi .circular-progress-bar__title_7xvdi {
63
+ .circular-progress-bar__m_tn1xj .circular-progress-bar__title_tn1xj {
64
64
  max-height: 24px;
65
65
  }
66
66
 
67
- .circular-progress-bar__label_7xvdi {
67
+ .circular-progress-bar__s_tn1xj {
68
+ width: 96px;
69
+ height: 96px
70
+ }
71
+
72
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__label_tn1xj {
73
+ max-width: 72px;
74
+ }
75
+
76
+ .circular-progress-bar__s_tn1xj .circular-progress-bar__title_tn1xj {
77
+ max-height: 24px;
78
+ }
79
+
80
+ .circular-progress-bar__label_tn1xj {
68
81
  text-align: center;
69
82
  position: absolute;
70
83
  top: 50%;
@@ -73,22 +86,22 @@
73
86
  transform: translate(-50%, -50%);
74
87
  }
75
88
 
76
- .circular-progress-bar__backgroundCircle_7xvdi,
77
- .circular-progress-bar__progressCircle_7xvdi {
89
+ .circular-progress-bar__backgroundCircle_tn1xj,
90
+ .circular-progress-bar__progressCircle_tn1xj {
78
91
  width: 100%;
79
92
  height: 100%;
80
93
  fill: transparent;
81
94
  stroke-width: 8;
82
95
  }
83
96
 
84
- .circular-progress-bar__positive_7xvdi {
97
+ .circular-progress-bar__positive_tn1xj {
85
98
  stroke: var(--circular-progress-bar-positive-color);
86
99
  }
87
100
 
88
- .circular-progress-bar__negative_7xvdi {
101
+ .circular-progress-bar__negative_tn1xj {
89
102
  stroke: var(--circular-progress-bar-negative-color);
90
103
  }
91
104
 
92
- .circular-progress-bar__backgroundCircle_7xvdi {
105
+ .circular-progress-bar__backgroundCircle_tn1xj {
93
106
  stroke: var(--circular-progress-bar-bg-color);
94
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-circular-progress-bar",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
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.0.0",
19
+ "@alfalab/core-components-typography": "^2.2.0",
20
20
  "classnames": "^2.2.6"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "^16.9.0 || ^17.0.1"
24
24
  },
25
- "gitHead": "e572a1d2a967ae70c2d5f51340946a923e730266"
25
+ "gitHead": "271b16878748ef76d0fead14b60b477ca5c2fac8"
26
26
  }