@gravity-ui/page-constructor 8.2.1 → 8.3.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/README.md +1 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.css +2 -2
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +2 -0
- package/build/cjs/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -11
- package/build/cjs/blocks/FoldableList/schema.d.ts +0 -11
- package/build/cjs/blocks/Form/Form.css +10 -1
- package/build/cjs/blocks/Form/Form.js +4 -2
- package/build/cjs/blocks/Form/Form.js.map +1 -1
- package/build/cjs/blocks/Form/schema.d.ts +0 -11
- package/build/cjs/blocks/Header/Header.js +4 -1
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/blocks/Info/schema.d.ts +0 -22
- package/build/cjs/blocks/Map/schema.d.ts +0 -11
- package/build/cjs/blocks/Media/schema.d.ts +0 -22
- package/build/cjs/blocks/Questions/schema.d.ts +0 -11
- package/build/cjs/blocks/Tabs/schema.d.ts +0 -11
- package/build/cjs/components/Buttons/Buttons.css +2 -2
- package/build/cjs/components/Buttons/Buttons.js +2 -0
- package/build/cjs/components/Buttons/Buttons.js.map +1 -1
- package/build/cjs/components/ContentList/ContentList.css +8 -8
- package/build/cjs/components/ContentList/ContentList.js +2 -0
- package/build/cjs/components/ContentList/ContentList.js.map +1 -1
- package/build/cjs/components/IconWrapper/IconWrapper.css +6 -0
- package/build/cjs/components/Links/Links.css +1 -1
- package/build/cjs/components/Links/Links.js +2 -0
- package/build/cjs/components/Links/Links.js.map +1 -1
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/components/index.js +3 -1
- package/build/cjs/components/index.js.map +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +9 -19
- package/build/cjs/models/constructor-items/blocks.js.map +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/common.js.map +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +6 -6
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/schema/constants.d.ts +5 -30
- package/build/cjs/schema/validators/common.js +1 -1
- package/build/cjs/schema/validators/common.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +3 -10
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +2 -9
- package/build/cjs/sub-blocks/BasicCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/Content/Content.css +29 -17
- package/build/cjs/sub-blocks/Content/Content.js +7 -13
- package/build/cjs/sub-blocks/Content/Content.js.map +1 -1
- package/build/cjs/sub-blocks/Content/schema.d.ts +0 -100
- package/build/cjs/sub-blocks/Content/schema.js +1 -14
- package/build/cjs/sub-blocks/Content/schema.js.map +1 -1
- package/build/cjs/sub-blocks/ImageCard/schema.d.ts +0 -11
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +0 -11
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.css +2 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js +2 -0
- package/build/esm/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/esm/blocks/ContentLayout/schema.d.ts +0 -11
- package/build/esm/blocks/FoldableList/schema.d.ts +0 -11
- package/build/esm/blocks/Form/Form.css +10 -1
- package/build/esm/blocks/Form/Form.js +4 -2
- package/build/esm/blocks/Form/Form.js.map +1 -1
- package/build/esm/blocks/Form/schema.d.ts +0 -11
- package/build/esm/blocks/Header/Header.js +4 -1
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/blocks/Info/schema.d.ts +0 -22
- package/build/esm/blocks/Map/schema.d.ts +0 -11
- package/build/esm/blocks/Media/schema.d.ts +0 -22
- package/build/esm/blocks/Questions/schema.d.ts +0 -11
- package/build/esm/blocks/Tabs/schema.d.ts +0 -11
- package/build/esm/components/Buttons/Buttons.css +2 -2
- package/build/esm/components/Buttons/Buttons.js +2 -0
- package/build/esm/components/Buttons/Buttons.js.map +1 -1
- package/build/esm/components/ContentList/ContentList.css +8 -8
- package/build/esm/components/ContentList/ContentList.js +2 -0
- package/build/esm/components/ContentList/ContentList.js.map +1 -1
- package/build/esm/components/IconWrapper/IconWrapper.css +6 -0
- package/build/esm/components/Links/Links.css +1 -1
- package/build/esm/components/Links/Links.js +2 -0
- package/build/esm/components/Links/Links.js.map +1 -1
- package/build/esm/components/index.d.ts +1 -0
- package/build/esm/components/index.js +1 -0
- package/build/esm/components/index.js.map +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +9 -19
- package/build/esm/models/constructor-items/blocks.js.map +1 -1
- package/build/esm/models/constructor-items/common.d.ts +1 -1
- package/build/esm/models/constructor-items/common.js.map +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +6 -6
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/schema/constants.d.ts +5 -30
- package/build/esm/schema/validators/common.js +1 -1
- package/build/esm/schema/validators/common.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +3 -10
- package/build/esm/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +2 -9
- package/build/esm/sub-blocks/BasicCard/schema.js +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/Content/Content.css +29 -17
- package/build/esm/sub-blocks/Content/Content.js +7 -12
- package/build/esm/sub-blocks/Content/Content.js.map +1 -1
- package/build/esm/sub-blocks/Content/schema.d.ts +0 -100
- package/build/esm/sub-blocks/Content/schema.js +0 -13
- package/build/esm/sub-blocks/Content/schema.js.map +1 -1
- package/build/esm/sub-blocks/ImageCard/schema.d.ts +0 -11
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +0 -11
- package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +9 -19
- package/server/models/constructor-items/common.d.ts +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +6 -6
- package/widget/index.js +1 -1
- package/build/cjs/components/ContentLabels/ContentLabels.css +0 -53
- package/build/cjs/components/ContentLabels/ContentLabels.d.ts +0 -3
- package/build/cjs/components/ContentLabels/ContentLabels.js +0 -16
- package/build/cjs/components/ContentLabels/ContentLabels.js.map +0 -1
- package/build/esm/components/ContentLabels/ContentLabels.css +0 -53
- package/build/esm/components/ContentLabels/ContentLabels.d.ts +0 -4
- package/build/esm/components/ContentLabels/ContentLabels.js +0 -14
- package/build/esm/components/ContentLabels/ContentLabels.js.map +0 -1
|
@@ -207,17 +207,6 @@ export declare const ImageCard: {
|
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
} | undefined;
|
|
210
|
-
labels?: {
|
|
211
|
-
type: string;
|
|
212
|
-
items: {
|
|
213
|
-
type: string;
|
|
214
|
-
properties: {
|
|
215
|
-
when: {
|
|
216
|
-
type: string;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
} | undefined;
|
|
221
210
|
controlPosition: {
|
|
222
211
|
type: string;
|
|
223
212
|
enum: string[];
|
|
@@ -472,17 +472,6 @@ export declare const LayoutItem: {
|
|
|
472
472
|
};
|
|
473
473
|
};
|
|
474
474
|
};
|
|
475
|
-
labels: {
|
|
476
|
-
type: string;
|
|
477
|
-
items: {
|
|
478
|
-
type: string;
|
|
479
|
-
properties: {
|
|
480
|
-
when: {
|
|
481
|
-
type: string;
|
|
482
|
-
};
|
|
483
|
-
};
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
475
|
controlPosition: {
|
|
487
476
|
type: string;
|
|
488
477
|
enum: string[];
|
|
@@ -15,7 +15,7 @@ exports.LayoutItem = {
|
|
|
15
15
|
...common_1.BaseProps,
|
|
16
16
|
...common_1.CardLayoutProps,
|
|
17
17
|
media: common_1.MediaProps,
|
|
18
|
-
content: (0, omit_1.default)(schema_2.ContentBase, ['colSize', '
|
|
18
|
+
content: (0, omit_1.default)(schema_2.ContentBase, ['colSize', 'centered']),
|
|
19
19
|
contentMargin: {
|
|
20
20
|
type: 'string',
|
|
21
21
|
enum: ['m', 'l'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,yFAAwD;AACxD,8DAAsF;AACtF,4DAAmE;AACnE,iDAA4D;AAE/C,QAAA,UAAU,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE;QACR,GAAG,kBAAS;QACZ,GAAG,wBAAe;QAClB,KAAK,EAAE,mBAAU;QACjB,OAAO,EAAE,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,yFAAwD;AACxD,8DAAsF;AACtF,4DAAmE;AACnE,iDAA4D;AAE/C,QAAA,UAAU,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE;QACR,GAAG,kBAAS;QACZ,GAAG,wBAAe;QAClB,KAAK,EAAE,mBAAU;QACjB,OAAO,EAAE,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACnD,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;YAChB,OAAO,EAAE,GAAG;SACf;QACD,QAAQ,EAAE,gBAAQ;QAClB,MAAM,EAAE;YACJ,IAAI,EAAE,SAAS;SAClB;QACD,UAAU,EAAE;YACR,IAAI,EAAE,SAAS;SAClB;QACD,eAAe,EAAE;YACb,KAAK,EAAE;gBACH;oBACI,GAAG,4BAAoB;oBACvB,UAAU,EAAE,QAAQ;iBACvB;gBACD;oBACI,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,4BAAoB;oBAC3B,UAAU,EAAE,MAAM;iBACrB;aACJ;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport metaInfo from '../../components/MetaInfo/schema';\nimport {BaseProps, CardLayoutProps, MediaProps} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {ContentBase} from '../../sub-blocks/Content/schema';\n\nexport const LayoutItem = {\n type: 'object',\n additionalProperties: false,\n required: ['content', 'media'],\n properties: {\n ...BaseProps,\n ...CardLayoutProps,\n media: MediaProps,\n content: omit(ContentBase, ['colSize', 'centered']),\n contentMargin: {\n type: 'string',\n enum: ['m', 'l'],\n default: 'm',\n },\n metaInfo: metaInfo,\n border: {\n type: 'boolean',\n },\n fullscreen: {\n type: 'boolean',\n },\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.pc-content-layout-block__files_size_l, .pc-content-layout-block__files_size_s {
|
|
1
|
+
.pc-content-layout-block__files_size_l, .pc-content-layout-block__files_size_xl, .pc-content-layout-block__files_size_s {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@ unpredictable css rules order in build */
|
|
|
18
18
|
font-size: var(--g-text-body-2-font-size);
|
|
19
19
|
line-height: var(--g-text-body-2-line-height);
|
|
20
20
|
}
|
|
21
|
-
.pc-content-layout-block__files_size_l {
|
|
21
|
+
.pc-content-layout-block__files_size_l, .pc-content-layout-block__files_size_xl {
|
|
22
22
|
font-size: var(--g-text-body-3-font-size);
|
|
23
23
|
line-height: var(--g-text-body-3-line-height);
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.js","sourceRoot":"../../../../src","sources":["blocks/ContentLayout/ContentLayout.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,kCAAyB;AAC3D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,cAAc,EAAC,kDAAyC;AAChE,OAAO,EAAC,GAAG,EAAC,4BAAmB;AAE/B,OAAO,EAAC,OAAO,EAAC,kCAAyB;AACzC,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAElD,OAAO,qBAAqB,CAAC;AAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAExC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,GAAG,CAAC;QACf,KAAK,GAAG,CAAC;QACT;YACI,OAAO,GAAG,CAAC;IACnB,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,IAAqB;IACvC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,O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EAAE,QAAQ,EAAC,CAAC,EAAE,KAAK,QAAC,KAAK,EAAE,QAAQ,YAC9D,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACvB,eAAC,QAAQ,IACL,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,KAChB,IAAI,EACR,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,IAAI,EAAC,YAAY,EACjB,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,EAC/B,KAAK,EAAE,KAAK,GACd,CACL,CAAC,GACA,CACT,EACA,UAAU,IAAI,CACX,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,KAAC,eAAe,IACZ,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAC3B,gBAAgB,EACpB,IAAI,EAAE,QAAQ,GAChB,GACA,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC;AACF,eAAe,kBAAkB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImage, FileLink} from '../../components';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col} from '../../grid';\nimport {ContentLayoutBlockProps, ContentSize, ContentTextSize} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block, getThemedValue} from '../../utils';\n\nimport './ContentLayout.scss';\n\nconst b = block('content-layout-block');\n\nfunction getFileTextSize(size: ContentSize) {\n switch (size) {\n case 's':\n return 's';\n case 'l':\n default:\n return 'l';\n }\n}\n\nfunction getTextWidth(size: ContentTextSize) {\n switch (size) {\n case 's':\n return {all: 12, md: 6};\n case 'l':\n return {all: 12, md: 12};\n case 'm':\n default:\n return {all: 12, md: 8};\n }\n}\n\nexport const ContentLayoutBlock = (props: ContentLayoutBlockProps) => {\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n\n const {\n textContent,\n fileContent,\n size = 'l',\n background,\n centered,\n theme = 'default',\n textWidth = 'm',\n } = props;\n\n const colSizes = React.useMemo(() => getTextWidth(textWidth), [textWidth]);\n const globalTheme = useTheme();\n const themedBackground = getThemedValue(background, globalTheme);\n\n return (\n <div className={b({size, theme, background: Boolean(background)})}>\n <Content\n className={b('content')}\n {...textContent}\n size={size}\n centered={centered}\n colSizes={colSizes}\n theme={theme}\n />\n {fileContent && (\n <Col className={b('files', {size, centered})} reset sizes={colSizes}>\n {fileContent.map((file) => (\n <FileLink\n className={b('file')}\n {...file}\n key={file.href}\n type=\"horizontal\"\n textSize={getFileTextSize(size)}\n theme={theme}\n />\n ))}\n </Col>\n )}\n {background && (\n <div className={b('background')}>\n <BackgroundImage\n className={b('background-item')}\n {...themedBackground}\n hide={isMobile}\n />\n </div>\n )}\n </div>\n );\n};\nexport default ContentLayoutBlock;\n"]}
|
|
1
|
+
{"version":3,"file":"ContentLayout.js","sourceRoot":"../../../../src","sources":["blocks/ContentLayout/ContentLayout.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,kCAAyB;AAC3D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,cAAc,EAAC,kDAAyC;AAChE,OAAO,EAAC,GAAG,EAAC,4BAAmB;AAE/B,OAAO,EAAC,OAAO,EAAC,kCAAyB;AACzC,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAElD,OAAO,qBAAqB,CAAC;AAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAExC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,GAAG,CAAC;QACf,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;QACV;YACI,OAAO,GA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EAClB,KAAK,EAAE,KAAK,GACd,EACD,WAAW,IAAI,CACZ,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,EAAE,KAAK,QAAC,KAAK,EAAE,QAAQ,YAC9D,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACvB,eAAC,QAAQ,IACL,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,KAChB,IAAI,EACR,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,IAAI,EAAC,YAAY,EACjB,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,EAC/B,KAAK,EAAE,KAAK,GACd,CACL,CAAC,GACA,CACT,EACA,UAAU,IAAI,CACX,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,KAAC,eAAe,IACZ,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAC3B,gBAAgB,EACpB,IAAI,EAAE,QAAQ,GAChB,GACA,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC;AACF,eAAe,kBAAkB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImage, FileLink} from '../../components';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col} from '../../grid';\nimport {ContentLayoutBlockProps, ContentSize, ContentTextSize} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block, getThemedValue} from '../../utils';\n\nimport './ContentLayout.scss';\n\nconst b = block('content-layout-block');\n\nfunction getFileTextSize(size: ContentSize) {\n switch (size) {\n case 's':\n return 's';\n case 'm':\n case 'l':\n case 'xl':\n default:\n return 'l';\n }\n}\n\nfunction getTextWidth(size: ContentTextSize) {\n switch (size) {\n case 's':\n return {all: 12, md: 6};\n case 'l':\n return {all: 12, md: 12};\n case 'm':\n default:\n return {all: 12, md: 8};\n }\n}\n\nexport const ContentLayoutBlock = (props: ContentLayoutBlockProps) => {\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n\n const {\n textContent,\n fileContent,\n size = 'l',\n background,\n centered,\n theme = 'default',\n textWidth = 'm',\n } = props;\n\n const colSizes = React.useMemo(() => getTextWidth(textWidth), [textWidth]);\n const globalTheme = useTheme();\n const themedBackground = getThemedValue(background, globalTheme);\n\n return (\n <div className={b({size, theme, background: Boolean(background)})}>\n <Content\n className={b('content')}\n {...textContent}\n size={size}\n centered={centered}\n colSizes={colSizes}\n theme={theme}\n />\n {fileContent && (\n <Col className={b('files', {size, centered})} reset sizes={colSizes}>\n {fileContent.map((file) => (\n <FileLink\n className={b('file')}\n {...file}\n key={file.href}\n type=\"horizontal\"\n textSize={getFileTextSize(size)}\n theme={theme}\n />\n ))}\n </Col>\n )}\n {background && (\n <div className={b('background')}>\n <BackgroundImage\n className={b('background-item')}\n {...themedBackground}\n hide={isMobile}\n />\n </div>\n )}\n </div>\n );\n};\nexport default ContentLayoutBlock;\n"]}
|
|
@@ -303,17 +303,6 @@ export declare const ContentLayoutBlock: {
|
|
|
303
303
|
};
|
|
304
304
|
};
|
|
305
305
|
};
|
|
306
|
-
labels: {
|
|
307
|
-
type: string;
|
|
308
|
-
items: {
|
|
309
|
-
type: string;
|
|
310
|
-
properties: {
|
|
311
|
-
when: {
|
|
312
|
-
type: string;
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
306
|
controlPosition: {
|
|
318
307
|
type: string;
|
|
319
308
|
enum: string[];
|
|
@@ -129,17 +129,6 @@ export declare const FoldableListBlock: {
|
|
|
129
129
|
contentType: string;
|
|
130
130
|
inputType: string;
|
|
131
131
|
};
|
|
132
|
-
labels: {
|
|
133
|
-
type: string;
|
|
134
|
-
items: {
|
|
135
|
-
type: string;
|
|
136
|
-
properties: {
|
|
137
|
-
when: {
|
|
138
|
-
type: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
132
|
additionalInfo: {
|
|
144
133
|
type: string;
|
|
145
134
|
contentType: string;
|
|
@@ -4,6 +4,15 @@ unpredictable css rules order in build */
|
|
|
4
4
|
border-radius: 32px;
|
|
5
5
|
position: relative;
|
|
6
6
|
}
|
|
7
|
+
.pc-form-block__additional-content {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
width: 100%;
|
|
11
|
+
margin-top: 20px;
|
|
12
|
+
}
|
|
13
|
+
.pc-form-block__additional-content_centered {
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
7
16
|
.pc-form-block__title {
|
|
8
17
|
margin: 0 0 24px 10px;
|
|
9
18
|
}
|
|
@@ -94,7 +103,7 @@ unpredictable css rules order in build */
|
|
|
94
103
|
text-align: center;
|
|
95
104
|
padding-bottom: 32px;
|
|
96
105
|
}
|
|
97
|
-
.pc-form-block_with-background .pc-form-block__row .pc-form-
|
|
106
|
+
.pc-form-block_with-background .pc-form-block__row .pc-form-block__additional-content, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__additional-content {
|
|
98
107
|
justify-content: center;
|
|
99
108
|
}
|
|
100
109
|
.pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
|
|
@@ -14,7 +14,7 @@ import './Form.css';
|
|
|
14
14
|
const b = block('form-block');
|
|
15
15
|
const colSizes = { [GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12 };
|
|
16
16
|
const Form = (props) => {
|
|
17
|
-
const { formData, title, textContent, direction = FormBlockDirection.Center, background, customFormNode, } = props;
|
|
17
|
+
const { formData, title, textContent, direction = FormBlockDirection.Center, background, customFormNode, additionalContentNode, } = props;
|
|
18
18
|
const [contentLoaded, setContentLoaded] = React.useState(false);
|
|
19
19
|
const isMobile = React.useContext(MobileContext);
|
|
20
20
|
const theme = useTheme();
|
|
@@ -44,7 +44,9 @@ const Form = (props) => {
|
|
|
44
44
|
? GridAlignItems.Center
|
|
45
45
|
: GridAlignItems.Start, className: b('row', {
|
|
46
46
|
direction,
|
|
47
|
-
}), children: [_jsx(Col, { sizes: colSizes, className: b('content-col'), children: textContent && (
|
|
47
|
+
}), children: [_jsx(Col, { sizes: colSizes, className: b('content-col'), children: textContent && (_jsxs("div", { className: b('content-wrapper'), children: [_jsx(Content, { theme: "default", ...textContent, centered: direction === FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }), additionalContentNode && (_jsx("div", { className: b('additional-content', {
|
|
48
|
+
centered: direction === FormBlockDirection.Center,
|
|
49
|
+
}), children: additionalContentNode }))] })) }), _jsx(Col, { sizes: colSizes, className: b('form-col'), children: _jsx("div", { className: b('form-wrapper'), children: _jsx("div", { className: b('full-form', {
|
|
48
50
|
hidden: !contentLoaded,
|
|
49
51
|
}), children: customFormNode || (_jsxs(React.Fragment, { children: [title && (_jsx(Title, { title: {
|
|
50
52
|
text: title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sourceRoot":"../../../../src","sources":["blocks/Form/Form.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,kCAAyB;AACxD,OAAO,SAAS,gDAA6C;AAC7D,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,EAAC,4BAAmB;AAC1E,OAAO,EAAC,cAAc,EAAC,sCAAmC;AAE1D,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACnB,8BAAqB;AACtB,OAAO,EAAC,OAAO,EAAC,kCAAyB;AACzC,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAElD,OAAO,EAAC,gBAAg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CAAC,YAED,cAAc,IAAI,CACf,MAAC,KAAK,CAAC,QAAQ,eACV,KAAK,IAAI,CACN,KAAC,KAAK,IACF,KAAK,EAAE;oDACH,IAAI,EAAE,KAAK;oDACX,QAAQ,EAAE,GAAG;iDAChB,EACD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,EACzC,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAC,GACrB,CACL,EACD,KAAC,SAAS,IACN,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,GAC9B,IACW,CACpB,GACC,GACJ,GACJ,IACJ,GACH,IACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImage, Title} from '../../components';\nimport InnerForm from '../../components/InnerForm/InnerForm';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, GridAlignItems, GridColumnSize, Row} from '../../grid';\nimport {useDeviceValue} from '../../hooks/useDeviceValue';\nimport type {FormBlockProps} from '../../models';\nimport {\n FormBlockDataTypes,\n FormBlockDirection,\n isHubspotDataForm,\n isYandexDataForm,\n} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block, getThemedValue} from '../../utils';\n\nimport {hasBackgroundCSS} from './utils';\n\nimport './Form.scss';\n\nconst b = block('form-block');\n\nconst colSizes = {[GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12};\n\nconst Form = (props: FormBlockProps) => {\n const {\n formData,\n title,\n textContent,\n direction = FormBlockDirection.Center,\n background,\n customFormNode,\n additionalContentNode,\n } = props;\n const [contentLoaded, setContentLoaded] = React.useState(false);\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n\n const themedBackground = getThemedValue(background, theme) || undefined;\n const themedBackgroundStyle = useDeviceValue(themedBackground?.style) || undefined;\n\n const withBackground = Boolean(\n themedBackground &&\n (themedBackground.src ||\n themedBackground.desktop ||\n hasBackgroundCSS(themedBackgroundStyle ?? {})),\n );\n\n const onContentLoad = React.useCallback(() => {\n setContentLoaded(true);\n }, []);\n\n if (!formData && !customFormNode) {\n return null;\n }\n\n let formType;\n\n if (isYandexDataForm(formData)) {\n formType = FormBlockDataTypes.YANDEX;\n } else if (isHubspotDataForm(formData)) {\n formType = FormBlockDataTypes.HUBSPOT;\n }\n\n return (\n <div\n className={b({\n 'with-background': withBackground,\n 'form-type': formType,\n })}\n >\n {themedBackground && (\n <BackgroundImage\n {...themedBackground}\n style={themedBackgroundStyle}\n className={b('media')}\n imageClassName={b('image')}\n />\n )}\n <Grid>\n <Row\n alignItems={\n direction === FormBlockDirection.Center\n ? GridAlignItems.Center\n : GridAlignItems.Start\n }\n className={b('row', {\n direction,\n })}\n >\n <Col sizes={colSizes} className={b('content-col')}>\n {textContent && (\n <div className={b('content-wrapper')}>\n <Content\n theme=\"default\"\n {...textContent}\n centered={direction === FormBlockDirection.Center}\n colSizes={{all: 12}}\n className={b('content')}\n />\n {additionalContentNode && (\n <div\n className={b('additional-content', {\n centered: direction === FormBlockDirection.Center,\n })}\n >\n {additionalContentNode}\n </div>\n )}\n </div>\n )}\n </Col>\n <Col sizes={colSizes} className={b('form-col')}>\n <div className={b('form-wrapper')}>\n <div\n className={b('full-form', {\n hidden: !contentLoaded,\n })}\n >\n {customFormNode || (\n <React.Fragment>\n {title && (\n <Title\n title={{\n text: title,\n textSize: 's',\n }}\n className={b('title', {mobile: isMobile})}\n colSizes={{all: 12}}\n />\n )}\n <InnerForm\n className={b('form')}\n formData={formData}\n onContentLoad={onContentLoad}\n />\n </React.Fragment>\n )}\n </div>\n </div>\n </Col>\n </Row>\n </Grid>\n </div>\n );\n};\n\nexport default Form;\n"]}
|
|
@@ -242,17 +242,6 @@ export declare const FormBlock: {
|
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
244
|
};
|
|
245
|
-
labels: {
|
|
246
|
-
type: string;
|
|
247
|
-
items: {
|
|
248
|
-
type: string;
|
|
249
|
-
properties: {
|
|
250
|
-
when: {
|
|
251
|
-
type: string;
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
245
|
controlPosition: {
|
|
257
246
|
type: string;
|
|
258
247
|
enum: string[];
|
|
@@ -48,7 +48,10 @@ export const HeaderBlock = (props) => {
|
|
|
48
48
|
offset,
|
|
49
49
|
theme: textTheme,
|
|
50
50
|
'vertical-offset': curVerticalOffset,
|
|
51
|
-
}), children: _jsxs(Col, { sizes: titleSizes, className: b('content-inner', { centered }, contentInnerClassName), children: [overtitle && (_jsx("div", { className: b('overtitle'), children: typeof overtitle === 'string' ? (_jsx(YFMWrapper, { tagName: "div", className: b('overtitle'), content: overtitle, modifiers: {
|
|
51
|
+
}), children: _jsxs(Col, { sizes: titleSizes, className: b('content-inner', { centered }, contentInnerClassName), children: [overtitle && (_jsx("div", { className: b('overtitle'), children: typeof overtitle === 'string' ? (_jsx(YFMWrapper, { tagName: "div", className: b('overtitle'), content: overtitle, modifiers: {
|
|
52
|
+
constructor: true,
|
|
53
|
+
constructorTheme: textTheme,
|
|
54
|
+
} })) : (overtitle) })), _jsxs(YFMWrapper, { content: title, contentClassName: b('title'), className: b('title-container'), modifiers: { constructor: true, constructorTheme: textTheme }, tagName: "h1", contentPosition: "end", children: [status, renderTitle ? renderTitle(title) : null] }), description && (_jsx("div", { className: b('description', { theme: textTheme }), children: _jsx(YFMWrapper, { content: description, modifiers: {
|
|
52
55
|
constructor: true,
|
|
53
56
|
constructorTheme: textTheme,
|
|
54
57
|
} }) })), additionalInfo && (_jsx("div", { className: b('additional-info', { theme: textTheme }), children: _jsx(YFMWrapper, { content: additionalInfo, modifiers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";AAGA,OAAO,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ACJ,EACL,iBAAiB,IAAI,CAClB,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,EAAE,cAAc,CAAC,EAC7D,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,gBAAgB,EAAE,CAAC,CAAC,cAAc,CAAC,KAC/B,kBAAkB,GACxB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {Button, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\n\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype ElementsClassName = {\n gridClassName?: string;\n mediaClassName?: string;\n contentWrapperClassName?: string;\n contentInnerClassName?: string;\n};\n\nexport type HeaderBlockFullProps = HeaderBlockProps & ClassNameProps & ElementsClassName;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n videoIframe,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n gridClassName,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n centered,\n additionalInfo,\n mediaClassName,\n contentWrapperClassName,\n contentInnerClassName,\n } = props;\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n const theme = useTheme();\n const hasRightSideImage = Boolean((image || video || videoIframe) && !centered);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const {src: videoIframeSrc, ...videoIframeProps} = videoIframe ?? {};\n const mediaWithMicrodata = mergeVideoMicrodata(\n {video: videoThemed, image: imageThemed, videoIframe: videoIframeSrc, ...videoIframeProps},\n {name: title, description},\n );\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')} className={b(null, gridClassName)}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper', contentWrapperClassName)}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col\n sizes={titleSizes}\n className={b(\n 'content-inner',\n {centered},\n contentInnerClassName,\n )}\n >\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <YFMWrapper\n tagName=\"div\"\n className={b('overtitle')}\n content={overtitle}\n modifiers={{constructor: true}}\n />\n ) : (\n overtitle\n )}\n </div>\n )}\n <YFMWrapper\n content={title}\n contentClassName={b('title')}\n className={b('title-container')}\n modifiers={{constructor: true, constructorTheme: textTheme}}\n tagName=\"h1\"\n contentPosition=\"end\"\n >\n {status}\n {renderTitle ? renderTitle(title) : null}\n </YFMWrapper>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {additionalInfo && (\n <div className={b('additional-info', {theme: textTheme})}>\n <YFMWrapper\n content={additionalInfo}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true}, mediaClassName)}\n videoClassName={b('video')}\n imageClassName={b('image')}\n youtubeClassName={b('video-iframe')}\n {...mediaWithMicrodata}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC,kCAAyB;AAC3D,OAAO,iBAAiB,gEAA6D;AACrF,OAAO,EAAC,aAAa,EAAC,8CAA2C;AACjE,OAAO,UAAU,kDAA+C;AAChE,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,cAAc,EAAC,kDAAyC;AAChE,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,4BAAmB;AAE1C,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAE1D,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAC,mBAAgB;AAEzE,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAgBhC,MAAM,UAAU,GAAG,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,M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,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,CAAC,GAAG,YACxB,KAAC,MAAM,IAEH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,IAAI,EAAC,IAAI,EACT,UAAU,EAAE;gEACR,kBAAkB,EAAE,OAAO;gEAC3B,GAAG,MAAM,CAAC,UAAU;6DACvB,KACG,MAAM,IAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,EAAE,cAAc,CAAC,EAC7D,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,gBAAgB,EAAE,CAAC,CAAC,cAAc,CAAC,KAC/B,kBAAkB,GACxB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {Button, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\n\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype ElementsClassName = {\n gridClassName?: string;\n mediaClassName?: string;\n contentWrapperClassName?: string;\n contentInnerClassName?: string;\n};\n\nexport type HeaderBlockFullProps = HeaderBlockProps & ClassNameProps & ElementsClassName;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n videoIframe,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n gridClassName,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n centered,\n additionalInfo,\n mediaClassName,\n contentWrapperClassName,\n contentInnerClassName,\n } = props;\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n const theme = useTheme();\n const hasRightSideImage = Boolean((image || video || videoIframe) && !centered);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const {src: videoIframeSrc, ...videoIframeProps} = videoIframe ?? {};\n const mediaWithMicrodata = mergeVideoMicrodata(\n {video: videoThemed, image: imageThemed, videoIframe: videoIframeSrc, ...videoIframeProps},\n {name: title, description},\n );\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')} className={b(null, gridClassName)}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper', contentWrapperClassName)}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col\n sizes={titleSizes}\n className={b(\n 'content-inner',\n {centered},\n contentInnerClassName,\n )}\n >\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <YFMWrapper\n tagName=\"div\"\n className={b('overtitle')}\n content={overtitle}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n ) : (\n overtitle\n )}\n </div>\n )}\n <YFMWrapper\n content={title}\n contentClassName={b('title')}\n className={b('title-container')}\n modifiers={{constructor: true, constructorTheme: textTheme}}\n tagName=\"h1\"\n contentPosition=\"end\"\n >\n {status}\n {renderTitle ? renderTitle(title) : null}\n </YFMWrapper>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {additionalInfo && (\n <div className={b('additional-info', {theme: textTheme})}>\n <YFMWrapper\n content={additionalInfo}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true}, mediaClassName)}\n videoClassName={b('video')}\n imageClassName={b('image')}\n youtubeClassName={b('video-iframe')}\n {...mediaWithMicrodata}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
|
|
@@ -213,17 +213,6 @@ export declare const InfoBlock: {
|
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
labels: {
|
|
217
|
-
type: string;
|
|
218
|
-
items: {
|
|
219
|
-
type: string;
|
|
220
|
-
properties: {
|
|
221
|
-
when: {
|
|
222
|
-
type: string;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
216
|
controlPosition: {
|
|
228
217
|
type: string;
|
|
229
218
|
enum: string[];
|
|
@@ -393,17 +382,6 @@ export declare const InfoBlock: {
|
|
|
393
382
|
};
|
|
394
383
|
};
|
|
395
384
|
};
|
|
396
|
-
labels: {
|
|
397
|
-
type: string;
|
|
398
|
-
items: {
|
|
399
|
-
type: string;
|
|
400
|
-
properties: {
|
|
401
|
-
when: {
|
|
402
|
-
type: string;
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
385
|
controlPosition: {
|
|
408
386
|
type: string;
|
|
409
387
|
enum: string[];
|
|
@@ -499,17 +499,6 @@ export declare const MapBlock: {
|
|
|
499
499
|
type: string;
|
|
500
500
|
enum: string[];
|
|
501
501
|
};
|
|
502
|
-
labels: {
|
|
503
|
-
type: string;
|
|
504
|
-
items: {
|
|
505
|
-
type: string;
|
|
506
|
-
properties: {
|
|
507
|
-
when: {
|
|
508
|
-
type: string;
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
|
-
};
|
|
512
|
-
};
|
|
513
502
|
additionalInfo: {
|
|
514
503
|
type: string;
|
|
515
504
|
contentType: string;
|
|
@@ -615,17 +615,6 @@ export declare const MediaBlockBaseProps: {
|
|
|
615
615
|
type: string;
|
|
616
616
|
enum: string[];
|
|
617
617
|
};
|
|
618
|
-
labels: {
|
|
619
|
-
type: string;
|
|
620
|
-
items: {
|
|
621
|
-
type: string;
|
|
622
|
-
properties: {
|
|
623
|
-
when: {
|
|
624
|
-
type: string;
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
};
|
|
629
618
|
additionalInfo: {
|
|
630
619
|
type: string;
|
|
631
620
|
contentType: string;
|
|
@@ -1345,17 +1334,6 @@ export declare const MediaBlock: {
|
|
|
1345
1334
|
type: string;
|
|
1346
1335
|
enum: string[];
|
|
1347
1336
|
};
|
|
1348
|
-
labels: {
|
|
1349
|
-
type: string;
|
|
1350
|
-
items: {
|
|
1351
|
-
type: string;
|
|
1352
|
-
properties: {
|
|
1353
|
-
when: {
|
|
1354
|
-
type: string;
|
|
1355
|
-
};
|
|
1356
|
-
};
|
|
1357
|
-
};
|
|
1358
|
-
};
|
|
1359
1337
|
additionalInfo: {
|
|
1360
1338
|
type: string;
|
|
1361
1339
|
contentType: string;
|
|
@@ -129,17 +129,6 @@ export declare const QuestionsBlock: {
|
|
|
129
129
|
contentType: string;
|
|
130
130
|
inputType: string;
|
|
131
131
|
};
|
|
132
|
-
labels: {
|
|
133
|
-
type: string;
|
|
134
|
-
items: {
|
|
135
|
-
type: string;
|
|
136
|
-
properties: {
|
|
137
|
-
when: {
|
|
138
|
-
type: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
132
|
additionalInfo: {
|
|
144
133
|
type: string;
|
|
145
134
|
contentType: string;
|
|
@@ -649,17 +649,6 @@ export declare const tabsItem: {
|
|
|
649
649
|
};
|
|
650
650
|
};
|
|
651
651
|
} | undefined;
|
|
652
|
-
labels?: {
|
|
653
|
-
type: string;
|
|
654
|
-
items: {
|
|
655
|
-
type: string;
|
|
656
|
-
properties: {
|
|
657
|
-
when: {
|
|
658
|
-
type: string;
|
|
659
|
-
};
|
|
660
|
-
};
|
|
661
|
-
};
|
|
662
|
-
} | undefined;
|
|
663
652
|
controlPosition?: {
|
|
664
653
|
type: string;
|
|
665
654
|
enum: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buttons.js","sourceRoot":"../../../../src","sources":["components/Buttons/Buttons.tsx"],"names":[],"mappings":";;AACA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,MAAM,4BAAyB;AAEtC,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAW3B,SAAS,aAAa,CAAC,IAAiB;IACpC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,GAAG,CAAC;QACf,KAAK,GAAG,CAAC;QACT;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAe,EAAE,EAAE,CACtF,OAAO,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,aAAW,EAAE,YAC5C,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,eAAC,MAAM,IACH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KAClB,IAAI,EACR,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EACzB,EAAE,EAAE,QAAQ,EACZ,UAAU,EAAE;YACR,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;YACvD,GAAG,IAAI,CAAC,UAAU;SACrB,GACH,CACL,CAAC,GACA,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;AAEb,eAAe,OAAO,CAAC","sourcesContent":["import {ButtonProps, ContentSize} from '../../models';\nimport {block} from '../../utils';\nimport Button from '../Button/Button';\n\nimport './Buttons.scss';\n\nconst b = block('buttons');\n\ntype ButtonsProps = {\n className?: string;\n buttons?: ButtonProps[];\n size?: ContentSize;\n titleId?: string;\n qa?: string;\n buttonQa?: string;\n};\n\nfunction getButtonSize(size: ContentSize) {\n switch (size) {\n case 's':\n return 'm';\n case 'l':\n default:\n return 'xl';\n }\n}\n\nconst Buttons = ({className, titleId, buttons, size = 's', qa, buttonQa}: ButtonsProps) =>\n buttons ? (\n <div className={b({size}, className)} data-qa={qa}>\n {buttons.map((item) => (\n <Button\n className={b('button')}\n {...item}\n key={item.url}\n size={getButtonSize(size)}\n qa={buttonQa}\n extraProps={{\n 'aria-describedby': item.urlTitle ? undefined : titleId,\n ...item.extraProps,\n }}\n />\n ))}\n </div>\n ) : null;\n\nexport default Buttons;\n"]}
|
|
1
|
+
{"version":3,"file":"Buttons.js","sourceRoot":"../../../../src","sources":["components/Buttons/Buttons.tsx"],"names":[],"mappings":";;AACA,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,MAAM,4BAAyB;AAEtC,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAW3B,SAAS,aAAa,CAAC,IAAiB;IACpC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,GAAG,CAAC;QACf,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;QACV;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAe,EAAE,EAAE,CACtF,OAAO,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,aAAW,EAAE,YAC5C,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,eAAC,MAAM,IACH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KAClB,IAAI,EACR,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EACzB,EAAE,EAAE,QAAQ,EACZ,UAAU,EAAE;YACR,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;YACvD,GAAG,IAAI,CAAC,UAAU;SACrB,GACH,CACL,CAAC,GACA,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;AAEb,eAAe,OAAO,CAAC","sourcesContent":["import {ButtonProps, ContentSize} from '../../models';\nimport {block} from '../../utils';\nimport Button from '../Button/Button';\n\nimport './Buttons.scss';\n\nconst b = block('buttons');\n\ntype ButtonsProps = {\n className?: string;\n buttons?: ButtonProps[];\n size?: ContentSize;\n titleId?: string;\n qa?: string;\n buttonQa?: string;\n};\n\nfunction getButtonSize(size: ContentSize) {\n switch (size) {\n case 's':\n return 'm';\n case 'm':\n case 'l':\n case 'xl':\n default:\n return 'xl';\n }\n}\n\nconst Buttons = ({className, titleId, buttons, size = 's', qa, buttonQa}: ButtonsProps) =>\n buttons ? (\n <div className={b({size}, className)} data-qa={qa}>\n {buttons.map((item) => (\n <Button\n className={b('button')}\n {...item}\n key={item.url}\n size={getButtonSize(size)}\n qa={buttonQa}\n extraProps={{\n 'aria-describedby': item.urlTitle ? undefined : titleId,\n ...item.extraProps,\n }}\n />\n ))}\n </div>\n ) : null;\n\nexport default Buttons;\n"]}
|
|
@@ -1,38 +1,38 @@
|
|
|
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, .pc-content-list_size_m {
|
|
3
|
+
.pc-content-list_size_xl, .pc-content-list_size_l, .pc-content-list_size_m {
|
|
4
4
|
max-width: 480px;
|
|
5
5
|
}
|
|
6
|
-
.pc-content-list_size_l .pc-content-list__title, .pc-content-list_size_m .pc-content-list__title {
|
|
6
|
+
.pc-content-list_size_xl .pc-content-list__title, .pc-content-list_size_l .pc-content-list__title, .pc-content-list_size_m .pc-content-list__title {
|
|
7
7
|
font-size: var(--g-text-header-1-font-size);
|
|
8
8
|
line-height: var(--g-text-header-1-line-height);
|
|
9
9
|
margin: 0 0 8px;
|
|
10
10
|
}
|
|
11
|
-
.pc-content-list_size_l .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__icon {
|
|
11
|
+
.pc-content-list_size_xl .pc-content-list__icon, .pc-content-list_size_l .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__icon {
|
|
12
12
|
width: 22px;
|
|
13
13
|
height: 22px;
|
|
14
14
|
margin-top: 1px;
|
|
15
15
|
margin-bottom: 1px;
|
|
16
16
|
margin-right: 12px;
|
|
17
17
|
}
|
|
18
|
-
.pc-content-list_size_l .pc-content-list__item:not(:last-child), .pc-content-list_size_m .pc-content-list__item:not(:last-child) {
|
|
18
|
+
.pc-content-list_size_xl .pc-content-list__item:not(:last-child), .pc-content-list_size_l .pc-content-list__item:not(:last-child), .pc-content-list_size_m .pc-content-list__item:not(:last-child) {
|
|
19
19
|
margin-bottom: 16px;
|
|
20
20
|
}
|
|
21
|
-
.pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_m .pc-content-list__item_without-title:not(:last-child) {
|
|
21
|
+
.pc-content-list_size_xl .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_m .pc-content-list__item_without-title:not(:last-child) {
|
|
22
22
|
margin-bottom: 12px;
|
|
23
23
|
}
|
|
24
|
-
.pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__item_without-title .pc-content-list__icon {
|
|
24
|
+
.pc-content-list_size_xl .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__item_without-title .pc-content-list__icon {
|
|
25
25
|
width: 20px;
|
|
26
26
|
height: 20px;
|
|
27
27
|
margin-top: 2px;
|
|
28
28
|
margin-bottom: 2px;
|
|
29
29
|
margin-right: 8px;
|
|
30
30
|
}
|
|
31
|
-
.pc-content-list_size_l .pc-content-list__text, .pc-content-list_size_m .pc-content-list__text {
|
|
31
|
+
.pc-content-list_size_xl .pc-content-list__text, .pc-content-list_size_l .pc-content-list__text, .pc-content-list_size_m .pc-content-list__text {
|
|
32
32
|
font-size: var(--g-text-subheader-2-font-size);
|
|
33
33
|
line-height: var(--g-text-subheader-2-line-height);
|
|
34
34
|
}
|
|
35
|
-
.pc-content-list_size_l .pc-content-list__text_without-title, .pc-content-list_size_m .pc-content-list__text_without-title {
|
|
35
|
+
.pc-content-list_size_xl .pc-content-list__text_without-title, .pc-content-list_size_l .pc-content-list__text_without-title, .pc-content-list_size_m .pc-content-list__text_without-title {
|
|
36
36
|
font-size: var(--g-text-subheader-3-font-size);
|
|
37
37
|
line-height: var(--g-text-subheader-3-line-height);
|
|
38
38
|
}
|
|
@@ -1 +1 @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AE,YAAY,CAAC,KAAK,EACtB,WAAW,EAAE,WAAW,GAC1B,EACF,0BACK,KAAK;gCACF,KAAK,CAAC,aAAa,CACf,eAAe,CAAC,IAAI,CAAC,EACrB,EAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,EAAC,EACtD,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,GAAI,CACjE,EACJ,IAAI,IAAI,CACL,KAAC,UAAU,IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,MAAM,EAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport ContentIcon from '../ContentIcon/ContentIcon';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ContentIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
|
|
1
|
+
{"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,eAAe,EAAC,8BAA2B;AACnD,OAAO,WAAW,sCAAmC;AACrD,OAAO,UAAU,oCAAiC;AAElD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;QACV;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,KAAK,EAA6B,EAAE,EAAE;IAC9E,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,aAAW,EAAE,YACxC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC;YAC9C,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,aAChD,KAAC,WAAW,IACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,EAAE,EAAE,YAAY,CAAC,KAAK,EACtB,WAAW,EAAE,WAAW,GAC1B,EACF,0BACK,KAAK;gCACF,KAAK,CAAC,aAAa,CACf,eAAe,CAAC,IAAI,CAAC,EACrB,EAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,EAAC,EACtD,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,GAAI,CACjE,EACJ,IAAI,IAAI,CACL,KAAC,UAAU,IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,MAAM,EAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport ContentIcon from '../ContentIcon/ContentIcon';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'm':\n case 'l':\n case 'xl':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ContentIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
|