@gravity-ui/page-constructor 4.55.0 → 4.56.1
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/Buttons/Buttons.css +11 -0
- package/build/cjs/components/Buttons/Buttons.d.ts +12 -0
- package/build/cjs/components/Buttons/Buttons.js +18 -0
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -3
- package/build/cjs/components/CardBase/CardBase.js +5 -6
- package/build/cjs/components/Links/Links.css +14 -0
- package/build/cjs/components/Links/Links.d.ts +12 -0
- package/build/cjs/components/Links/Links.js +18 -0
- package/build/cjs/components/index.d.ts +2 -1
- package/build/cjs/components/index.js +4 -2
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +4 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/cjs/schema/constants.d.ts +12 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +8 -2
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +3 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +10 -7
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/BasicCard/schema.js +3 -0
- package/build/cjs/sub-blocks/Content/Content.css +4 -22
- package/build/cjs/sub-blocks/Content/Content.js +2 -20
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +9 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +10 -4
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +3 -0
- package/build/cjs/sub-blocks/PriceCard/PriceCard.css +2 -5
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js +3 -3
- package/build/cjs/sub-blocks/PriceCard/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/PriceCard/schema.js +3 -0
- package/build/esm/components/Buttons/Buttons.css +11 -0
- package/build/esm/components/Buttons/Buttons.d.ts +13 -0
- package/build/esm/components/Buttons/Buttons.js +16 -0
- package/build/esm/components/CardBase/CardBase.d.ts +2 -3
- package/build/esm/components/CardBase/CardBase.js +6 -7
- package/build/esm/components/Links/Links.css +14 -0
- package/build/esm/components/Links/Links.d.ts +13 -0
- package/build/esm/components/Links/Links.js +16 -0
- package/build/esm/components/index.d.ts +2 -1
- package/build/esm/components/index.js +2 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/models/constructor-items/common.d.ts +4 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/esm/schema/constants.d.ts +12 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +9 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +4 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +3 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +7 -4
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +4 -0
- package/build/esm/sub-blocks/BasicCard/schema.js +3 -0
- package/build/esm/sub-blocks/Content/Content.css +4 -22
- package/build/esm/sub-blocks/Content/Content.js +3 -21
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +9 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +11 -5
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +3 -0
- package/build/esm/sub-blocks/PriceCard/PriceCard.css +2 -5
- package/build/esm/sub-blocks/PriceCard/PriceCard.js +4 -4
- package/build/esm/sub-blocks/PriceCard/schema.d.ts +4 -0
- package/build/esm/sub-blocks/PriceCard/schema.js +3 -0
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +4 -0
- package/server/models/constructor-items/sub-blocks.d.ts +4 -4
- package/widget/index.js +1 -1
- package/build/cjs/components/Link/Links.d.ts +0 -6
- package/build/cjs/components/Link/Links.js +0 -13
- package/build/esm/components/Link/Links.d.ts +0 -6
- package/build/esm/components/Link/Links.js +0 -10
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps, ContentSize } from '../../models';
|
|
3
|
+
type ButtonsProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
buttons?: ButtonProps[];
|
|
6
|
+
size?: ContentSize;
|
|
7
|
+
titleId?: string;
|
|
8
|
+
qa?: string;
|
|
9
|
+
buttonQa?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const Buttons: React.FC<ButtonsProps>;
|
|
12
|
+
export default Buttons;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const Button_1 = tslib_1.__importDefault(require("../Button/Button"));
|
|
7
|
+
const b = (0, utils_1.block)('buttons');
|
|
8
|
+
function getButtonSize(size) {
|
|
9
|
+
switch (size) {
|
|
10
|
+
case 's':
|
|
11
|
+
return 'm';
|
|
12
|
+
case 'l':
|
|
13
|
+
default:
|
|
14
|
+
return 'xl';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const Buttons = ({ className, titleId, buttons, size = 's', qa, buttonQa }) => buttons ? (react_1.default.createElement("div", { className: b({ size }, className), "data-qa": qa }, buttons.map((item) => (react_1.default.createElement(Button_1.default, Object.assign({ className: b('button') }, item, { key: item.url, size: getButtonSize(size), qa: buttonQa, extraProps: Object.assign({ 'aria-describedby': item.urlTitle ? undefined : titleId }, item.extraProps) })))))) : null;
|
|
18
|
+
exports.default = Buttons;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React, { HTMLAttributeAnchorTarget,
|
|
1
|
+
import React, { HTMLAttributeAnchorTarget, PropsWithChildren } from 'react';
|
|
2
2
|
import { AnalyticsEventsBase, ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
|
-
export interface CardBaseProps extends AnalyticsEventsBase, CardBaseParams {
|
|
3
|
+
export interface CardBaseProps extends AnalyticsEventsBase, CardBaseParams, PropsWithChildren {
|
|
4
4
|
className?: string;
|
|
5
5
|
bodyClassName?: string;
|
|
6
6
|
contentClassName?: string;
|
|
7
|
-
children: ReactElement | ReactElement[];
|
|
8
7
|
url?: string;
|
|
9
8
|
urlTitle?: string;
|
|
10
9
|
target?: HTMLAttributeAnchorTarget;
|
|
@@ -36,12 +36,11 @@ const Layout = (props) => {
|
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
39
|
+
react_1.Children.toArray(children).forEach((child) => {
|
|
40
|
+
if ((0, react_1.isValidElement)(child)) {
|
|
41
|
+
handleChild(child);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
45
44
|
const cardContent = (react_1.default.createElement(react_1.Fragment, null,
|
|
46
45
|
(header || image) && (react_1.default.createElement(BackgroundImage_1.default, Object.assign({ className: b('header', headerClass) }, (typeof image === 'string' ? { src: image } : image), { qa: qaAttributes.header }),
|
|
47
46
|
react_1.default.createElement("div", { className: b('header-content') }, header))),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContentSize, LinkProps } from '../../models';
|
|
3
|
+
type LinksProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
titleId?: string;
|
|
6
|
+
links?: LinkProps[];
|
|
7
|
+
size?: ContentSize;
|
|
8
|
+
qa?: string;
|
|
9
|
+
linkQa?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const Links: React.FC<LinksProps>;
|
|
12
|
+
export default Links;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const Link_1 = tslib_1.__importDefault(require("../Link/Link"));
|
|
7
|
+
const b = (0, utils_1.block)('links');
|
|
8
|
+
function getLinkSize(size) {
|
|
9
|
+
switch (size) {
|
|
10
|
+
case 's':
|
|
11
|
+
return 'm';
|
|
12
|
+
case 'l':
|
|
13
|
+
default:
|
|
14
|
+
return 'l';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const Links = ({ className, titleId, links, size = 's', qa, linkQa }) => links ? (react_1.default.createElement("div", { className: b({ size }, className), "data-qa": qa }, links === null || links === void 0 ? void 0 : links.map((link) => (react_1.default.createElement(Link_1.default, Object.assign({ className: b('link') }, link, { textSize: getLinkSize(size), key: link.url, qa: linkQa, extraProps: Object.assign({ 'aria-describedby': link.urlTitle ? undefined : titleId }, link.extraProps) })))))) : null;
|
|
18
|
+
exports.default = Links;
|
|
@@ -6,6 +6,7 @@ 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
8
|
export { default as Button } from './Button/Button';
|
|
9
|
+
export { default as Buttons } from './Buttons/Buttons';
|
|
9
10
|
export { default as CardBase } from './CardBase/CardBase';
|
|
10
11
|
export { default as ErrorWrapper } from './ErrorWrapper/ErrorWrapper';
|
|
11
12
|
export { default as FileLink } from './FileLink/FileLink';
|
|
@@ -16,7 +17,7 @@ export { default as HeaderBreadcrumbs } from './HeaderBreadcrumbs/HeaderBreadcru
|
|
|
16
17
|
export { default as Image } from './Image/Image';
|
|
17
18
|
export { default as ImageBase } from './ImageBase/ImageBase';
|
|
18
19
|
export { default as Link } from './Link/Link';
|
|
19
|
-
export { default as Links } from './
|
|
20
|
+
export { default as Links } from './Links/Links';
|
|
20
21
|
export { default as Media } from './Media/Media';
|
|
21
22
|
export { default as OutsideClick } from './OutsideClick/OutsideClick';
|
|
22
23
|
export { default as ReactPlayer } from './ReactPlayer/ReactPlayer';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IconWrapper = exports.InnerForm = exports.ContentList = exports.FullscreenMedia = exports.MetaInfo = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.ImageBase = exports.Image = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
6
|
+
exports.IconWrapper = exports.InnerForm = exports.ContentList = exports.FullscreenMedia = exports.MetaInfo = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.ImageBase = exports.Image = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Buttons = exports.Button = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
7
7
|
var Anchor_1 = require("./Anchor/Anchor");
|
|
8
8
|
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return __importDefault(Anchor_1).default; } });
|
|
9
9
|
var AnimateBlock_1 = require("./AnimateBlock/AnimateBlock");
|
|
@@ -20,6 +20,8 @@ var BlockBase_1 = require("./BlockBase/BlockBase");
|
|
|
20
20
|
Object.defineProperty(exports, "BlockBase", { enumerable: true, get: function () { return __importDefault(BlockBase_1).default; } });
|
|
21
21
|
var Button_1 = require("./Button/Button");
|
|
22
22
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(Button_1).default; } });
|
|
23
|
+
var Buttons_1 = require("./Buttons/Buttons");
|
|
24
|
+
Object.defineProperty(exports, "Buttons", { enumerable: true, get: function () { return __importDefault(Buttons_1).default; } });
|
|
23
25
|
var CardBase_1 = require("./CardBase/CardBase");
|
|
24
26
|
Object.defineProperty(exports, "CardBase", { enumerable: true, get: function () { return __importDefault(CardBase_1).default; } });
|
|
25
27
|
var ErrorWrapper_1 = require("./ErrorWrapper/ErrorWrapper");
|
|
@@ -40,7 +42,7 @@ var ImageBase_1 = require("./ImageBase/ImageBase");
|
|
|
40
42
|
Object.defineProperty(exports, "ImageBase", { enumerable: true, get: function () { return __importDefault(ImageBase_1).default; } });
|
|
41
43
|
var Link_1 = require("./Link/Link");
|
|
42
44
|
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return __importDefault(Link_1).default; } });
|
|
43
|
-
var Links_1 = require("./
|
|
45
|
+
var Links_1 = require("./Links/Links");
|
|
44
46
|
Object.defineProperty(exports, "Links", { enumerable: true, get: function () { return __importDefault(Links_1).default; } });
|
|
45
47
|
var Media_1 = require("./Media/Media");
|
|
46
48
|
Object.defineProperty(exports, "Media", { enumerable: true, get: function () { return __importDefault(Media_1).default; } });
|
|
@@ -24,7 +24,7 @@ export declare const subBlockMap: {
|
|
|
24
24
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
25
25
|
"media-card": ({ border, analyticsEvents, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
26
26
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
27
|
-
"layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullscreen, icon, className, analyticsEvents, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
27
|
+
"layout-item": ({ content: { links, buttons, ...content }, metaInfo, media, border, fullscreen, icon, className, analyticsEvents, controlPosition, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
28
28
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
29
29
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
30
30
|
content: (props: import("./sub-blocks/Content/Content").ContentProps) => JSX.Element;
|
|
@@ -297,9 +297,13 @@ export interface TitleItemBaseProps {
|
|
|
297
297
|
export type MediaView = 'fit' | 'full';
|
|
298
298
|
export type MediaBorder = 'shadow' | 'line' | 'none';
|
|
299
299
|
export type CardBorder = MediaBorder;
|
|
300
|
+
export type ControlPosition = 'content' | 'footer';
|
|
300
301
|
export interface CardBaseProps {
|
|
301
302
|
border?: CardBorder;
|
|
302
303
|
}
|
|
304
|
+
export type CardLayoutProps = {
|
|
305
|
+
controlPosition?: ControlPosition;
|
|
306
|
+
};
|
|
303
307
|
export interface PriceDescriptionProps {
|
|
304
308
|
title: string;
|
|
305
309
|
detailedTitle?: string;
|
|
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AnalyticsEventsBase, PixelEvent } from '../common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageCardMargins, ImageObjectProps, ImageProps, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
6
|
+
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, CardLayoutProps, ContentTheme, DividerSize, ImageCardMargins, ImageObjectProps, ImageProps, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -97,14 +97,14 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
97
97
|
quoteType?: QuoteType;
|
|
98
98
|
button?: ButtonProps;
|
|
99
99
|
}
|
|
100
|
-
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
100
|
+
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
101
101
|
url?: string;
|
|
102
102
|
urlTitle?: string;
|
|
103
103
|
background?: ThemeSupporting<ImageObjectProps>;
|
|
104
104
|
paddingBottom?: 's' | 'm' | 'l' | 'xl';
|
|
105
105
|
backgroundColor?: string;
|
|
106
106
|
}
|
|
107
|
-
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
107
|
+
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
108
108
|
url: string;
|
|
109
109
|
urlTitle?: string;
|
|
110
110
|
icon?: ImageProps;
|
|
@@ -134,7 +134,7 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
|
|
|
134
134
|
backgroundColor?: string;
|
|
135
135
|
list?: string[];
|
|
136
136
|
}
|
|
137
|
-
export interface LayoutItemProps extends ClassNameProps, AnalyticsEventsBase {
|
|
137
|
+
export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
|
|
138
138
|
content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
|
|
139
139
|
media?: MediaProps;
|
|
140
140
|
metaInfo?: string[];
|
|
@@ -476,6 +476,10 @@ export declare const cardSchemas: {
|
|
|
476
476
|
type: string;
|
|
477
477
|
};
|
|
478
478
|
};
|
|
479
|
+
controlPosition: {
|
|
480
|
+
type: string;
|
|
481
|
+
enum: string[];
|
|
482
|
+
};
|
|
479
483
|
border: {
|
|
480
484
|
type: string;
|
|
481
485
|
enum: string[];
|
|
@@ -518,6 +522,10 @@ export declare const cardSchemas: {
|
|
|
518
522
|
type: string;
|
|
519
523
|
enum: string[];
|
|
520
524
|
};
|
|
525
|
+
controlPosition: {
|
|
526
|
+
type: string;
|
|
527
|
+
enum: string[];
|
|
528
|
+
};
|
|
521
529
|
title: {
|
|
522
530
|
oneOf: ({
|
|
523
531
|
type: string;
|
|
@@ -855,6 +863,10 @@ export declare const cardSchemas: {
|
|
|
855
863
|
optionName: string;
|
|
856
864
|
})[];
|
|
857
865
|
};
|
|
866
|
+
controlPosition: {
|
|
867
|
+
type: string;
|
|
868
|
+
enum: string[];
|
|
869
|
+
};
|
|
858
870
|
title: {
|
|
859
871
|
oneOf: ({
|
|
860
872
|
type: string;
|
|
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
|
|
|
37
37
|
object-fit: cover;
|
|
38
38
|
object-position: left;
|
|
39
39
|
}
|
|
40
|
+
.pc-background-card__footer {
|
|
41
|
+
margin-top: 0px;
|
|
42
|
+
}
|
|
43
|
+
.pc-background-card__links, .pc-background-card__buttons {
|
|
44
|
+
margin-top: 16px;
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
a.pc-background-card_theme_light {
|
|
42
48
|
background-color: var(--pc-color-base-silver);
|
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
5
6
|
const components_1 = require("../../components/");
|
|
6
7
|
const theme_1 = require("../../context/theme");
|
|
7
8
|
const utils_1 = require("../../utils");
|
|
8
9
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
9
10
|
const b = (0, utils_1.block)('background-card');
|
|
10
11
|
const BackgroundCard = (props) => {
|
|
11
|
-
const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, } = props;
|
|
12
|
+
const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', } = props;
|
|
13
|
+
const titleId = (0, uikit_1.useUniqId)();
|
|
12
14
|
const theme = (0, theme_1.useTheme)();
|
|
13
15
|
const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
|
|
14
16
|
const borderType = hasBackgroundColor ? 'none' : border;
|
|
17
|
+
const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
|
|
15
18
|
return (react_1.default.createElement(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle },
|
|
16
19
|
react_1.default.createElement(components_1.CardBase.Content, null,
|
|
17
20
|
react_1.default.createElement(components_1.BackgroundImage, Object.assign({ className: b('image') }, (0, utils_1.getThemedValue)(background, theme), { style: { backgroundColor } })),
|
|
18
|
-
react_1.default.createElement(Content_1.default, { title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))
|
|
21
|
+
react_1.default.createElement(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: areControlsInFooter ? undefined : links, buttons: areControlsInFooter ? undefined : buttons, colSizes: { all: 12, md: 12 } })),
|
|
22
|
+
areControlsInFooter && (links || buttons) && (react_1.default.createElement(components_1.CardBase.Footer, null,
|
|
23
|
+
react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
24
|
+
react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
19
25
|
};
|
|
20
26
|
exports.default = BackgroundCard;
|
|
@@ -3,19 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
|
-
const
|
|
7
|
-
const IconWrapper_1 = tslib_1.__importDefault(require("../../components/IconWrapper/IconWrapper"));
|
|
6
|
+
const components_1 = require("../../components");
|
|
8
7
|
const sub_blocks_1 = require("../../models/constructor-items/sub-blocks");
|
|
9
8
|
const utils_1 = require("../../utils");
|
|
10
9
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
11
10
|
const b = (0, utils_1.block)('basic-card');
|
|
12
11
|
const BasicCard = (props) => {
|
|
13
|
-
const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top } = props, cardParams = tslib_1.__rest(props, ["title", "text", "icon", "additionalInfo", "links", "list", "buttons", "iconPosition"]);
|
|
12
|
+
const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content' } = props, cardParams = tslib_1.__rest(props, ["title", "text", "icon", "additionalInfo", "links", "list", "buttons", "iconPosition", "controlPosition"]);
|
|
14
13
|
const titleId = (0, uikit_1.useUniqId)();
|
|
15
14
|
const descriptionId = (0, uikit_1.useUniqId)();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const areControlsInFooter = controlPosition === 'footer';
|
|
16
|
+
return (react_1.default.createElement(components_1.CardBase, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
|
|
17
|
+
react_1.default.createElement(components_1.CardBase.Content, null,
|
|
18
|
+
react_1.default.createElement(components_1.IconWrapper, { icon: icon ? { value: icon, position: iconPosition } : undefined },
|
|
19
|
+
react_1.default.createElement(Content_1.default, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: areControlsInFooter ? undefined : links, list: list, buttons: areControlsInFooter ? undefined : buttons, size: "s", colSizes: { all: 12, md: 12 } }))),
|
|
20
|
+
areControlsInFooter && (buttons || links) && (react_1.default.createElement(components_1.CardBase.Footer, { className: b('footer') },
|
|
21
|
+
react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId }),
|
|
22
|
+
react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId })))));
|
|
20
23
|
};
|
|
21
24
|
exports.default = BasicCard;
|
|
@@ -27,16 +27,6 @@ unpredictable css rules order in build */
|
|
|
27
27
|
color: var(--g-color-text-primary);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.pc-content__buttons {
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-wrap: wrap;
|
|
33
|
-
column-gap: 12px;
|
|
34
|
-
}
|
|
35
|
-
.pc-content__links {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
align-items: baseline;
|
|
39
|
-
}
|
|
40
30
|
.pc-content__link {
|
|
41
31
|
display: block;
|
|
42
32
|
}
|
|
@@ -67,13 +57,9 @@ unpredictable css rules order in build */
|
|
|
67
57
|
.pc-content_size_s .pc-content__text_without-title {
|
|
68
58
|
margin-top: 0;
|
|
69
59
|
}
|
|
60
|
+
.pc-content_size_s .pc-content__list,
|
|
70
61
|
.pc-content_size_s .pc-content__links,
|
|
71
|
-
.pc-content_size_s .pc-
|
|
72
|
-
.pc-content_size_s .pc-content__buttons,
|
|
73
|
-
.pc-content_size_s .pc-content__button {
|
|
74
|
-
margin-top: 8px;
|
|
75
|
-
}
|
|
76
|
-
.pc-content_size_s .pc-content__list {
|
|
62
|
+
.pc-content_size_s .pc-content__buttons {
|
|
77
63
|
margin-top: 16px;
|
|
78
64
|
}
|
|
79
65
|
.pc-content_size_l .pc-content__text,
|
|
@@ -88,13 +74,9 @@ unpredictable css rules order in build */
|
|
|
88
74
|
font-size: var(--g-text-body-3-font-size);
|
|
89
75
|
line-height: var(--g-text-body-3-line-height);
|
|
90
76
|
}
|
|
77
|
+
.pc-content_size_l .pc-content__list,
|
|
91
78
|
.pc-content_size_l .pc-content__links,
|
|
92
|
-
.pc-content_size_l .pc-
|
|
93
|
-
.pc-content_size_l .pc-content__buttons,
|
|
94
|
-
.pc-content_size_l .pc-content__button {
|
|
95
|
-
margin-top: 12px;
|
|
96
|
-
}
|
|
97
|
-
.pc-content_size_l .pc-content__list {
|
|
79
|
+
.pc-content_size_l .pc-content__buttons {
|
|
98
80
|
margin-top: 24px;
|
|
99
81
|
}
|
|
100
82
|
.pc-content_theme_dark {
|
|
@@ -17,24 +17,6 @@ function getTextSize(size) {
|
|
|
17
17
|
return 'm';
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function getLinkSize(size) {
|
|
21
|
-
switch (size) {
|
|
22
|
-
case 's':
|
|
23
|
-
return 'm';
|
|
24
|
-
case 'l':
|
|
25
|
-
default:
|
|
26
|
-
return 'l';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function getButtonSize(size) {
|
|
30
|
-
switch (size) {
|
|
31
|
-
case 's':
|
|
32
|
-
return 'm';
|
|
33
|
-
case 'l':
|
|
34
|
-
default:
|
|
35
|
-
return 'xl';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
20
|
const Content = (props) => {
|
|
39
21
|
const { title, titleId: titleIdFromProps, text, textId, additionalInfo, size = 'l', links, buttons, colSizes = { all: 12, sm: 8 }, centered, theme, className, list, qa, } = props;
|
|
40
22
|
const qaAttributes = (0, blocks_1.getQaAttrubutes)(qa, ['links', 'link', 'buttons', 'button', 'list']);
|
|
@@ -56,7 +38,7 @@ const Content = (props) => {
|
|
|
56
38
|
'constructor-notice': true,
|
|
57
39
|
[`constructor-size-${size}`]: true,
|
|
58
40
|
} }))),
|
|
59
|
-
links && (react_1.default.createElement(
|
|
60
|
-
buttons && (react_1.default.createElement(
|
|
41
|
+
links && (react_1.default.createElement(components_1.Links, { className: b('links', { size }), size: size, links: links, titleId: titleId, qa: qaAttributes.links, linkQa: qaAttributes.link })),
|
|
42
|
+
buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons', { size }), size: size, buttons: buttons, titleId: titleId, qa: qaAttributes.buttons, buttonQa: qaAttributes.button }))));
|
|
61
43
|
};
|
|
62
44
|
exports.default = Content;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
+
.pc-layout-item {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
height: 100%;
|
|
7
|
+
}
|
|
3
8
|
.pc-layout-item__media {
|
|
4
9
|
width: 100%;
|
|
5
10
|
display: block;
|
|
@@ -12,8 +17,12 @@ unpredictable css rules order in build */
|
|
|
12
17
|
margin: 16px 0 -8px 0;
|
|
13
18
|
}
|
|
14
19
|
.pc-layout-item__content {
|
|
20
|
+
flex: auto;
|
|
15
21
|
margin: 16px 16px 0 0;
|
|
16
22
|
}
|
|
17
23
|
.pc-layout-item__content_no-media {
|
|
18
24
|
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
.pc-layout-item__links, .pc-layout-item__buttons {
|
|
27
|
+
margin-top: 16px;
|
|
19
28
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LayoutItemProps } from '../../models';
|
|
2
|
-
declare const LayoutItem: ({ content: { links, ...content }, metaInfo, media, border, fullscreen, icon, className, analyticsEvents, }: LayoutItemProps) => JSX.Element;
|
|
2
|
+
declare const LayoutItem: ({ content: { links, buttons, ...content }, metaInfo, media, border, fullscreen, icon, className, analyticsEvents, controlPosition, }: LayoutItemProps) => JSX.Element;
|
|
3
3
|
export default LayoutItem;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.
|
|
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("../../utils");
|
|
7
8
|
const Content_1 = tslib_1.__importDefault(require("../Content/Content"));
|
|
8
9
|
const utils_2 = require("./utils");
|
|
9
10
|
const b = (0, utils_1.block)('layout-item');
|
|
10
11
|
const LayoutItem = (_a) => {
|
|
11
|
-
var _b = _a.content, { links } = _b, content = tslib_1.__rest(_b, ["links"]), { metaInfo, media, border, fullscreen, icon, className, analyticsEvents } = _a;
|
|
12
|
-
const
|
|
12
|
+
var _b = _a.content, { links, buttons } = _b, content = tslib_1.__rest(_b, ["links", "buttons"]), { metaInfo, media, border, fullscreen, icon, className, analyticsEvents, controlPosition = 'content' } = _a;
|
|
13
|
+
const normalizedLinks = (0, react_1.useMemo)(() => (0, utils_2.getLayoutItemLinks)(links), [links]);
|
|
14
|
+
const areControlsInFooter = controlPosition === 'footer';
|
|
15
|
+
const contentProps = Object.assign(Object.assign(Object.assign({}, content), (areControlsInFooter ? {} : { links: normalizedLinks, buttons })), { size: 's', colSizes: { all: 12, md: 12 } });
|
|
16
|
+
const titleId = (0, uikit_1.useUniqId)();
|
|
13
17
|
const renderMedia = () => {
|
|
14
18
|
if (!media) {
|
|
15
19
|
return null;
|
|
@@ -24,6 +28,8 @@ const LayoutItem = (_a) => {
|
|
|
24
28
|
metaInfo && react_1.default.createElement(components_1.MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
25
29
|
react_1.default.createElement("div", { className: b('content', { 'no-media': !media }) },
|
|
26
30
|
react_1.default.createElement(components_1.IconWrapper, { icon: icon },
|
|
27
|
-
react_1.default.createElement(Content_1.default, Object.assign({}, contentProps))))
|
|
31
|
+
react_1.default.createElement(Content_1.default, Object.assign({}, contentProps, { titleId: titleId })))),
|
|
32
|
+
areControlsInFooter && links && (react_1.default.createElement(components_1.Links, { className: b('links'), size: "s", links: links, titleId: titleId })),
|
|
33
|
+
areControlsInFooter && buttons && (react_1.default.createElement(components_1.Buttons, { className: b('buttons'), size: "s", buttons: buttons, titleId: titleId }))));
|
|
28
34
|
};
|
|
29
35
|
exports.default = LayoutItem;
|
|
@@ -86,11 +86,8 @@ unpredictable css rules order in build */
|
|
|
86
86
|
.pc-price-card__links, .pc-price-card__buttons {
|
|
87
87
|
margin-top: 24px;
|
|
88
88
|
}
|
|
89
|
-
.pc-price-
|
|
90
|
-
margin-
|
|
91
|
-
}
|
|
92
|
-
.pc-price-card__link {
|
|
93
|
-
margin-top: 0;
|
|
89
|
+
.pc-price-card__footer {
|
|
90
|
+
margin-top: 0px;
|
|
94
91
|
}
|
|
95
92
|
@media (max-width: 769px) {
|
|
96
93
|
.pc-price-card__title, .pc-price-card__price {
|
|
@@ -9,7 +9,7 @@ const b = (0, utils_1.block)('price-card');
|
|
|
9
9
|
const PriceCard = (props) => {
|
|
10
10
|
const { border, title, price, pricePeriod, priceDetails, theme, description, list, buttons, links, backgroundColor, } = props;
|
|
11
11
|
return (react_1.default.createElement(components_1.CardBase, { className: b({ theme }), border: border },
|
|
12
|
-
react_1.default.createElement(components_1.CardBase.Content,
|
|
12
|
+
react_1.default.createElement(components_1.CardBase.Content, { key: "content" },
|
|
13
13
|
react_1.default.createElement(components_1.BackgroundImage, { className: b('background'), style: { backgroundColor } }),
|
|
14
14
|
react_1.default.createElement("div", { className: b('content', { theme }) },
|
|
15
15
|
react_1.default.createElement("div", { className: b('info') },
|
|
@@ -27,7 +27,7 @@ const PriceCard = (props) => {
|
|
|
27
27
|
icon: Check_1.default,
|
|
28
28
|
text: item,
|
|
29
29
|
})), size: "l" }))) : null),
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
react_1.default.createElement(components_1.Buttons, { className: b('buttons'), buttons: buttons, size: "s" }),
|
|
31
|
+
react_1.default.createElement(components_1.Links, { className: b('links'), links: links, size: "s" })))));
|
|
32
32
|
};
|
|
33
33
|
exports.default = PriceCard;
|