@gravity-ui/page-constructor 4.41.1-alpha.0 → 4.42.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/build/cjs/components/Author/Author.css +2 -4
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/components/ContentList/ContentList.css +16 -16
- package/build/cjs/components/ContentList/ContentList.js +2 -2
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/models/constructor-items/common.d.ts +0 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -12
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +6 -3
- package/build/cjs/schema/constants.d.ts +0 -4
- package/build/cjs/sub-blocks/Content/Content.css +6 -0
- package/build/cjs/sub-blocks/Content/Content.js +2 -1
- package/build/cjs/sub-blocks/PriceCard/PriceCard.css +23 -2
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js +3 -3
- package/build/cjs/sub-blocks/Quote/Quote.css +18 -11
- package/build/cjs/sub-blocks/Quote/Quote.js +6 -7
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/Quote/schema.js +1 -4
- package/build/cjs/text-transform/config.js +4 -10
- package/build/esm/components/Author/Author.css +2 -4
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/components/ContentList/ContentList.css +16 -16
- package/build/esm/components/ContentList/ContentList.js +2 -2
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/models/constructor-items/common.d.ts +0 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -12
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +7 -4
- package/build/esm/schema/constants.d.ts +0 -4
- package/build/esm/sub-blocks/Content/Content.css +6 -0
- package/build/esm/sub-blocks/Content/Content.js +2 -1
- package/build/esm/sub-blocks/PriceCard/PriceCard.css +23 -2
- package/build/esm/sub-blocks/PriceCard/PriceCard.js +3 -3
- package/build/esm/sub-blocks/Quote/Quote.css +18 -11
- package/build/esm/sub-blocks/Quote/Quote.js +7 -8
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/esm/sub-blocks/Quote/schema.js +1 -4
- package/build/esm/text-transform/config.js +4 -10
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +0 -1
- package/server/models/constructor-items/sub-blocks.d.ts +1 -12
- package/server/text-transform/config.js +4 -10
- package/styles/variables.scss +0 -2
- package/widget/index.js +1 -1
|
@@ -5,6 +5,7 @@ unpredictable css rules order in build */
|
|
|
5
5
|
line-height: var(--g-text-body-3-line-height);
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
+
color: var(--g-color-text-secondary);
|
|
8
9
|
}
|
|
9
10
|
.pc-author__avatar {
|
|
10
11
|
width: 80px;
|
|
@@ -24,11 +25,11 @@ unpredictable css rules order in build */
|
|
|
24
25
|
.pc-author__name {
|
|
25
26
|
font-size: var(--g-text-body-3-font-size);
|
|
26
27
|
line-height: var(--g-text-body-3-line-height);
|
|
28
|
+
color: var(--g-color-text-primary);
|
|
27
29
|
}
|
|
28
30
|
.pc-author__description {
|
|
29
31
|
font-size: var(--g-text-body-2-font-size);
|
|
30
32
|
line-height: var(--g-text-body-2-line-height);
|
|
31
|
-
color: var(--g-color-text-secondary);
|
|
32
33
|
padding-top: 4px;
|
|
33
34
|
}
|
|
34
35
|
.pc-author__label:not(:first-child) {
|
|
@@ -52,7 +53,4 @@ unpredictable css rules order in build */
|
|
|
52
53
|
}
|
|
53
54
|
.pc-author_type_line .pc-author__label:not(:first-child) {
|
|
54
55
|
margin-left: 16px;
|
|
55
|
-
}
|
|
56
|
-
.pc-author_theme_dark .pc-author__description {
|
|
57
|
-
color: var(--g-color-text-light-secondary);
|
|
58
56
|
}
|
|
@@ -8,7 +8,7 @@ const utils_2 = require("../Media/Image/utils");
|
|
|
8
8
|
const index_1 = require("../index");
|
|
9
9
|
const b = (0, utils_1.block)('author');
|
|
10
10
|
const Author = (props) => {
|
|
11
|
-
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column, qa
|
|
11
|
+
const { author, className, authorContainerClassName, type = models_1.AuthorType.Column, qa } = props;
|
|
12
12
|
const { firstName, secondName, description, avatar } = author;
|
|
13
13
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
14
14
|
const isAvatarJSX = react_1.default.isValidElement(avatar);
|
|
@@ -16,7 +16,7 @@ const Author = (props) => {
|
|
|
16
16
|
if (!isAvatarJSX && avatar) {
|
|
17
17
|
avatarProps = (0, utils_2.getMediaImage)(avatar);
|
|
18
18
|
}
|
|
19
|
-
return (react_1.default.createElement("div", { className: b({ type
|
|
19
|
+
return (react_1.default.createElement("div", { className: b({ type }, className), "data-qa": qa },
|
|
20
20
|
avatar && (react_1.default.createElement("div", { className: b('avatar', authorContainerClassName) }, isAvatarJSX ? avatar : react_1.default.createElement(index_1.Image, Object.assign({}, avatarProps)))),
|
|
21
21
|
react_1.default.createElement("div", { className: b('label') },
|
|
22
22
|
react_1.default.createElement("div", { className: b('name') }, name),
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-content-list_size_l {
|
|
4
|
-
margin-top: 24px;
|
|
5
|
-
}
|
|
6
3
|
.pc-content-list_size_l .pc-content-list__title {
|
|
7
4
|
font-size: var(--g-text-header-1-font-size);
|
|
8
5
|
line-height: var(--g-text-header-1-line-height);
|
|
@@ -15,19 +12,19 @@ unpredictable css rules order in build */
|
|
|
15
12
|
margin-bottom: 1px;
|
|
16
13
|
margin-right: 12px;
|
|
17
14
|
}
|
|
18
|
-
.pc-content-list_size_l .pc-content-
|
|
15
|
+
.pc-content-list_size_l .pc-content-list__item:not(:last-child) {
|
|
16
|
+
margin-bottom: 16px;
|
|
17
|
+
}
|
|
18
|
+
.pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child) {
|
|
19
|
+
margin-bottom: 12px;
|
|
20
|
+
}
|
|
21
|
+
.pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon {
|
|
19
22
|
width: 20px;
|
|
20
23
|
height: 20px;
|
|
21
24
|
margin-top: 0;
|
|
22
25
|
margin-bottom: 0;
|
|
23
26
|
margin-right: 8px;
|
|
24
27
|
}
|
|
25
|
-
.pc-content-list_size_l .pc-content-list__item:not(:last-child) {
|
|
26
|
-
margin-bottom: 16px;
|
|
27
|
-
}
|
|
28
|
-
.pc-content-list_size_s {
|
|
29
|
-
margin-top: 16px;
|
|
30
|
-
}
|
|
31
28
|
.pc-content-list_size_s .pc-content-list__title {
|
|
32
29
|
font-size: var(--g-text-subheader-3-font-size);
|
|
33
30
|
line-height: var(--g-text-subheader-3-line-height);
|
|
@@ -40,12 +37,6 @@ unpredictable css rules order in build */
|
|
|
40
37
|
margin-bottom: 2px;
|
|
41
38
|
margin-right: 8px;
|
|
42
39
|
}
|
|
43
|
-
.pc-content-list_size_s .pc-content-list__icon_without_title {
|
|
44
|
-
width: 18px;
|
|
45
|
-
height: 18px;
|
|
46
|
-
margin-top: 0;
|
|
47
|
-
margin-bottom: 0;
|
|
48
|
-
}
|
|
49
40
|
.pc-content-list_size_s .pc-content-list__text {
|
|
50
41
|
font-size: var(--g-text-body-1-font-size);
|
|
51
42
|
line-height: var(--g-text-body-1-line-height);
|
|
@@ -53,6 +44,15 @@ unpredictable css rules order in build */
|
|
|
53
44
|
.pc-content-list_size_s .pc-content-list__item:not(:last-child) {
|
|
54
45
|
margin-bottom: 12px;
|
|
55
46
|
}
|
|
47
|
+
.pc-content-list_size_s .pc-content-list__item_without-title:not(:last-child) {
|
|
48
|
+
margin-bottom: 8px;
|
|
49
|
+
}
|
|
50
|
+
.pc-content-list_size_s .pc-content-list__item_without-title .pc-content-list__icon {
|
|
51
|
+
width: 18px;
|
|
52
|
+
height: 18px;
|
|
53
|
+
margin-top: 0;
|
|
54
|
+
margin-bottom: 0;
|
|
55
|
+
}
|
|
56
56
|
.pc-content-list__icon {
|
|
57
57
|
display: block;
|
|
58
58
|
}
|
|
@@ -21,8 +21,8 @@ const ContentList = ({ list, size = 'l', qa }) => {
|
|
|
21
21
|
const qaAttributes = (0, blocks_1.getQaAttrubutes)(qa, ['image', 'title', 'text']);
|
|
22
22
|
return (react_1.default.createElement("div", { className: b({ size }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
23
23
|
const { icon, title, text } = item;
|
|
24
|
-
return (react_1.default.createElement("div", { className: b('item'), key: (0, uuid_1.v4)() },
|
|
25
|
-
react_1.default.createElement(ContentListItemIcon_1.default, { icon: icon, className: b('icon'
|
|
24
|
+
return (react_1.default.createElement("div", { className: b('item', { 'without-title': !title }), key: (0, uuid_1.v4)() },
|
|
25
|
+
react_1.default.createElement(ContentListItemIcon_1.default, { icon: icon, className: b('icon'), qa: qaAttributes.image }),
|
|
26
26
|
react_1.default.createElement("div", null,
|
|
27
27
|
title &&
|
|
28
28
|
react_1.default.createElement(getHeadingLevel(size), { className: b('title'), 'data-qa': qaAttributes.title }, react_1.default.createElement(YFMWrapper_1.default, { content: title, modifiers: { constructor: true } })),
|
|
@@ -29,6 +29,7 @@ export declare const subBlockMap: {
|
|
|
29
29
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
30
30
|
content: (props: import("./sub-blocks/Content/Content").ContentProps) => JSX.Element;
|
|
31
31
|
quote: (props: import("./models").QuoteProps) => JSX.Element;
|
|
32
|
+
"price-card": (props: import("./models").PriceCardProps) => JSX.Element;
|
|
32
33
|
};
|
|
33
34
|
export declare const navItemMap: {
|
|
34
35
|
button: import("react").FC<Pick<import("./navigation/models").NavigationItemProps, "className"> & import("./models").ButtonProps>;
|
|
@@ -38,6 +38,7 @@ exports.subBlockMap = {
|
|
|
38
38
|
[models_1.SubBlockType.BasicCard]: sub_blocks_1.BasicCard,
|
|
39
39
|
[models_1.SubBlockType.Content]: sub_blocks_1.Content,
|
|
40
40
|
[models_1.SubBlockType.Quote]: sub_blocks_1.Quote,
|
|
41
|
+
[models_1.SubBlockType.PriceCard]: sub_blocks_1.PriceCard,
|
|
41
42
|
};
|
|
42
43
|
exports.navItemMap = {
|
|
43
44
|
[models_1.NavigationItemType.Button]: NavigationItem_1.NavigationButton,
|
|
@@ -63,27 +63,16 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
67
|
-
yfmText?: string;
|
|
66
|
+
text: string;
|
|
68
67
|
image: ThemedImage;
|
|
69
68
|
logo: ImageProps;
|
|
70
69
|
color?: string;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated use property button instead
|
|
73
|
-
*/
|
|
74
70
|
url?: string;
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated use property button instead
|
|
77
|
-
*/
|
|
78
71
|
urlTitle?: string;
|
|
79
72
|
author?: AuthorItem;
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated use property button instead
|
|
82
|
-
*/
|
|
83
73
|
buttonText?: string;
|
|
84
74
|
theme?: TextTheme;
|
|
85
75
|
quoteType?: QuoteType;
|
|
86
|
-
button?: ButtonProps;
|
|
87
76
|
}
|
|
88
77
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
89
78
|
url?: string;
|
|
@@ -9,6 +9,7 @@ const utils_1 = require("../../../utils");
|
|
|
9
9
|
const useNavigationItemMap_1 = require("./hooks/useNavigationItemMap");
|
|
10
10
|
const b = (0, utils_1.block)('navigation-item');
|
|
11
11
|
const ANALYTICS_ID = 'navigation';
|
|
12
|
+
const nonComplexNavigationItemTypes = models_1.NavigationItemTypes.filter((type) => type !== models_1.NavigationItemType.Dropdown);
|
|
12
13
|
const NavigationItem = (_a) => {
|
|
13
14
|
var { data, className, menuLayout } = _a, props = tslib_1.__rest(_a, ["data", "className", "menuLayout"]);
|
|
14
15
|
const { type = models_1.NavigationItemType.Link } = data;
|
|
@@ -16,11 +17,13 @@ const NavigationItem = (_a) => {
|
|
|
16
17
|
const Component = navItemMap[type];
|
|
17
18
|
const componentProps = (0, react_1.useMemo)(() => {
|
|
18
19
|
const componentProperties = Object.assign(Object.assign({}, data), props);
|
|
19
|
-
if (type
|
|
20
|
+
if (nonComplexNavigationItemTypes.includes(type)) {
|
|
20
21
|
return (0, omit_1.default)(componentProperties, 'hidePopup', 'isActive');
|
|
21
22
|
}
|
|
22
|
-
return
|
|
23
|
-
|
|
23
|
+
return models_1.NavigationItemTypes.includes(type)
|
|
24
|
+
? componentProperties
|
|
25
|
+
: Object.assign(Object.assign({}, componentProperties), { menuLayout });
|
|
26
|
+
}, [data, props, type, menuLayout]);
|
|
24
27
|
return (react_1.default.createElement(blockIdContext_1.BlockIdContext.Provider, { value: ANALYTICS_ID },
|
|
25
28
|
react_1.default.createElement("li", { className: b({ 'menu-layout': menuLayout }, className) },
|
|
26
29
|
react_1.default.createElement(Component, Object.assign({}, componentProps, { className: b('content', { type }) })))));
|
|
@@ -73,6 +73,9 @@ unpredictable css rules order in build */
|
|
|
73
73
|
.pc-content_size_s .pc-content__button {
|
|
74
74
|
margin-top: 8px;
|
|
75
75
|
}
|
|
76
|
+
.pc-content_size_s .pc-content__list {
|
|
77
|
+
margin-top: 16px;
|
|
78
|
+
}
|
|
76
79
|
.pc-content_size_l .pc-content__text,
|
|
77
80
|
.pc-content_size_l .pc-content__notice {
|
|
78
81
|
margin-top: 12px;
|
|
@@ -91,6 +94,9 @@ unpredictable css rules order in build */
|
|
|
91
94
|
.pc-content_size_l .pc-content__button {
|
|
92
95
|
margin-top: 12px;
|
|
93
96
|
}
|
|
97
|
+
.pc-content_size_l .pc-content__list {
|
|
98
|
+
margin-top: 24px;
|
|
99
|
+
}
|
|
94
100
|
.pc-content_theme_dark {
|
|
95
101
|
--g-color-line-focus: var(--pc-color-line-focus-dark);
|
|
96
102
|
}
|
|
@@ -48,7 +48,8 @@ const Content = (props) => {
|
|
|
48
48
|
title && (react_1.default.createElement(components_1.Title, { className: b('title'), title: titleProps, colSizes: { all: 12 }, id: titleId })),
|
|
49
49
|
text && (react_1.default.createElement("div", { className: b('text', { ['without-title']: !hasTitle }) },
|
|
50
50
|
react_1.default.createElement(components_1.YFMWrapper, { content: text, modifiers: { constructor: true, [`constructor-size-${size}`]: true }, id: textId }))),
|
|
51
|
-
(list === null || list === void 0 ? void 0 : list.length) ? react_1.default.createElement(
|
|
51
|
+
(list === null || list === void 0 ? void 0 : list.length) ? (react_1.default.createElement("div", { className: b('list') },
|
|
52
|
+
react_1.default.createElement(components_1.ContentList, { list: list, size: size, qa: qaAttributes.list }))) : null,
|
|
52
53
|
additionalInfo && (react_1.default.createElement("div", { className: b('notice') },
|
|
53
54
|
react_1.default.createElement(components_1.YFMWrapper, { content: additionalInfo, modifiers: {
|
|
54
55
|
constructor: true,
|
|
@@ -3,6 +3,10 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-price-card {
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
6
|
+
.pc-price-card.pc-price-card {
|
|
7
|
+
min-height: auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
.pc-price-card__background {
|
|
7
11
|
position: absolute;
|
|
8
12
|
top: 0;
|
|
@@ -59,7 +63,8 @@ unpredictable css rules order in build */
|
|
|
59
63
|
margin-left: 4px;
|
|
60
64
|
}
|
|
61
65
|
.pc-price-card__price-details {
|
|
62
|
-
|
|
66
|
+
font-size: var(--g-text-body-2-font-size);
|
|
67
|
+
line-height: var(--g-text-body-2-line-height);
|
|
63
68
|
}
|
|
64
69
|
.pc-price-card__main {
|
|
65
70
|
flex: 1;
|
|
@@ -69,12 +74,28 @@ unpredictable css rules order in build */
|
|
|
69
74
|
position: relative;
|
|
70
75
|
}
|
|
71
76
|
.pc-price-card__info {
|
|
72
|
-
margin-bottom: 24px;
|
|
73
77
|
flex: 1;
|
|
74
78
|
min-height: 0;
|
|
75
79
|
display: flex;
|
|
76
80
|
flex-direction: column;
|
|
77
81
|
}
|
|
82
|
+
.pc-price-card__description:not(:last-child) {
|
|
83
|
+
margin-bottom: 12px;
|
|
84
|
+
}
|
|
85
|
+
.pc-price-card__links, .pc-price-card__buttons {
|
|
86
|
+
margin-top: 24px;
|
|
87
|
+
}
|
|
78
88
|
.pc-price-card__links > *:not(:last-child), .pc-price-card__buttons > *:not(:last-child) {
|
|
79
89
|
margin-right: 16px;
|
|
90
|
+
}
|
|
91
|
+
.pc-price-card__link {
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
}
|
|
94
|
+
@media (max-width: 769px) {
|
|
95
|
+
.pc-price-card__title, .pc-price-card__price {
|
|
96
|
+
margin-bottom: 16px;
|
|
97
|
+
}
|
|
98
|
+
.pc-price-card__links, .pc-price-card__buttons {
|
|
99
|
+
margin-top: 16px;
|
|
100
|
+
}
|
|
80
101
|
}
|
|
@@ -21,13 +21,13 @@ const PriceCard = (props) => {
|
|
|
21
21
|
"/ ",
|
|
22
22
|
pricePeriod))),
|
|
23
23
|
priceDetails && (react_1.default.createElement("div", { className: b('price-details') }, priceDetails))),
|
|
24
|
-
react_1.default.createElement("div",
|
|
24
|
+
description && react_1.default.createElement("div", { className: b('description') }, description),
|
|
25
25
|
(list === null || list === void 0 ? void 0 : list.length) ? (react_1.default.createElement("div", { className: b('list') },
|
|
26
26
|
react_1.default.createElement(components_1.ContentList, { list: list.map((item) => ({
|
|
27
27
|
icon: Check_1.default,
|
|
28
28
|
text: item,
|
|
29
|
-
})), size: "
|
|
29
|
+
})), size: "l" }))) : null),
|
|
30
30
|
buttons && (react_1.default.createElement("div", { className: b('buttons') }, buttons.map((button) => (react_1.default.createElement(components_1.Button, Object.assign({ key: button.url }, button)))))),
|
|
31
|
-
links && (react_1.default.createElement("div", { className: b('links') }, links.map((link) => (react_1.default.createElement(components_1.Link, Object.assign({ key: link.url, textSize: "m" }, link))))))))));
|
|
31
|
+
links && (react_1.default.createElement("div", { className: b('links') }, links.map((link) => (react_1.default.createElement(components_1.Link, Object.assign({ className: b('link'), key: link.url, textSize: "m" }, link))))))))));
|
|
32
32
|
};
|
|
33
33
|
exports.default = PriceCard;
|
|
@@ -76,17 +76,6 @@ unpredictable css rules order in build */
|
|
|
76
76
|
.pc-quote__content_quote-type_english-double .pc-quote__text::after {
|
|
77
77
|
content: "”";
|
|
78
78
|
}
|
|
79
|
-
.pc-quote__content .yfm {
|
|
80
|
-
font-size: var(--g-text-body-3-font-size);
|
|
81
|
-
line-height: var(--g-text-body-3-line-height);
|
|
82
|
-
}
|
|
83
|
-
.pc-quote__content .yfm > * {
|
|
84
|
-
display: inline;
|
|
85
|
-
}
|
|
86
|
-
.pc-quote__content .yfm:after {
|
|
87
|
-
position: relative;
|
|
88
|
-
left: -5px;
|
|
89
|
-
}
|
|
90
79
|
.pc-quote__image {
|
|
91
80
|
width: 100%;
|
|
92
81
|
height: 100%;
|
|
@@ -98,6 +87,24 @@ unpredictable css rules order in build */
|
|
|
98
87
|
align-items: flex-end;
|
|
99
88
|
margin-top: 20px;
|
|
100
89
|
}
|
|
90
|
+
.pc-quote__author_theme_dark, .pc-quote_theme_dark {
|
|
91
|
+
color: var(--g-color-text-light-primary);
|
|
92
|
+
}
|
|
93
|
+
.pc-quote__author_theme_dark h1,
|
|
94
|
+
.pc-quote__author_theme_dark h2,
|
|
95
|
+
.pc-quote__author_theme_dark h3,
|
|
96
|
+
.pc-quote__author_theme_dark h4,
|
|
97
|
+
.pc-quote__author_theme_dark h5,
|
|
98
|
+
.pc-quote__author_theme_dark h6,
|
|
99
|
+
.pc-quote__author_theme_dark .yfm, .pc-quote_theme_dark h1,
|
|
100
|
+
.pc-quote_theme_dark h2,
|
|
101
|
+
.pc-quote_theme_dark h3,
|
|
102
|
+
.pc-quote_theme_dark h4,
|
|
103
|
+
.pc-quote_theme_dark h5,
|
|
104
|
+
.pc-quote_theme_dark h6,
|
|
105
|
+
.pc-quote_theme_dark .yfm {
|
|
106
|
+
color: var(--g-color-text-light-primary);
|
|
107
|
+
}
|
|
101
108
|
.pc-quote__author {
|
|
102
109
|
max-width: calc(60% - 20px);
|
|
103
110
|
margin-right: 20px;
|
|
@@ -2,6 +2,7 @@
|
|
|
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");
|
|
5
6
|
const components_1 = require("../../components");
|
|
6
7
|
const utils_1 = require("../../components/Media/Image/utils");
|
|
7
8
|
const theme_1 = require("../../context/theme");
|
|
@@ -10,25 +11,23 @@ const models_1 = require("../../models");
|
|
|
10
11
|
const utils_2 = require("../../utils");
|
|
11
12
|
const b = (0, utils_2.block)('quote');
|
|
12
13
|
const Quote = (props) => {
|
|
13
|
-
const { theme: textTheme = 'light', color, image, border = 'shadow', text,
|
|
14
|
+
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, urlTitle, buttonText, quoteType = models_1.QuoteType.Chevron, } = props;
|
|
14
15
|
const theme = (0, theme_1.useTheme)();
|
|
15
16
|
const imageThemed = (0, utils_2.getThemedValue)(image, theme);
|
|
16
17
|
const imageData = (0, utils_1.getMediaImage)(imageThemed);
|
|
17
18
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.QuoteButton, url);
|
|
18
19
|
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics(), [handleAnalytics]);
|
|
19
20
|
const renderFooter = Boolean(author || url) && (react_1.default.createElement("div", { className: b('author-wrapper') },
|
|
20
|
-
author && (react_1.default.createElement(components_1.Author, { className: b('author', { theme: textTheme }), author: author, type: models_1.AuthorType.Line
|
|
21
|
-
url && buttonText &&
|
|
22
|
-
button && react_1.default.createElement(components_1.Button, Object.assign({ size: "xl" }, button))));
|
|
21
|
+
author && (react_1.default.createElement(components_1.Author, { className: b('author', { theme: textTheme }), author: author, type: models_1.AuthorType.Line })),
|
|
22
|
+
url && buttonText && (react_1.default.createElement(uikit_1.Button, { view: "outlined", size: "xl", href: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, title: urlTitle }, buttonText))));
|
|
23
23
|
const logoProps = (0, utils_1.getMediaImage)(logo);
|
|
24
24
|
return (react_1.default.createElement("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {} },
|
|
25
25
|
react_1.default.createElement("div", { key: text, className: b('content-wrapper') },
|
|
26
26
|
react_1.default.createElement("div", null,
|
|
27
27
|
react_1.default.createElement(components_1.Image, Object.assign({ className: b('logo') }, logoProps)),
|
|
28
28
|
react_1.default.createElement("div", { className: b('content', { 'quote-type': quoteType }) },
|
|
29
|
-
|
|
30
|
-
react_1.default.createElement(components_1.HTML, null, text))),
|
|
31
|
-
yfmText && (react_1.default.createElement(components_1.YFMWrapper, { className: b('text'), content: yfmText, modifiers: { constructor: true } })))),
|
|
29
|
+
react_1.default.createElement("span", { className: b('text') },
|
|
30
|
+
react_1.default.createElement(components_1.HTML, null, text)))),
|
|
32
31
|
renderFooter),
|
|
33
32
|
react_1.default.createElement("div", { className: b('image-wrapper') },
|
|
34
33
|
react_1.default.createElement(components_1.Image, Object.assign({}, imageData, { className: b('image') })))));
|
|
@@ -6,13 +6,10 @@ const common_1 = require("../../schema/validators/common");
|
|
|
6
6
|
exports.Quote = {
|
|
7
7
|
quote: {
|
|
8
8
|
additionalProperties: false,
|
|
9
|
-
required: ['image', 'logo'],
|
|
9
|
+
required: ['text', 'image', 'logo'],
|
|
10
10
|
properties: Object.assign(Object.assign({}, common_1.BaseProps), { text: {
|
|
11
11
|
type: 'string',
|
|
12
12
|
contentType: 'text',
|
|
13
|
-
}, yfmText: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
contentType: 'text',
|
|
16
13
|
}, image: (0, common_1.withTheme)(schema_1.ImageProps), logo: schema_1.ImageProps, color: {
|
|
17
14
|
type: 'string',
|
|
18
15
|
}, url: {
|
|
@@ -130,16 +130,10 @@ exports.config = {
|
|
|
130
130
|
transformer: common_1.yfmTransformer,
|
|
131
131
|
},
|
|
132
132
|
],
|
|
133
|
-
[models_1.SubBlockType.Quote]:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
fields: ['yfmText'],
|
|
140
|
-
transformer: common_1.yfmTransformer,
|
|
141
|
-
},
|
|
142
|
-
],
|
|
133
|
+
[models_1.SubBlockType.Quote]: {
|
|
134
|
+
fields: ['text'],
|
|
135
|
+
transformer: common_1.typografTransformer,
|
|
136
|
+
},
|
|
143
137
|
[models_1.BlockType.ExtendedFeaturesBlock]: [
|
|
144
138
|
...exports.blockHeaderTransformer,
|
|
145
139
|
{
|
|
@@ -5,6 +5,7 @@ unpredictable css rules order in build */
|
|
|
5
5
|
line-height: var(--g-text-body-3-line-height);
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
+
color: var(--g-color-text-secondary);
|
|
8
9
|
}
|
|
9
10
|
.pc-author__avatar {
|
|
10
11
|
width: 80px;
|
|
@@ -24,11 +25,11 @@ unpredictable css rules order in build */
|
|
|
24
25
|
.pc-author__name {
|
|
25
26
|
font-size: var(--g-text-body-3-font-size);
|
|
26
27
|
line-height: var(--g-text-body-3-line-height);
|
|
28
|
+
color: var(--g-color-text-primary);
|
|
27
29
|
}
|
|
28
30
|
.pc-author__description {
|
|
29
31
|
font-size: var(--g-text-body-2-font-size);
|
|
30
32
|
line-height: var(--g-text-body-2-line-height);
|
|
31
|
-
color: var(--g-color-text-secondary);
|
|
32
33
|
padding-top: 4px;
|
|
33
34
|
}
|
|
34
35
|
.pc-author__label:not(:first-child) {
|
|
@@ -52,7 +53,4 @@ unpredictable css rules order in build */
|
|
|
52
53
|
}
|
|
53
54
|
.pc-author_type_line .pc-author__label:not(:first-child) {
|
|
54
55
|
margin-left: 16px;
|
|
55
|
-
}
|
|
56
|
-
.pc-author_theme_dark .pc-author__description {
|
|
57
|
-
color: var(--g-color-text-light-secondary);
|
|
58
56
|
}
|
|
@@ -6,7 +6,7 @@ import { Image } from '../index';
|
|
|
6
6
|
import './Author.css';
|
|
7
7
|
const b = block('author');
|
|
8
8
|
const Author = (props) => {
|
|
9
|
-
const { author, className, authorContainerClassName, type = AuthorType.Column, qa
|
|
9
|
+
const { author, className, authorContainerClassName, type = AuthorType.Column, qa } = props;
|
|
10
10
|
const { firstName, secondName, description, avatar } = author;
|
|
11
11
|
const name = secondName ? `${firstName} ${secondName}` : firstName;
|
|
12
12
|
const isAvatarJSX = React.isValidElement(avatar);
|
|
@@ -14,7 +14,7 @@ const Author = (props) => {
|
|
|
14
14
|
if (!isAvatarJSX && avatar) {
|
|
15
15
|
avatarProps = getMediaImage(avatar);
|
|
16
16
|
}
|
|
17
|
-
return (React.createElement("div", { className: b({ type
|
|
17
|
+
return (React.createElement("div", { className: b({ type }, className), "data-qa": qa },
|
|
18
18
|
avatar && (React.createElement("div", { className: b('avatar', authorContainerClassName) }, isAvatarJSX ? avatar : React.createElement(Image, Object.assign({}, avatarProps)))),
|
|
19
19
|
React.createElement("div", { className: b('label') },
|
|
20
20
|
React.createElement("div", { className: b('name') }, name),
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-content-list_size_l {
|
|
4
|
-
margin-top: 24px;
|
|
5
|
-
}
|
|
6
3
|
.pc-content-list_size_l .pc-content-list__title {
|
|
7
4
|
font-size: var(--g-text-header-1-font-size);
|
|
8
5
|
line-height: var(--g-text-header-1-line-height);
|
|
@@ -15,19 +12,19 @@ unpredictable css rules order in build */
|
|
|
15
12
|
margin-bottom: 1px;
|
|
16
13
|
margin-right: 12px;
|
|
17
14
|
}
|
|
18
|
-
.pc-content-list_size_l .pc-content-
|
|
15
|
+
.pc-content-list_size_l .pc-content-list__item:not(:last-child) {
|
|
16
|
+
margin-bottom: 16px;
|
|
17
|
+
}
|
|
18
|
+
.pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child) {
|
|
19
|
+
margin-bottom: 12px;
|
|
20
|
+
}
|
|
21
|
+
.pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon {
|
|
19
22
|
width: 20px;
|
|
20
23
|
height: 20px;
|
|
21
24
|
margin-top: 0;
|
|
22
25
|
margin-bottom: 0;
|
|
23
26
|
margin-right: 8px;
|
|
24
27
|
}
|
|
25
|
-
.pc-content-list_size_l .pc-content-list__item:not(:last-child) {
|
|
26
|
-
margin-bottom: 16px;
|
|
27
|
-
}
|
|
28
|
-
.pc-content-list_size_s {
|
|
29
|
-
margin-top: 16px;
|
|
30
|
-
}
|
|
31
28
|
.pc-content-list_size_s .pc-content-list__title {
|
|
32
29
|
font-size: var(--g-text-subheader-3-font-size);
|
|
33
30
|
line-height: var(--g-text-subheader-3-line-height);
|
|
@@ -40,12 +37,6 @@ unpredictable css rules order in build */
|
|
|
40
37
|
margin-bottom: 2px;
|
|
41
38
|
margin-right: 8px;
|
|
42
39
|
}
|
|
43
|
-
.pc-content-list_size_s .pc-content-list__icon_without_title {
|
|
44
|
-
width: 18px;
|
|
45
|
-
height: 18px;
|
|
46
|
-
margin-top: 0;
|
|
47
|
-
margin-bottom: 0;
|
|
48
|
-
}
|
|
49
40
|
.pc-content-list_size_s .pc-content-list__text {
|
|
50
41
|
font-size: var(--g-text-body-1-font-size);
|
|
51
42
|
line-height: var(--g-text-body-1-line-height);
|
|
@@ -53,6 +44,15 @@ unpredictable css rules order in build */
|
|
|
53
44
|
.pc-content-list_size_s .pc-content-list__item:not(:last-child) {
|
|
54
45
|
margin-bottom: 12px;
|
|
55
46
|
}
|
|
47
|
+
.pc-content-list_size_s .pc-content-list__item_without-title:not(:last-child) {
|
|
48
|
+
margin-bottom: 8px;
|
|
49
|
+
}
|
|
50
|
+
.pc-content-list_size_s .pc-content-list__item_without-title .pc-content-list__icon {
|
|
51
|
+
width: 18px;
|
|
52
|
+
height: 18px;
|
|
53
|
+
margin-top: 0;
|
|
54
|
+
margin-bottom: 0;
|
|
55
|
+
}
|
|
56
56
|
.pc-content-list__icon {
|
|
57
57
|
display: block;
|
|
58
58
|
}
|
|
@@ -19,8 +19,8 @@ const ContentList = ({ list, size = 'l', qa }) => {
|
|
|
19
19
|
const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);
|
|
20
20
|
return (React.createElement("div", { className: b({ size }), "data-qa": qa }, list === null || list === void 0 ? void 0 : list.map((item) => {
|
|
21
21
|
const { icon, title, text } = item;
|
|
22
|
-
return (React.createElement("div", { className: b('item'), key: uuidv4() },
|
|
23
|
-
React.createElement(ItemIcon, { icon: icon, className: b('icon'
|
|
22
|
+
return (React.createElement("div", { className: b('item', { 'without-title': !title }), key: uuidv4() },
|
|
23
|
+
React.createElement(ItemIcon, { icon: icon, className: b('icon'), qa: qaAttributes.image }),
|
|
24
24
|
React.createElement("div", null,
|
|
25
25
|
title &&
|
|
26
26
|
React.createElement(getHeadingLevel(size), { className: b('title'), 'data-qa': qaAttributes.title }, React.createElement(YFMWrapper, { content: title, modifiers: { constructor: true } })),
|
|
@@ -29,6 +29,7 @@ export declare const subBlockMap: {
|
|
|
29
29
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
30
30
|
content: (props: import("./sub-blocks/Content/Content").ContentProps) => JSX.Element;
|
|
31
31
|
quote: (props: import("./models").QuoteProps) => JSX.Element;
|
|
32
|
+
"price-card": (props: import("./models").PriceCardProps) => JSX.Element;
|
|
32
33
|
};
|
|
33
34
|
export declare const navItemMap: {
|
|
34
35
|
button: import("react").FC<Pick<import("./navigation/models").NavigationItemProps, "className"> & import("./models").ButtonProps>;
|
|
@@ -2,7 +2,7 @@ import { BannerBlock, CardLayoutBlock, CompaniesBlock, ContentLayoutBlock, Exten
|
|
|
2
2
|
import { BlockType, NavigationItemType, SubBlockType } from './models';
|
|
3
3
|
import { GithubButton, NavigationButton, NavigationDropdown, NavigationLink, } from './navigation/components/NavigationItem';
|
|
4
4
|
import SocialIcon from './navigation/components/SocialIcon/SocialIcon';
|
|
5
|
-
import { BackgroundCard, BannerCard, BasicCard, Content, Divider, LayoutItem, MediaCard, PriceDetailed, Quote, } from './sub-blocks';
|
|
5
|
+
import { BackgroundCard, BannerCard, BasicCard, Content, Divider, LayoutItem, MediaCard, PriceCard, PriceDetailed, Quote, } from './sub-blocks';
|
|
6
6
|
export const blockMap = {
|
|
7
7
|
[BlockType.SliderBlock]: SliderBlock,
|
|
8
8
|
[BlockType.ExtendedFeaturesBlock]: ExtendedFeaturesBlock,
|
|
@@ -34,6 +34,7 @@ export const subBlockMap = {
|
|
|
34
34
|
[SubBlockType.BasicCard]: BasicCard,
|
|
35
35
|
[SubBlockType.Content]: Content,
|
|
36
36
|
[SubBlockType.Quote]: Quote,
|
|
37
|
+
[SubBlockType.PriceCard]: PriceCard,
|
|
37
38
|
};
|
|
38
39
|
export const navItemMap = {
|
|
39
40
|
[NavigationItemType.Button]: NavigationButton,
|
|
@@ -63,27 +63,16 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
63
63
|
createDOMElement?: boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
66
|
-
text
|
|
67
|
-
yfmText?: string;
|
|
66
|
+
text: string;
|
|
68
67
|
image: ThemedImage;
|
|
69
68
|
logo: ImageProps;
|
|
70
69
|
color?: string;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated use property button instead
|
|
73
|
-
*/
|
|
74
70
|
url?: string;
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated use property button instead
|
|
77
|
-
*/
|
|
78
71
|
urlTitle?: string;
|
|
79
72
|
author?: AuthorItem;
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated use property button instead
|
|
82
|
-
*/
|
|
83
73
|
buttonText?: string;
|
|
84
74
|
theme?: TextTheme;
|
|
85
75
|
quoteType?: QuoteType;
|
|
86
|
-
button?: ButtonProps;
|
|
87
76
|
}
|
|
88
77
|
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
89
78
|
url?: string;
|