@doyourjob/gravity-ui-page-constructor 5.31.221 → 5.31.223

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.
@@ -16,77 +16,98 @@ unpredictable css rules order in build */
16
16
  .pc-benchmark-block__root {
17
17
  display: flex;
18
18
  flex-direction: column;
19
- align-items: center;
20
- }
21
- .pc-benchmark-block__title {
22
- margin-bottom: 32px;
23
- text-align: center;
24
- font-size: 48px;
25
- line-height: 52px;
26
- font-weight: 600;
27
- }
28
- .pc-benchmark-block__content {
29
- flex: 1;
30
- border: 1px #001a2b solid;
31
- border-radius: 24px;
32
- overflow: hidden;
19
+ gap: 32px;
33
20
  }
34
- .pc-benchmark-block__wrap {
21
+ .pc-benchmark-block__head {
35
22
  display: flex;
36
23
  flex-direction: column;
24
+ gap: 16px;
37
25
  align-items: center;
38
- border: 0.5px #001a2b solid;
39
- margin-top: -0.5px;
40
- margin-bottom: -0.5px;
26
+ text-align: center;
41
27
  }
42
- .pc-benchmark-block__wrap.pc-benchmark-block__wrap {
43
- padding-top: 32px;
44
- padding-bottom: 24px;
28
+ @media (max-width: 769px) {
29
+ .pc-benchmark-block__head {
30
+ align-items: initial;
31
+ text-align: initial;
32
+ }
45
33
  }
46
-
47
- .pc-benchmark-block__wrap-inner {
48
- width: 100%;
49
- display: flex;
34
+ .pc-benchmark-block__title {
35
+ font-size: var(--g-text-display-4-font-size, var(--pc-text-display-4-font-size));
36
+ line-height: var(--g-text-display-4-line-height, var(--pc-text-display-4-line-height));
37
+ margin: 0;
38
+ font-weight: var(--g-text-accent-font-weight);
39
+ color: var(--g-color-text-primary);
50
40
  }
51
- @media (max-width: 1081px) {
52
- .pc-benchmark-block__wrap-inner {
53
- flex-direction: column;
41
+ @media (max-width: 769px) {
42
+ .pc-benchmark-block__title {
43
+ font-size: var(--g-text-display-1-font-size, var(--pc-text-display-1-font-size));
44
+ line-height: var(--g-text-display-1-line-height, var(--pc-text-display-1-line-height));
54
45
  }
55
46
  }
56
- .pc-benchmark-block__wrap-title {
57
- text-align: center;
58
- margin-bottom: 48px;
47
+ .pc-benchmark-block__text {
48
+ font-size: 24px;
49
+ line-height: 28px;
50
+ opacity: 0.6;
59
51
  }
60
- @media (max-width: 1081px) {
61
- .pc-benchmark-block__wrap-title {
62
- margin-bottom: 24px;
52
+ @media (max-width: 769px) {
53
+ .pc-benchmark-block__text {
54
+ font-size: var(--g-text-body-3-font-size, var(--pc-text-body-3-font-size));
55
+ line-height: var(--g-text-body-3-line-height, var(--pc-text-body-3-line-height));
56
+ }
57
+ }
58
+ .pc-benchmark-block__items {
59
+ display: flex;
60
+ background-color: var(--local-items-bg, #eeeeee);
61
+ padding: 48px 0;
62
+ border-radius: 24px;
63
+ }
64
+ @media (max-width: 769px) {
65
+ .pc-benchmark-block__items {
66
+ flex-direction: column;
67
+ padding: 0 48px;
63
68
  }
64
69
  }
65
70
  .pc-benchmark-block__item {
66
71
  flex: 1;
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 16px;
67
75
  text-align: center;
68
- padding-left: 8px;
69
- padding-right: 8px;
76
+ padding: 0 16px;
77
+ }
78
+ .pc-benchmark-block__item + .pc-benchmark-block__item {
79
+ border-left: 1px solid rgba(0, 26, 43, 0.2);
70
80
  }
71
- @media (max-width: 1081px) {
81
+ @media (max-width: 769px) {
82
+ .pc-benchmark-block__item {
83
+ padding: 24px 0;
84
+ }
72
85
  .pc-benchmark-block__item + .pc-benchmark-block__item {
73
- margin-top: 32px;
86
+ border-left: none;
87
+ border-top: 1px solid rgba(0, 26, 43, 0.2);
74
88
  }
75
89
  }
76
- .pc-benchmark-block__value {
77
- font-size: 64px;
90
+ .pc-benchmark-block__item-value {
91
+ font-size: 48px;
78
92
  line-height: 52px;
79
93
  font-weight: 600;
80
- letter-spacing: -0.002em;
81
- margin-top: 12px;
82
- margin-bottom: 12px;
83
94
  }
84
95
  @media (max-width: 769px) {
85
- .pc-benchmark-block__value {
86
- font-size: 32px;
87
- line-height: 26px;
96
+ .pc-benchmark-block__item-value {
97
+ font-size: 40px;
98
+ line-height: 48px;
88
99
  }
89
100
  }
90
- .pc-benchmark-block__label {
91
- font-weight: 700;
101
+ .pc-benchmark-block__item-value .odometer {
102
+ font-family: inherit;
103
+ }
104
+ .pc-benchmark-block__item-value .odometer-digit {
105
+ font-variant-numeric: tabular-nums;
106
+ }
107
+ .pc-benchmark-block__item-value .odometer-digit-inner {
108
+ text-align: center;
109
+ }
110
+ .pc-benchmark-block__item-text {
111
+ font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
112
+ line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
92
113
  }
@@ -2,26 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
- const uikit_1 = require("@gravity-ui/uikit");
6
5
  const components_1 = require("../../components");
7
- const grid_1 = require("../../grid");
8
6
  const utils_1 = require("../../utils");
9
7
  const b = (0, utils_1.block)('benchmark-block');
10
- const defaultSizes = { all: 12 };
11
- const Benchmark = ({ title, data, duration, animated }) => {
8
+ const Benchmark = ({ title, text, items, metricsColor, duration, animated, }) => {
12
9
  const [playNumbers, setPlayNumbers] = (0, react_1.useState)(false);
13
10
  const handleOnAnimateStart = (0, react_1.useCallback)(() => setPlayNumbers(true), []);
11
+ const styles = (0, react_1.useMemo)(() => metricsColor
12
+ ? {
13
+ ['--local-items-bg']: metricsColor,
14
+ }
15
+ : {}, [metricsColor]);
14
16
  return (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated, onAnimateStart: handleOnAnimateStart },
15
- react_1.default.createElement("div", { className: b('root') },
16
- title && react_1.default.createElement("div", { className: b('title') }, title),
17
- react_1.default.createElement(grid_1.Grid, { className: b('content') },
18
- react_1.default.createElement(grid_1.Row, null, data.map((column, columnIndex) => (react_1.default.createElement(grid_1.Col, { key: columnIndex, sizes: column.sizes || defaultSizes, className: b('wrap') },
19
- column.title && (react_1.default.createElement(uikit_1.Text, { variant: "header-2", className: b('wrap-title') }, column.title)),
20
- react_1.default.createElement("div", { className: b('wrap-inner') }, column.items.map((item, index) => (react_1.default.createElement("div", { key: index, className: b('item') },
21
- item.top && (react_1.default.createElement(uikit_1.Text, { variant: "body-1", className: b('label') }, item.top)),
22
- react_1.default.createElement("div", { className: b('value') },
23
- react_1.default.createElement(components_1.Odometer, { value: item.value, initValue: item.init, duration: duration, animated: playNumbers }),
24
- item.postfix),
25
- item.bottom && (react_1.default.createElement(uikit_1.Text, { variant: "body-1", className: b('label') }, item.bottom))))))))))))));
17
+ react_1.default.createElement("div", { className: b('root'), style: styles },
18
+ title || text ? (react_1.default.createElement("div", { className: b('head') },
19
+ title && react_1.default.createElement("h2", { className: b('title') }, title),
20
+ text && react_1.default.createElement("div", { className: b('text') }, text))) : null,
21
+ react_1.default.createElement("div", { className: b('items') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (react_1.default.createElement("div", { key: index, className: b('item') },
22
+ react_1.default.createElement("div", { className: b('item-value') },
23
+ react_1.default.createElement(components_1.Odometer, { value: item.value, initValue: item.init, duration: duration, animated: playNumbers }),
24
+ item.postfix),
25
+ item.text && react_1.default.createElement("div", { className: b('item-text') }, item.text))))))));
26
26
  };
27
27
  exports.default = Benchmark;
@@ -6,51 +6,30 @@ export declare const BenchmarkBlock: {
6
6
  title: {
7
7
  type: string;
8
8
  };
9
+ text: {
10
+ type: string;
11
+ };
9
12
  duration: {
10
13
  type: string;
11
14
  };
12
- data: {
15
+ items: {
13
16
  type: string;
14
17
  items: {
15
18
  type: string;
16
19
  additionalProperties: boolean;
17
20
  required: string[];
18
21
  properties: {
19
- title: {
20
- type: string;
21
- };
22
- sizes: {
23
- type: string;
24
- additionalProperties: {
25
- type: string;
26
- additionalProperties: boolean;
27
- properties: {};
28
- };
29
- };
30
- items: {
31
- type: string;
32
- items: {
33
- type: string;
34
- additionalProperties: boolean;
35
- required: string[];
36
- properties: {
37
- top: {
38
- type: string;
39
- };
40
- bottom: {
41
- type: string;
42
- };
43
- value: {
44
- type: string;
45
- };
46
- init: {
47
- type: string;
48
- };
49
- postfix: {
50
- type: string;
51
- };
52
- };
53
- };
22
+ text: {
23
+ type: string;
24
+ };
25
+ init: {
26
+ type: string;
27
+ };
28
+ postfix: {
29
+ type: string;
30
+ };
31
+ value: {
32
+ type: string;
54
33
  };
55
34
  };
56
35
  };
@@ -8,46 +8,28 @@ exports.BenchmarkBlock = {
8
8
  required: ['data'],
9
9
  properties: Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), { title: {
10
10
  type: 'string',
11
+ }, text: {
12
+ type: 'string',
11
13
  }, duration: {
12
14
  type: 'number',
13
- }, data: {
15
+ }, items: {
14
16
  type: 'array',
15
17
  items: {
16
18
  type: 'object',
17
19
  additionalProperties: false,
18
- required: ['items'],
20
+ required: ['value'],
19
21
  properties: {
20
- title: {
22
+ text: {
21
23
  type: 'string',
22
24
  },
23
- sizes: {
24
- type: 'object',
25
- additionalProperties: common_1.containerSizesObject,
25
+ init: {
26
+ type: 'number',
27
+ },
28
+ postfix: {
29
+ type: 'string',
26
30
  },
27
- items: {
28
- type: 'array',
29
- items: {
30
- type: 'object',
31
- additionalProperties: false,
32
- required: ['value'],
33
- properties: {
34
- top: {
35
- type: 'string',
36
- },
37
- bottom: {
38
- type: 'string',
39
- },
40
- value: {
41
- type: 'number',
42
- },
43
- init: {
44
- type: 'number',
45
- },
46
- postfix: {
47
- type: 'string',
48
- },
49
- },
50
- },
31
+ value: {
32
+ type: 'number',
51
33
  },
52
34
  },
53
35
  },
@@ -14,7 +14,7 @@ const Image_1 = tslib_1.__importDefault(require("./Image/Image"));
14
14
  const Video_1 = tslib_1.__importDefault(require("./Video/Video"));
15
15
  const b = (0, utils_1.block)('Media');
16
16
  const Media = (props) => {
17
- const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
17
+ const { animated, image, video, youtube, videoIframe, dataLens, color, height, previewImg, parallax = false, fullscreen, analyticsEvents, className, imageClassName, videoClassName, youtubeClassName, disableImageSliderForArrayInput, playVideo = true, isBackground, playButton, playButtonСorner, customBarControlsClassName, qa, ratio, autoplay, onImageLoad, iframe, margins, videoMicrodata, } = props;
18
18
  const [hasVideoFallback, setHasVideoFallback] = (0, react_1.useState)(false);
19
19
  const { microdata } = (0, react_1.useContext)(innerContext_1.InnerContext);
20
20
  const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'video');
@@ -46,7 +46,7 @@ const Media = (props) => {
46
46
  }
47
47
  }
48
48
  if (youtube || videoIframe) {
49
- result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
49
+ result = (react_1.default.createElement(VideoBlock_1.default, { className: b('youtube', youtubeClassName), record: youtube, videoIframe: videoIframe, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, "playButton\u0421orner": playButtonСorner, height: height, fullscreen: fullscreen, analyticsEvents: analyticsEvents, autoplay: autoplay, onImageLoad: onImageLoad }));
50
50
  }
51
51
  if (dataLens) {
52
52
  result = react_1.default.createElement(DataLens_1.default, { dataLens: dataLens });
@@ -81,6 +81,7 @@ const Media = (props) => {
81
81
  customBarControlsClassName,
82
82
  ratio,
83
83
  youtubeClassName,
84
+ playButtonСorner,
84
85
  autoplay,
85
86
  margins,
86
87
  ]);
@@ -10,13 +10,16 @@ const Odometer = ({ initValue, value, duration = 2000, animated }) => {
10
10
  (0, react_1.useEffect)(() => {
11
11
  if (typeof window === 'undefined' || !animated)
12
12
  return;
13
+ const valueStr = value.toString();
14
+ const dotIndex = valueStr.indexOf('.');
15
+ const format = dotIndex === -1 ? '(,ddd)' : `(,ddd).${'d'.repeat(valueStr.length - dotIndex - 1)}`;
13
16
  odometer.current = new window.Odometer({
14
17
  el: ref.current,
15
18
  value: initValue || 0,
16
- format: '',
19
+ format,
17
20
  duration,
18
21
  });
19
- }, [duration, initValue, animated]);
22
+ }, [duration, initValue, animated, value]);
20
23
  (0, react_1.useEffect)(() => {
21
24
  var _a;
22
25
  if (animated) {
@@ -51,6 +51,12 @@ unpredictable css rules order in build */
51
51
  .pc-VideoBlock__button:focus:not(:focus-visible) {
52
52
  outline: 0;
53
53
  }
54
+ .pc-VideoBlock__button_corner {
55
+ right: 16px;
56
+ bottom: 16px;
57
+ width: 44px;
58
+ height: 44px;
59
+ }
54
60
  .pc-VideoBlock__icon {
55
61
  margin-left: 1px;
56
62
  }
@@ -14,6 +14,7 @@ export interface VideoBlockProps extends AnalyticsEventsBase {
14
14
  className?: string;
15
15
  previewImg?: string;
16
16
  playButton?: React.ReactNode;
17
+ playButtonСorner?: boolean;
17
18
  playButtonId?: string;
18
19
  height?: number;
19
20
  fullscreen?: boolean;
@@ -43,7 +43,7 @@ function getHeight(width) {
43
43
  }
44
44
  exports.getHeight = getHeight;
45
45
  const VideoBlock = (props) => {
46
- const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
46
+ const { stream, record, videoIframe, attributes, className, id, previewImg, playButton, playButtonСorner, playButtonId, height, fullscreen, analyticsEvents, autoplay, onImageLoad, } = props;
47
47
  const handleAnalytics = (0, useAnalytics_1.useAnalytics)(common_1.DefaultEventNames.VideoPreview);
48
48
  const src = videoIframe ? videoIframe : getYoutubeVideoSrc(stream, record);
49
49
  const ref = (0, react_1.useRef)(null);
@@ -97,7 +97,7 @@ const VideoBlock = (props) => {
97
97
  iframeContent,
98
98
  previewImg && !hidePreview && !fullscreen && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick, onKeyDown: onPreviewKeyDown, role: "button", tabIndex: 0, "aria-labelledby": playButton ? playButtonId : buttonId },
99
99
  react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper'), onLoad: onImageLoad }),
100
- playButton || (react_1.default.createElement("button", { title: "Play", id: buttonId, className: b('button') },
101
- react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayFill, size: 24 })))))));
100
+ playButton || (react_1.default.createElement("button", { title: "Play", id: buttonId, className: b('button', { corner: playButtonСorner }) },
101
+ react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayFill, size: playButtonСorner ? 16 : 24 })))))));
102
102
  };
103
103
  exports.default = VideoBlock;
@@ -625,17 +625,14 @@ export interface AudioBlockProps {
625
625
  }
626
626
  export interface BenchmarkBlockProps extends Animatable {
627
627
  title?: string;
628
+ text?: string;
628
629
  duration?: number;
629
- data: {
630
- title?: string;
631
- sizes?: GridColumnSizesType;
632
- items: {
633
- top?: string;
634
- value: number;
635
- init?: number;
636
- postfix?: string;
637
- bottom?: string;
638
- }[];
630
+ metricsColor?: string;
631
+ items?: {
632
+ value: number;
633
+ text?: string;
634
+ init?: number;
635
+ postfix?: string;
639
636
  }[];
640
637
  }
641
638
  export type FilterTag = {
@@ -192,6 +192,7 @@ export interface MediaComponentVideoIframeProps {
192
192
  export interface MediaComponentYoutubeProps {
193
193
  youtube: string;
194
194
  previewImg?: string;
195
+ playButtonСorner?: boolean;
195
196
  fullscreen?: boolean;
196
197
  }
197
198
  export interface MediaComponentImageProps {
@@ -16,77 +16,98 @@ unpredictable css rules order in build */
16
16
  .pc-benchmark-block__root {
17
17
  display: flex;
18
18
  flex-direction: column;
19
- align-items: center;
20
- }
21
- .pc-benchmark-block__title {
22
- margin-bottom: 32px;
23
- text-align: center;
24
- font-size: 48px;
25
- line-height: 52px;
26
- font-weight: 600;
27
- }
28
- .pc-benchmark-block__content {
29
- flex: 1;
30
- border: 1px #001a2b solid;
31
- border-radius: 24px;
32
- overflow: hidden;
19
+ gap: 32px;
33
20
  }
34
- .pc-benchmark-block__wrap {
21
+ .pc-benchmark-block__head {
35
22
  display: flex;
36
23
  flex-direction: column;
24
+ gap: 16px;
37
25
  align-items: center;
38
- border: 0.5px #001a2b solid;
39
- margin-top: -0.5px;
40
- margin-bottom: -0.5px;
26
+ text-align: center;
41
27
  }
42
- .pc-benchmark-block__wrap.pc-benchmark-block__wrap {
43
- padding-top: 32px;
44
- padding-bottom: 24px;
28
+ @media (max-width: 769px) {
29
+ .pc-benchmark-block__head {
30
+ align-items: initial;
31
+ text-align: initial;
32
+ }
45
33
  }
46
-
47
- .pc-benchmark-block__wrap-inner {
48
- width: 100%;
49
- display: flex;
34
+ .pc-benchmark-block__title {
35
+ font-size: var(--g-text-display-4-font-size, var(--pc-text-display-4-font-size));
36
+ line-height: var(--g-text-display-4-line-height, var(--pc-text-display-4-line-height));
37
+ margin: 0;
38
+ font-weight: var(--g-text-accent-font-weight);
39
+ color: var(--g-color-text-primary);
50
40
  }
51
- @media (max-width: 1081px) {
52
- .pc-benchmark-block__wrap-inner {
53
- flex-direction: column;
41
+ @media (max-width: 769px) {
42
+ .pc-benchmark-block__title {
43
+ font-size: var(--g-text-display-1-font-size, var(--pc-text-display-1-font-size));
44
+ line-height: var(--g-text-display-1-line-height, var(--pc-text-display-1-line-height));
54
45
  }
55
46
  }
56
- .pc-benchmark-block__wrap-title {
57
- text-align: center;
58
- margin-bottom: 48px;
47
+ .pc-benchmark-block__text {
48
+ font-size: 24px;
49
+ line-height: 28px;
50
+ opacity: 0.6;
59
51
  }
60
- @media (max-width: 1081px) {
61
- .pc-benchmark-block__wrap-title {
62
- margin-bottom: 24px;
52
+ @media (max-width: 769px) {
53
+ .pc-benchmark-block__text {
54
+ font-size: var(--g-text-body-3-font-size, var(--pc-text-body-3-font-size));
55
+ line-height: var(--g-text-body-3-line-height, var(--pc-text-body-3-line-height));
56
+ }
57
+ }
58
+ .pc-benchmark-block__items {
59
+ display: flex;
60
+ background-color: var(--local-items-bg, #eeeeee);
61
+ padding: 48px 0;
62
+ border-radius: 24px;
63
+ }
64
+ @media (max-width: 769px) {
65
+ .pc-benchmark-block__items {
66
+ flex-direction: column;
67
+ padding: 0 48px;
63
68
  }
64
69
  }
65
70
  .pc-benchmark-block__item {
66
71
  flex: 1;
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 16px;
67
75
  text-align: center;
68
- padding-left: 8px;
69
- padding-right: 8px;
76
+ padding: 0 16px;
77
+ }
78
+ .pc-benchmark-block__item + .pc-benchmark-block__item {
79
+ border-left: 1px solid rgba(0, 26, 43, 0.2);
70
80
  }
71
- @media (max-width: 1081px) {
81
+ @media (max-width: 769px) {
82
+ .pc-benchmark-block__item {
83
+ padding: 24px 0;
84
+ }
72
85
  .pc-benchmark-block__item + .pc-benchmark-block__item {
73
- margin-top: 32px;
86
+ border-left: none;
87
+ border-top: 1px solid rgba(0, 26, 43, 0.2);
74
88
  }
75
89
  }
76
- .pc-benchmark-block__value {
77
- font-size: 64px;
90
+ .pc-benchmark-block__item-value {
91
+ font-size: 48px;
78
92
  line-height: 52px;
79
93
  font-weight: 600;
80
- letter-spacing: -0.002em;
81
- margin-top: 12px;
82
- margin-bottom: 12px;
83
94
  }
84
95
  @media (max-width: 769px) {
85
- .pc-benchmark-block__value {
86
- font-size: 32px;
87
- line-height: 26px;
96
+ .pc-benchmark-block__item-value {
97
+ font-size: 40px;
98
+ line-height: 48px;
88
99
  }
89
100
  }
90
- .pc-benchmark-block__label {
91
- font-weight: 700;
101
+ .pc-benchmark-block__item-value .odometer {
102
+ font-family: inherit;
103
+ }
104
+ .pc-benchmark-block__item-value .odometer-digit {
105
+ font-variant-numeric: tabular-nums;
106
+ }
107
+ .pc-benchmark-block__item-value .odometer-digit-inner {
108
+ text-align: center;
109
+ }
110
+ .pc-benchmark-block__item-text {
111
+ font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
112
+ line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
92
113
  }
@@ -1,25 +1,25 @@
1
- import React, { useCallback, useState } from 'react';
2
- import { Text } from '@gravity-ui/uikit';
1
+ import React, { useCallback, useMemo, useState } from 'react';
3
2
  import { AnimateBlock, Odometer } from '../../components';
4
- import { Col, Grid, Row } from '../../grid';
5
3
  import { block } from '../../utils';
6
4
  import './Benchmark.css';
7
5
  const b = block('benchmark-block');
8
- const defaultSizes = { all: 12 };
9
- const Benchmark = ({ title, data, duration, animated }) => {
6
+ const Benchmark = ({ title, text, items, metricsColor, duration, animated, }) => {
10
7
  const [playNumbers, setPlayNumbers] = useState(false);
11
8
  const handleOnAnimateStart = useCallback(() => setPlayNumbers(true), []);
9
+ const styles = useMemo(() => metricsColor
10
+ ? {
11
+ ['--local-items-bg']: metricsColor,
12
+ }
13
+ : {}, [metricsColor]);
12
14
  return (React.createElement(AnimateBlock, { className: b(), animate: animated, onAnimateStart: handleOnAnimateStart },
13
- React.createElement("div", { className: b('root') },
14
- title && React.createElement("div", { className: b('title') }, title),
15
- React.createElement(Grid, { className: b('content') },
16
- React.createElement(Row, null, data.map((column, columnIndex) => (React.createElement(Col, { key: columnIndex, sizes: column.sizes || defaultSizes, className: b('wrap') },
17
- column.title && (React.createElement(Text, { variant: "header-2", className: b('wrap-title') }, column.title)),
18
- React.createElement("div", { className: b('wrap-inner') }, column.items.map((item, index) => (React.createElement("div", { key: index, className: b('item') },
19
- item.top && (React.createElement(Text, { variant: "body-1", className: b('label') }, item.top)),
20
- React.createElement("div", { className: b('value') },
21
- React.createElement(Odometer, { value: item.value, initValue: item.init, duration: duration, animated: playNumbers }),
22
- item.postfix),
23
- item.bottom && (React.createElement(Text, { variant: "body-1", className: b('label') }, item.bottom))))))))))))));
15
+ React.createElement("div", { className: b('root'), style: styles },
16
+ title || text ? (React.createElement("div", { className: b('head') },
17
+ title && React.createElement("h2", { className: b('title') }, title),
18
+ text && React.createElement("div", { className: b('text') }, text))) : null,
19
+ React.createElement("div", { className: b('items') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (React.createElement("div", { key: index, className: b('item') },
20
+ React.createElement("div", { className: b('item-value') },
21
+ React.createElement(Odometer, { value: item.value, initValue: item.init, duration: duration, animated: playNumbers }),
22
+ item.postfix),
23
+ item.text && React.createElement("div", { className: b('item-text') }, item.text))))))));
24
24
  };
25
25
  export default Benchmark;