@gravity-ui/page-constructor 3.0.0-alpha.1 → 3.0.0-alpha.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/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/cjs/blocks/Slider/Slider.js +2 -2
- package/build/cjs/blocks/Tabs/Tabs.js +2 -2
- package/build/cjs/components/MediaBase/MediaBase.js +2 -2
- package/build/cjs/components/Title/Title.css +8 -103
- package/build/cjs/components/Title/Title.d.ts +5 -8
- package/build/cjs/components/Title/Title.js +15 -50
- package/build/cjs/components/Title/TitleItem.css +111 -0
- package/build/cjs/components/Title/TitleItem.d.ts +10 -0
- package/build/cjs/components/Title/TitleItem.js +57 -0
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +4 -4
- package/build/cjs/models/constructor-items/blocks.d.ts +8 -8
- package/build/cjs/models/constructor-items/common.d.ts +4 -4
- package/build/cjs/sub-blocks/Content/Content.css +2 -2
- package/build/cjs/sub-blocks/Content/Content.js +3 -3
- package/build/cjs/text-transform/config.d.ts +2 -2
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -2
- package/build/esm/blocks/Slider/Slider.js +2 -2
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/components/MediaBase/MediaBase.js +2 -2
- package/build/esm/components/Title/Title.css +8 -103
- package/build/esm/components/Title/Title.d.ts +5 -8
- package/build/esm/components/Title/Title.js +17 -49
- package/build/esm/components/Title/TitleItem.css +111 -0
- package/build/esm/components/Title/TitleItem.d.ts +11 -0
- package/build/esm/components/Title/TitleItem.js +53 -0
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +8 -8
- package/build/esm/models/constructor-items/common.d.ts +4 -4
- package/build/esm/sub-blocks/Content/Content.css +2 -2
- package/build/esm/sub-blocks/Content/Content.js +3 -3
- package/build/esm/text-transform/config.d.ts +2 -2
- package/package.json +1 -4
- package/server/models/constructor-items/blocks.d.ts +8 -8
- package/server/models/constructor-items/common.d.ts +4 -4
- package/server/text-transform/config.d.ts +2 -2
- package/build/cjs/components/BlockHeader/BlockHeader.css +0 -16
- package/build/cjs/components/BlockHeader/BlockHeader.d.ts +0 -7
- package/build/cjs/components/BlockHeader/BlockHeader.js +0 -22
- package/build/esm/components/BlockHeader/BlockHeader.css +0 -16
- package/build/esm/components/BlockHeader/BlockHeader.d.ts +0 -8
- package/build/esm/components/BlockHeader/BlockHeader.js +0 -21
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TitleItemProps } from '../models';
|
|
2
2
|
import { Parser, Transformer, TransformerRaw, typografTransformer, yfmTransformer } from './common';
|
|
3
3
|
export declare const blockHeaderTransformer: ({
|
|
4
4
|
fields: string[];
|
|
5
5
|
transformer: typeof typografTransformer;
|
|
6
|
-
parser: (transformer: Transformer, title:
|
|
6
|
+
parser: (transformer: Transformer, title: TitleItemProps | string) => string | {
|
|
7
7
|
text: string;
|
|
8
8
|
navTitle?: string | undefined;
|
|
9
9
|
anchor?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { AnimateBlock,
|
|
2
|
+
import { AnimateBlock, HTML, Title } from '../../components/';
|
|
3
3
|
import Image from '../../components/Image/Image';
|
|
4
4
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
5
5
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
@@ -16,7 +16,7 @@ const DEFAULT_SIZES = {
|
|
|
16
16
|
export const ExtendedFeaturesBlock = ({ title, description, items, colSizes = DEFAULT_SIZES, animated, }) => {
|
|
17
17
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
18
18
|
return (React.createElement(AnimateBlock, { className: b(), animate: animated },
|
|
19
|
-
React.createElement(
|
|
19
|
+
React.createElement(Title, { title: title, description: description, className: b('header') }),
|
|
20
20
|
React.createElement("div", { className: b('items') },
|
|
21
21
|
React.createElement(Row, null, items.map(({ title: itemTitle, text, link, links, label, icon, buttons, additionalInfo, }) => {
|
|
22
22
|
const itemLinks = links || [];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
3
3
|
import BalancedMasonry from '../../components/BalancedMasonry/BalancedMasonry';
|
|
4
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
5
4
|
import FullWidthBackground from '../../components/FullWidthBackground/FullWidthBackground';
|
|
6
5
|
import Media from '../../components/Media/Media';
|
|
6
|
+
import Title from '../../components/Title/Title';
|
|
7
7
|
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
8
8
|
import { BREAKPOINTS } from '../../constants';
|
|
9
9
|
import { block } from '../../utils';
|
|
@@ -19,7 +19,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
19
19
|
const backgroundTheme = theme || 'default';
|
|
20
20
|
return (React.createElement(AnimateBlock, { className: b({ [backgroundTheme]: true }), animate: animated },
|
|
21
21
|
React.createElement(FullWidthBackground, { className: b('background', { [backgroundTheme]: true }) }),
|
|
22
|
-
React.createElement(
|
|
22
|
+
React.createElement(Title, { title: title, description: description, className: b('header') }),
|
|
23
23
|
React.createElement(BalancedMasonry, { breakpointCols: breakpointColumns, className: b('card-container'), columnClassName: b('card-container-column') }, items.map(({ title: cardTitle, text, media, theme: cardTheme }, index) => {
|
|
24
24
|
const blockModifier = backgroundTheme === 'default' ? 'default' : 'light';
|
|
25
25
|
const themeMod = cardTheme || blockModifier || '';
|
|
@@ -3,8 +3,8 @@ import _ from 'lodash';
|
|
|
3
3
|
import SlickSlider from 'react-slick';
|
|
4
4
|
import Anchor from '../../components/Anchor/Anchor';
|
|
5
5
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
6
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
7
6
|
import OutsideClick from '../../components/OutsideClick/OutsideClick';
|
|
7
|
+
import Title from '../../components/Title/Title';
|
|
8
8
|
import { BREAKPOINTS } from '../../constants';
|
|
9
9
|
import { MobileContext } from '../../context/mobileContext';
|
|
10
10
|
import { SSRContext } from '../../context/ssrContext';
|
|
@@ -182,7 +182,7 @@ export const SliderBlock = (props) => {
|
|
|
182
182
|
type,
|
|
183
183
|
}, blockClassName) },
|
|
184
184
|
anchorId && React.createElement(Anchor, { id: anchorId }),
|
|
185
|
-
React.createElement(
|
|
185
|
+
React.createElement(Title, { title: title, description: description, className: b('header', { 'no-description': !description }) }),
|
|
186
186
|
React.createElement(AnimateBlock, { className: b('animate-slides'), animate: animated }, renderSlider()))));
|
|
187
187
|
};
|
|
188
188
|
// TODO remove this and rework PriceDetailed CLOUDFRONT-12230
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Fragment, useContext, useRef, useState } from 'react';
|
|
2
2
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
3
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
4
3
|
import ButtonTabs from '../../components/ButtonTabs/ButtonTabs';
|
|
5
4
|
import FullScreenImage from '../../components/FullscreenImage/FullscreenImage';
|
|
6
5
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
7
6
|
import Media from '../../components/Media/Media';
|
|
7
|
+
import Title from '../../components/Title/Title';
|
|
8
8
|
import { getHeight } from '../../components/VideoBlock/VideoBlock';
|
|
9
9
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
10
10
|
import { Col, GridColumnOrderClasses, Row } from '../../grid';
|
|
@@ -51,7 +51,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
51
51
|
e.currentTarget.scrollIntoView({ inline: 'center', behavior: 'smooth', block: 'nearest' });
|
|
52
52
|
};
|
|
53
53
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
54
|
-
React.createElement(
|
|
54
|
+
React.createElement(Title, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
55
55
|
React.createElement(Row, null,
|
|
56
56
|
React.createElement(Col, { sizes: tabsColSizes },
|
|
57
57
|
React.createElement(ButtonTabs, { items: tabs, onSelectTab: onSelectTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
4
|
-
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
5
4
|
import { Col, Grid, GridColumnSize, Row } from '../../grid';
|
|
6
5
|
import { block } from '../../utils';
|
|
6
|
+
import Title from '../Title/Title';
|
|
7
7
|
import MediaContent from './MediaBaseContent';
|
|
8
8
|
import './MediaBase.css';
|
|
9
9
|
const b = block('media-base');
|
|
@@ -22,7 +22,7 @@ export const MediaBase = (props) => {
|
|
|
22
22
|
const mediaContent = !mediaOnly && React.createElement(MediaContent, Object.assign({}, mediaContentProps));
|
|
23
23
|
const card = children.type === Card ? children === null || children === void 0 ? void 0 : children.props.children : null;
|
|
24
24
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: onScroll, animate: animated },
|
|
25
|
-
mediaOnly && (React.createElement(
|
|
25
|
+
mediaOnly && (React.createElement(Title, { className: b('header'), title: title, description: description, colSizes: { all: 12 } })),
|
|
26
26
|
React.createElement(Grid, null,
|
|
27
27
|
React.createElement(Row, { className: b('row', {
|
|
28
28
|
reverse: direction === 'media-content',
|
|
@@ -1,111 +1,16 @@
|
|
|
1
|
-
.pc-title-block_size_l, .pc-title-block_size_m, .pc-title-block_size_s, .pc-title-block_size_xs {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
/* use this for style redefinitions to awoid problems with
|
|
6
2
|
unpredictable css rules order in build */
|
|
7
|
-
.pc-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
.pc-title-block_justify_end {
|
|
11
|
-
text-align: right;
|
|
3
|
+
.pc-title__description {
|
|
4
|
+
margin-top: 12px;
|
|
12
5
|
}
|
|
13
|
-
.pc-
|
|
6
|
+
.pc-title__description .yfm {
|
|
14
7
|
font-size: var(--yc-text-body-3-font-size);
|
|
15
8
|
line-height: var(--yc-text-body-3-line-height);
|
|
16
|
-
color: var(--pc-text-header-color);
|
|
17
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
18
|
-
}
|
|
19
|
-
.pc-title-block_size_s {
|
|
20
|
-
font-size: var(--yc-text-header-1-font-size);
|
|
21
|
-
line-height: var(--yc-text-header-1-line-height);
|
|
22
|
-
color: var(--pc-text-header-color);
|
|
23
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
24
|
-
margin-top: 32px;
|
|
25
|
-
}
|
|
26
|
-
.pc-title-block_size_m {
|
|
27
|
-
font-size: var(--yc-text-display-2-font-size);
|
|
28
|
-
line-height: var(--yc-text-display-2-line-height);
|
|
29
|
-
color: var(--pc-text-header-color);
|
|
30
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
31
|
-
margin-top: 48px;
|
|
32
|
-
}
|
|
33
|
-
@media (max-width: 576px) {
|
|
34
|
-
.pc-title-block_size_m {
|
|
35
|
-
font-size: var(--yc-text-display-1-font-size);
|
|
36
|
-
line-height: var(--yc-text-display-1-line-height);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.pc-title-block_size_l {
|
|
40
|
-
font-size: var(--yc-text-display-4-font-size);
|
|
41
|
-
line-height: var(--yc-text-display-4-line-height);
|
|
42
|
-
color: var(--pc-text-header-color);
|
|
43
|
-
font-weight: var(--yc-text-accent-font-weight);
|
|
44
|
-
margin-top: 96px;
|
|
45
|
-
}
|
|
46
|
-
@media (max-width: 577px) {
|
|
47
|
-
.pc-title-block_size_l {
|
|
48
|
-
font-size: var(--yc-text-display-2-font-size);
|
|
49
|
-
line-height: var(--yc-text-display-2-line-height);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
.pc-title-block__arrow {
|
|
53
|
-
margin-top: 10px;
|
|
54
|
-
}
|
|
55
|
-
.pc-title-block__arrow_size_xs {
|
|
56
|
-
margin-top: 7px;
|
|
57
|
-
}
|
|
58
|
-
.pc-title-block__arrow_size_s {
|
|
59
|
-
margin-top: 5px;
|
|
60
|
-
}
|
|
61
|
-
.pc-title-block__link {
|
|
62
|
-
color: inherit;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
padding-right: 8px;
|
|
65
|
-
}
|
|
66
|
-
.pc-title-block__link:hover, .pc-title-block__link:active {
|
|
67
|
-
--pc-text-header-color: inherit;
|
|
68
|
-
color: inherit;
|
|
69
|
-
}
|
|
70
|
-
.pc-title-block__link:hover {
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
}
|
|
73
|
-
.pc-title-block__link:hover .pc-title-block__arrow {
|
|
74
|
-
margin-left: 10px;
|
|
75
|
-
}
|
|
76
|
-
.pc-title-block__link:hover .pc-title-block__arrow_size_xs {
|
|
77
|
-
margin-left: 6px;
|
|
78
|
-
}
|
|
79
|
-
.pc-title-block__link:hover .pc-title-block__arrow_size_s {
|
|
80
|
-
margin-left: 8px;
|
|
81
|
-
}
|
|
82
|
-
.pc-title-block__text {
|
|
83
|
-
white-space: normal;
|
|
84
|
-
}
|
|
85
|
-
.pc-title-block__text a {
|
|
86
|
-
outline: none;
|
|
87
|
-
color: var(--yc-color-text-link);
|
|
88
|
-
text-decoration: none;
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
}
|
|
91
|
-
.utilityfocus .pc-title-block__text a:focus {
|
|
92
|
-
outline: 2px solid #ffdb4d;
|
|
93
|
-
}
|
|
94
|
-
.pc-title-block__text a:hover, .pc-title-block__text a:active {
|
|
95
|
-
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
96
|
-
color: var(--yc-color-text-link-hover);
|
|
97
|
-
}
|
|
98
|
-
.pc-title-block__wrapper {
|
|
99
|
-
white-space: nowrap;
|
|
100
9
|
}
|
|
101
|
-
.pc-
|
|
102
|
-
margin-top:
|
|
10
|
+
.pc-title__description_titleSize_s, .pc-title__description_titleSize_xs {
|
|
11
|
+
margin-top: 8px;
|
|
103
12
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
.pc-title-block__arrow_size_m, .pc-title-block__arrow_size_l {
|
|
109
|
-
margin-top: 9px;
|
|
110
|
-
}
|
|
13
|
+
.pc-title__description_titleSize_s .yfm, .pc-title__description_titleSize_xs .yfm {
|
|
14
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
111
16
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridColumnSizesType } from '../../grid';
|
|
2
|
+
import { ClassNameProps, TitleProps as TitleParams } from '../../models';
|
|
2
3
|
import './Title.css';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
className?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
dataQa?: string;
|
|
8
|
-
resetMargin?: boolean;
|
|
4
|
+
export interface TitleProps extends TitleParams {
|
|
5
|
+
colSizes?: GridColumnSizesType;
|
|
9
6
|
}
|
|
10
|
-
declare const Title: (
|
|
7
|
+
declare const Title: ({ title, description, className, colSizes, }: TitleProps & ClassNameProps) => JSX.Element | null;
|
|
11
8
|
export default Title;
|
|
@@ -1,53 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Col } from '../../grid';
|
|
4
|
+
import { block } from '../../utils';
|
|
5
|
+
import YFMWrapper from '../YFMWrapper/YFMWrapper';
|
|
6
|
+
import TitleItem from './TitleItem';
|
|
7
7
|
import './Title.css';
|
|
8
|
-
const b = block('title
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return 13;
|
|
13
|
-
case 's':
|
|
14
|
-
return 16;
|
|
15
|
-
case 'm':
|
|
16
|
-
return isMobile ? 22 : 24;
|
|
17
|
-
case 'l':
|
|
18
|
-
return isMobile ? 26 : 38;
|
|
19
|
-
default:
|
|
20
|
-
return 20;
|
|
8
|
+
const b = block('title');
|
|
9
|
+
const Title = ({ title, description, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
|
+
if (!title && !description) {
|
|
11
|
+
return null;
|
|
21
12
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
custom && (React.createElement(React.Fragment, null,
|
|
30
|
-
"\u00A0",
|
|
31
|
-
React.createElement("span", { className: b('custom') }, custom)))));
|
|
32
|
-
let content;
|
|
33
|
-
const insideClickableContent = (React.createElement("span", { className: b('wrapper') },
|
|
34
|
-
textMarkup,
|
|
35
|
-
"\u00A0",
|
|
36
|
-
React.createElement(ToggleArrow, { className: b('arrow', { size: textSize }), size: getArrowSize(textSize, isMobile), type: 'horizontal', iconType: "navigation", open: false })));
|
|
37
|
-
if (!url && !onClick) {
|
|
38
|
-
content = textMarkup;
|
|
39
|
-
}
|
|
40
|
-
else if (url) {
|
|
41
|
-
content = (React.createElement("a", Object.assign({ className: b('link'), href: url }, getLinkProps(url, hostname), { onClick: onClick }), insideClickableContent));
|
|
42
|
-
}
|
|
43
|
-
else if (onClick) {
|
|
44
|
-
content = (React.createElement("span", { className: b('link'), onClick: onClick }, insideClickableContent));
|
|
45
|
-
}
|
|
46
|
-
return (React.createElement(Fragment, null,
|
|
47
|
-
anchor && React.createElement(Anchor, { id: anchor, className: b('anchor') }),
|
|
48
|
-
React.createElement(getHeaderTag(textSize), {
|
|
49
|
-
className: b({ size: textSize, justify, 'reset-margin': resetMargin }, className),
|
|
50
|
-
'data-qa': `${dataQa}-header`,
|
|
51
|
-
}, content)));
|
|
13
|
+
const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = __rest(_a, ["text"]);
|
|
14
|
+
return (React.createElement("div", { className: b(null, className) },
|
|
15
|
+
text && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
16
|
+
React.createElement(TitleItem, Object.assign({ text: text }, titleProps)))),
|
|
17
|
+
description && (React.createElement(Col, { reset: true, sizes: colSizes },
|
|
18
|
+
React.createElement("div", { className: b('description', { titleSize: titleProps === null || titleProps === void 0 ? void 0 : titleProps.textSize }) },
|
|
19
|
+
React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))))));
|
|
52
20
|
};
|
|
53
21
|
export default Title;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.pc-title-item_size_l, .pc-title-item_size_m, .pc-title-item_size_s, .pc-title-item_size_xs {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* use this for style redefinitions to awoid problems with
|
|
6
|
+
unpredictable css rules order in build */
|
|
7
|
+
.pc-title-item_justify_center {
|
|
8
|
+
text-align: center;
|
|
9
|
+
}
|
|
10
|
+
.pc-title-item_justify_end {
|
|
11
|
+
text-align: right;
|
|
12
|
+
}
|
|
13
|
+
.pc-title-item_size_xs {
|
|
14
|
+
font-size: var(--yc-text-body-3-font-size);
|
|
15
|
+
line-height: var(--yc-text-body-3-line-height);
|
|
16
|
+
color: var(--pc-text-header-color);
|
|
17
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
18
|
+
}
|
|
19
|
+
.pc-title-item_size_s {
|
|
20
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
21
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
22
|
+
color: var(--pc-text-header-color);
|
|
23
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
24
|
+
margin-top: 32px;
|
|
25
|
+
}
|
|
26
|
+
.pc-title-item_size_m {
|
|
27
|
+
font-size: var(--yc-text-display-2-font-size);
|
|
28
|
+
line-height: var(--yc-text-display-2-line-height);
|
|
29
|
+
color: var(--pc-text-header-color);
|
|
30
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
31
|
+
margin-top: 48px;
|
|
32
|
+
}
|
|
33
|
+
@media (max-width: 576px) {
|
|
34
|
+
.pc-title-item_size_m {
|
|
35
|
+
font-size: var(--yc-text-display-1-font-size);
|
|
36
|
+
line-height: var(--yc-text-display-1-line-height);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.pc-title-item_size_l {
|
|
40
|
+
font-size: var(--yc-text-display-4-font-size);
|
|
41
|
+
line-height: var(--yc-text-display-4-line-height);
|
|
42
|
+
color: var(--pc-text-header-color);
|
|
43
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
44
|
+
margin-top: 96px;
|
|
45
|
+
}
|
|
46
|
+
@media (max-width: 577px) {
|
|
47
|
+
.pc-title-item_size_l {
|
|
48
|
+
font-size: var(--yc-text-display-2-font-size);
|
|
49
|
+
line-height: var(--yc-text-display-2-line-height);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.pc-title-item__arrow {
|
|
53
|
+
margin-top: 10px;
|
|
54
|
+
}
|
|
55
|
+
.pc-title-item__arrow_size_xs {
|
|
56
|
+
margin-top: 7px;
|
|
57
|
+
}
|
|
58
|
+
.pc-title-item__arrow_size_s {
|
|
59
|
+
margin-top: 5px;
|
|
60
|
+
}
|
|
61
|
+
.pc-title-item__link {
|
|
62
|
+
color: inherit;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
padding-right: 8px;
|
|
65
|
+
}
|
|
66
|
+
.pc-title-item__link:hover, .pc-title-item__link:active {
|
|
67
|
+
--pc-text-header-color: inherit;
|
|
68
|
+
color: inherit;
|
|
69
|
+
}
|
|
70
|
+
.pc-title-item__link:hover {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
.pc-title-item__link:hover .pc-title-item__arrow {
|
|
74
|
+
margin-left: 10px;
|
|
75
|
+
}
|
|
76
|
+
.pc-title-item__link:hover .pc-title-item__arrow_size_xs {
|
|
77
|
+
margin-left: 6px;
|
|
78
|
+
}
|
|
79
|
+
.pc-title-item__link:hover .pc-title-item__arrow_size_s {
|
|
80
|
+
margin-left: 8px;
|
|
81
|
+
}
|
|
82
|
+
.pc-title-item__text {
|
|
83
|
+
white-space: normal;
|
|
84
|
+
}
|
|
85
|
+
.pc-title-item__text a {
|
|
86
|
+
outline: none;
|
|
87
|
+
color: var(--yc-color-text-link);
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
.utilityfocus .pc-title-item__text a:focus {
|
|
92
|
+
outline: 2px solid #ffdb4d;
|
|
93
|
+
}
|
|
94
|
+
.pc-title-item__text a:hover, .pc-title-item__text a:active {
|
|
95
|
+
--pc-text-header-color: var(--yc-color-text-link-hover);
|
|
96
|
+
color: var(--yc-color-text-link-hover);
|
|
97
|
+
}
|
|
98
|
+
.pc-title-item__wrapper {
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
.pc-title-item_reset-margin {
|
|
102
|
+
margin-top: 0;
|
|
103
|
+
}
|
|
104
|
+
@media (max-width: 577px) {
|
|
105
|
+
.pc-title-item_size_l:not(.pc-title-item_reset-margin) {
|
|
106
|
+
margin-top: 48px;
|
|
107
|
+
}
|
|
108
|
+
.pc-title-item__arrow_size_m, .pc-title-item__arrow_size_l {
|
|
109
|
+
margin-top: 9px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextSize, TitleItemProps } from '../../models';
|
|
2
|
+
import './TitleItem.css';
|
|
3
|
+
export declare function getArrowSize(size: TextSize, isMobile: boolean): 16 | 24 | 13 | 22 | 26 | 38 | 20;
|
|
4
|
+
export interface TitleItemFullProps extends TitleItemProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
dataQa?: string;
|
|
8
|
+
resetMargin?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Title: (props: TitleItemFullProps) => JSX.Element;
|
|
11
|
+
export default Title;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { Fragment, useContext } from 'react';
|
|
2
|
+
import { HTML, ToggleArrow } from '../';
|
|
3
|
+
import { LocationContext } from '../../context/locationContext';
|
|
4
|
+
import { MobileContext } from '../../context/mobileContext';
|
|
5
|
+
import { block, getHeaderTag, getLinkProps } from '../../utils';
|
|
6
|
+
import Anchor from '../Anchor/Anchor';
|
|
7
|
+
import './TitleItem.css';
|
|
8
|
+
const b = block('title-item');
|
|
9
|
+
export function getArrowSize(size, isMobile) {
|
|
10
|
+
switch (size) {
|
|
11
|
+
case 'xs':
|
|
12
|
+
return 13;
|
|
13
|
+
case 's':
|
|
14
|
+
return 16;
|
|
15
|
+
case 'm':
|
|
16
|
+
return isMobile ? 22 : 24;
|
|
17
|
+
case 'l':
|
|
18
|
+
return isMobile ? 26 : 38;
|
|
19
|
+
default:
|
|
20
|
+
return 20;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const Title = (props) => {
|
|
24
|
+
const isMobile = useContext(MobileContext);
|
|
25
|
+
const { textSize = 'm', text, anchor, justify, url, onClick, custom, className, dataQa, resetMargin = true, } = props;
|
|
26
|
+
const { hostname } = useContext(LocationContext);
|
|
27
|
+
const textMarkup = (React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement(HTML, { className: b('text') }, text),
|
|
29
|
+
custom && (React.createElement(React.Fragment, null,
|
|
30
|
+
"\u00A0",
|
|
31
|
+
React.createElement("span", { className: b('custom') }, custom)))));
|
|
32
|
+
let content;
|
|
33
|
+
const insideClickableContent = (React.createElement("span", { className: b('wrapper') },
|
|
34
|
+
textMarkup,
|
|
35
|
+
"\u00A0",
|
|
36
|
+
React.createElement(ToggleArrow, { className: b('arrow', { size: textSize }), size: getArrowSize(textSize, isMobile), type: 'horizontal', iconType: "navigation", open: false })));
|
|
37
|
+
if (!url && !onClick) {
|
|
38
|
+
content = textMarkup;
|
|
39
|
+
}
|
|
40
|
+
else if (url) {
|
|
41
|
+
content = (React.createElement("a", Object.assign({ className: b('link'), href: url }, getLinkProps(url, hostname), { onClick: onClick }), insideClickableContent));
|
|
42
|
+
}
|
|
43
|
+
else if (onClick) {
|
|
44
|
+
content = (React.createElement("span", { className: b('link'), onClick: onClick }, insideClickableContent));
|
|
45
|
+
}
|
|
46
|
+
return (React.createElement(Fragment, null,
|
|
47
|
+
anchor && React.createElement(Anchor, { id: anchor, className: b('anchor') }),
|
|
48
|
+
React.createElement(getHeaderTag(textSize), {
|
|
49
|
+
className: b({ size: textSize, justify, 'reset-margin': resetMargin }, className),
|
|
50
|
+
'data-qa': `${dataQa}-header`,
|
|
51
|
+
}, content)));
|
|
52
|
+
};
|
|
53
|
+
export default Title;
|
|
@@ -5,7 +5,7 @@ export { default as BackgroundMedia } from './BackgroundMedia/BackgroundMedia';
|
|
|
5
5
|
export { default as BackLink } from './BackLink/BackLink';
|
|
6
6
|
export { default as BalancedMasonry } from './BalancedMasonry/BalancedMasonry';
|
|
7
7
|
export { default as BlockBase } from './BlockBase/BlockBase';
|
|
8
|
-
export { default as BlockHeader } from './
|
|
8
|
+
export { default as BlockHeader } from './Title/Title';
|
|
9
9
|
export { default as Button } from './Button/Button';
|
|
10
10
|
export { default as CardBase } from './CardBase/CardBase';
|
|
11
11
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
@@ -5,7 +5,7 @@ export { default as BackgroundMedia } from './BackgroundMedia/BackgroundMedia';
|
|
|
5
5
|
export { default as BackLink } from './BackLink/BackLink';
|
|
6
6
|
export { default as BalancedMasonry } from './BalancedMasonry/BalancedMasonry';
|
|
7
7
|
export { default as BlockBase } from './BlockBase/BlockBase';
|
|
8
|
-
export { default as BlockHeader } from './
|
|
8
|
+
export { default as BlockHeader } from './Title/Title';
|
|
9
9
|
export { default as Button } from './Button/Button';
|
|
10
10
|
export { default as CardBase } from './CardBase/CardBase';
|
|
11
11
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
|
-
import { AnchorProps, Animatable, BackgroundImageProps,
|
|
5
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, TitleProps } from './common';
|
|
6
6
|
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
7
7
|
export declare enum BlockType {
|
|
8
8
|
PromoFeaturesBlock = "promo-features-block",
|
|
@@ -69,7 +69,7 @@ export interface SliderProps extends Childable, Animatable, LoadableChildren {
|
|
|
69
69
|
text: string;
|
|
70
70
|
size?: TextSize;
|
|
71
71
|
};
|
|
72
|
-
title?:
|
|
72
|
+
title?: TitleItemBaseProps;
|
|
73
73
|
description?: string;
|
|
74
74
|
autoplay?: number;
|
|
75
75
|
randomOrder?: boolean;
|
|
@@ -120,7 +120,7 @@ export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' |
|
|
|
120
120
|
}
|
|
121
121
|
export interface ExtendedFeaturesProps extends Animatable {
|
|
122
122
|
items: ExtendedFeaturesItem[];
|
|
123
|
-
title?:
|
|
123
|
+
title?: TitleItemProps | string;
|
|
124
124
|
description?: string;
|
|
125
125
|
colSizes?: GridColumnSizesType;
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@ export interface PromoFeaturesItem {
|
|
|
132
132
|
}
|
|
133
133
|
export interface PromoFeaturesProps extends Animatable {
|
|
134
134
|
items: PromoFeaturesItem[];
|
|
135
|
-
title?:
|
|
135
|
+
title?: TitleItemProps | string;
|
|
136
136
|
description?: string;
|
|
137
137
|
theme?: 'grey' | 'default';
|
|
138
138
|
}
|
|
@@ -207,14 +207,14 @@ export interface TabsBlockItem extends Omit<ContentBlockProps, 'size' | 'colSize
|
|
|
207
207
|
caption?: string;
|
|
208
208
|
media?: ThemedMediaProps;
|
|
209
209
|
}
|
|
210
|
-
export interface TabsBlockProps extends
|
|
210
|
+
export interface TabsBlockProps extends TitleProps, Animatable {
|
|
211
211
|
tabsColSizes?: GridColumnSizesType;
|
|
212
212
|
centered?: boolean;
|
|
213
213
|
direction?: MediaDirection;
|
|
214
214
|
items: TabsBlockItem[];
|
|
215
215
|
}
|
|
216
216
|
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {
|
|
217
|
-
title:
|
|
217
|
+
title: TitleItemProps | string;
|
|
218
218
|
description?: string;
|
|
219
219
|
colSizes?: GridColumnSizesType;
|
|
220
220
|
}
|
|
@@ -227,7 +227,7 @@ export type FilterItem = {
|
|
|
227
227
|
card: SubBlockModels;
|
|
228
228
|
};
|
|
229
229
|
export interface FilterBlockProps extends Animatable, LoadableChildren {
|
|
230
|
-
title?:
|
|
230
|
+
title?: TitleItemProps | string;
|
|
231
231
|
description?: string;
|
|
232
232
|
tags: FilterTag[];
|
|
233
233
|
items: FilterItem[];
|
|
@@ -257,7 +257,7 @@ export interface ContentLayoutBlockProps {
|
|
|
257
257
|
fileContent?: FileLinkProps[];
|
|
258
258
|
}
|
|
259
259
|
export interface ContentBlockProps {
|
|
260
|
-
title?:
|
|
260
|
+
title?: TitleItemBaseProps | string;
|
|
261
261
|
text?: string;
|
|
262
262
|
additionalInfo?: string;
|
|
263
263
|
links?: LinkProps[];
|
|
@@ -249,11 +249,11 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
249
249
|
metrikaGoals?: MetrikaGoal;
|
|
250
250
|
pixelEvents?: ButtonPixel;
|
|
251
251
|
}
|
|
252
|
-
export interface
|
|
252
|
+
export interface TitleItemProps extends Justifyable, TitleItemBaseProps {
|
|
253
253
|
navTitle?: string;
|
|
254
254
|
anchor?: string;
|
|
255
255
|
}
|
|
256
|
-
export interface
|
|
256
|
+
export interface TitleItemBaseProps {
|
|
257
257
|
text: string;
|
|
258
258
|
textSize?: TextSize;
|
|
259
259
|
url?: string;
|
|
@@ -334,8 +334,8 @@ export interface AuthorProps {
|
|
|
334
334
|
type?: AuthorType;
|
|
335
335
|
dataQa?: string;
|
|
336
336
|
}
|
|
337
|
-
export interface
|
|
338
|
-
title?:
|
|
337
|
+
export interface TitleProps {
|
|
338
|
+
title?: TitleItemProps | string;
|
|
339
339
|
description?: string;
|
|
340
340
|
}
|
|
341
341
|
export {};
|
|
@@ -91,7 +91,7 @@ unpredictable css rules order in build */
|
|
|
91
91
|
.pc-content_size_l .pc-content__button {
|
|
92
92
|
margin-top: 12px;
|
|
93
93
|
}
|
|
94
|
-
.pc-content_theme_dark .pc-content__title
|
|
94
|
+
.pc-content_theme_dark .pc-content__title *,
|
|
95
95
|
.pc-content_theme_dark .pc-content__text .yfm,
|
|
96
96
|
.pc-content_theme_dark .pc-content__text .yfm *,
|
|
97
97
|
.pc-content_theme_dark .pc-content__link a {
|
|
@@ -123,7 +123,7 @@ unpredictable css rules order in build */
|
|
|
123
123
|
.pc-content_theme_dark .pc-content__title a:hover {
|
|
124
124
|
color: var(--yc-color-text-light-secondary);
|
|
125
125
|
}
|
|
126
|
-
.pc-content_theme_light .pc-content__title
|
|
126
|
+
.pc-content_theme_light .pc-content__title *,
|
|
127
127
|
.pc-content_theme_light .pc-content__text .yfm,
|
|
128
128
|
.pc-content_theme_light .pc-content__text .yfm *,
|
|
129
129
|
.pc-content_theme_light .pc-content__link a {
|
|
@@ -36,11 +36,11 @@ function getButtonSize(size) {
|
|
|
36
36
|
const Content = (props) => {
|
|
37
37
|
const { title, text, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, } = props;
|
|
38
38
|
const titleProps = __rest(!title || typeof title === 'string'
|
|
39
|
-
? { text: title, textSize: getTextSize(size) }
|
|
40
|
-
: title, []);
|
|
39
|
+
? { text: title, textSize: getTextSize(size), resetMargin: true }
|
|
40
|
+
: Object.assign(Object.assign({}, title), { resetMargin: true }), []);
|
|
41
41
|
const hasTitle = Boolean(title);
|
|
42
42
|
return (React.createElement(Col, { className: b({ size, centered, theme }, className), reset: true, sizes: colSizes },
|
|
43
|
-
title && React.createElement(Title,
|
|
43
|
+
title && React.createElement(Title, { className: b('title'), title: Object.assign({}, titleProps), colSizes: { all: 12 } }),
|
|
44
44
|
text && (React.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
45
45
|
React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true } }))),
|
|
46
46
|
additionalInfo && (React.createElement("div", { className: b('notice') },
|