@gravity-ui/page-constructor 7.5.0 → 7.6.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.
Files changed (25) hide show
  1. package/build/cjs/components/IconWrapper/IconWrapper.css +13 -1
  2. package/build/cjs/components/IconWrapper/IconWrapper.js +2 -2
  3. package/build/cjs/components/IconWrapper/IconWrapper.js.map +1 -1
  4. package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -2
  5. package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
  6. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
  7. package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
  8. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +2 -2
  9. package/build/cjs/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  10. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -2
  11. package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
  12. package/build/esm/components/IconWrapper/IconWrapper.css +13 -1
  13. package/build/esm/components/IconWrapper/IconWrapper.js +2 -2
  14. package/build/esm/components/IconWrapper/IconWrapper.js.map +1 -1
  15. package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -2
  16. package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
  17. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -2
  18. package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
  19. package/build/esm/sub-blocks/BasicCard/BasicCard.js +2 -2
  20. package/build/esm/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  21. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +2 -2
  22. package/build/esm/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
  23. package/package.json +1 -1
  24. package/server/models/constructor-items/sub-blocks.d.ts +3 -2
  25. package/widget/index.js +1 -1
@@ -20,7 +20,19 @@ unpredictable css rules order in build */
20
20
  .pc-icon-wrapper__icon_icon-position_left {
21
21
  height: 22px;
22
22
  width: 22px;
23
- margin: 1px 12px 1px 0px;
23
+ margin: 1px 12px 1px 0;
24
+ }
25
+ .pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_m {
26
+ height: 28px;
27
+ width: 28px;
28
+ margin-bottom: 4px;
29
+ margin-top: 4px;
30
+ }
31
+ .pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_l {
32
+ height: 30px;
33
+ width: 30px;
34
+ margin-bottom: 4px;
35
+ margin-top: 4px;
24
36
  }
25
37
  .pc-icon-wrapper__content {
26
38
  display: flex;
@@ -8,13 +8,13 @@ const Image_1 = tslib_1.__importDefault(require("../Image/Image.js"));
8
8
  const utils_2 = require("../Media/Image/utils.js");
9
9
  const b = (0, utils_1.block)('icon-wrapper');
10
10
  const IconWrapper = (props) => {
11
- const { icon, children, className } = props;
11
+ const { icon, children, className, size } = props;
12
12
  if (!icon) {
13
13
  return (0, jsx_runtime_1.jsx)(React.Fragment, { children: children });
14
14
  }
15
15
  const iconProps = (0, utils_2.getMediaImage)(icon.value);
16
16
  const iconPosition = icon?.position;
17
- return ((0, jsx_runtime_1.jsxs)("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && ((0, jsx_runtime_1.jsx)(Image_1.default, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition }) })), (0, jsx_runtime_1.jsx)("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
17
+ return ((0, jsx_runtime_1.jsxs)("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && ((0, jsx_runtime_1.jsx)(Image_1.default, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition, size }) })), (0, jsx_runtime_1.jsx)("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
18
18
  };
19
19
  exports.default = IconWrapper;
20
20
  //# sourceMappingURL=IconWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAG/B,gDAAkC;AAClC,sEAAmC;AACnC,mDAAmD;AAInD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAC,GAAG,KAAK,CAAC;IAC1C,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,uBAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,OAAO,CACH,iCAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,EAAE,SAAS,CAAC,aAC1D,SAAS,IAAI,CACV,uBAAC,eAAK,OACE,SAAS,EACb,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,GACzD,CACL,EACD,gCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC/E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './IconWrapper.scss';\n\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className} = props;\n if (!icon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconProps = getMediaImage(icon.value);\n const iconPosition = icon?.position;\n\n return (\n <div className={b({['icon-position']: iconPosition}, className)}>\n {iconProps && (\n <Image\n {...iconProps}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: iconPosition})}\n />\n )}\n <div className={b('content', {['icon-position']: iconPosition})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
1
+ {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAG/B,gDAAkC;AAClC,sEAAmC;AACnC,mDAAmD;AAInD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,uBAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,OAAO,CACH,iCAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,EAAE,SAAS,CAAC,aAC1D,SAAS,IAAI,CACV,uBAAC,eAAK,OACE,SAAS,EACb,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC,GAC/D,CACL,EACD,gCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC/E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './IconWrapper.scss';\n\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className, size} = props;\n if (!icon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconProps = getMediaImage(icon.value);\n const iconPosition = icon?.position;\n\n return (\n <div className={b({['icon-position']: iconPosition}, className)}>\n {iconProps && (\n <Image\n {...iconProps}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: iconPosition, size})}\n />\n )}\n <div className={b('content', {['icon-position']: iconPosition})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
@@ -35,6 +35,7 @@ export interface PositionedIcon {
35
35
  }
36
36
  export interface IconWrapperProps {
37
37
  icon?: PositionedIcon;
38
+ size?: 's' | 'm' | 'l';
38
39
  }
39
40
  export declare enum ImageCardDirection {
40
41
  Direct = "direct",
@@ -104,7 +105,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
104
105
  paddingBottom?: 's' | 'm' | 'l' | 'xl';
105
106
  backgroundColor?: string;
106
107
  }
107
- export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {
108
+ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {
108
109
  url: string;
109
110
  urlTitle?: string;
110
111
  icon?: ThemeSupporting<ImageProps>;
@@ -136,7 +137,7 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
136
137
  list?: string[];
137
138
  }
138
139
  export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
139
- content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
140
+ content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;
140
141
  contentMargin?: LayoutItemContentMargin;
141
142
  media?: ThemeSupporting<MediaProps>;
142
143
  metaInfo?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":";;;AA8BA,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,4BAAZ,YAAY,QAoBvB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAWD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
1
+ {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":";;;AA8BA,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,4BAAZ,YAAY,QAoBvB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAYD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
@@ -9,13 +9,13 @@ const utils_1 = require("../../utils/index.js");
9
9
  const Content_1 = tslib_1.__importDefault(require("../Content/Content.js"));
10
10
  const b = (0, utils_1.block)('background-card');
11
11
  const BackgroundCard = (props) => {
12
- const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, } = props;
12
+ const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, size = 's', } = props;
13
13
  const titleId = (0, uikit_1.useUniqId)();
14
14
  const theme = (0, theme_1.useTheme)();
15
15
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
16
16
  const borderType = hasBackgroundColor ? 'none' : border;
17
17
  const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
18
- return ((0, jsx_runtime_1.jsx)(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: (0, jsx_runtime_1.jsxs)(components_1.CardBase.Content, { children: [(0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { className: b('image'), ...(0, utils_1.getThemedValue)(background, theme), style: { backgroundColor } }), (0, jsx_runtime_1.jsx)(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, list: list, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' })] }) }));
18
+ return ((0, jsx_runtime_1.jsx)(components_1.CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: (0, jsx_runtime_1.jsxs)(components_1.CardBase.Content, { children: [(0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { className: b('image'), ...(0, utils_1.getThemedValue)(background, theme), style: { backgroundColor } }), (0, jsx_runtime_1.jsx)(Content_1.default, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: size, theme: cardTheme, links: links, buttons: buttons, list: list, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' })] }) }));
19
19
  };
20
20
  exports.default = BackgroundCard;
21
21
  //# sourceMappingURL=BackgroundCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/BackgroundCard.tsx"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAE5C,0DAA4D;AAC5D,wDAA6C;AAE7C,gDAAkD;AAClD,4EAAyC;AAIzC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,iBAAiB,CAAC,CAAC;AAEnC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAClD,MAAM,EACF,GAAG,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,UAAU,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,KAAK,EACL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,eAAe,GAAG,SAAS,EAC3B,IAAI,GACP,GAAG,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE5B,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,MAAM,kBAAkB,GAAG,eAAe,IAAI,SAAS,KAAK,SAAS,CAAC;IACtE,MAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,mBAAmB,GAAG,CAAC,aAAa,IAAI,eAAe,KAAK,QAAQ,CAAC;IAE3E,OAAO,CACH,uBAAC,qBAAQ,IACL,SAAS,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,EACxD,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,EAC9B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,YAElB,wBAAC,qBAAQ,CAAC,OAAO,eACb,uBAAC,4BAAe,IACZ,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KACjB,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,CAAC,EACrC,KAAK,EAAE,EAAC,eAAe,EAAC,GAC1B,EACF,uBAAC,iBAAO,IACJ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,IACa,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {BackgroundImage, CardBase} from '../../components/';\nimport {useTheme} from '../../context/theme';\nimport {BackgroundCardProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BackgroundCard.scss';\n\nconst b = block('background-card');\n\nconst BackgroundCard = (props: BackgroundCardProps) => {\n const {\n url,\n title,\n text,\n border,\n background,\n paddingBottom,\n backgroundColor,\n additionalInfo,\n theme: cardTheme = 'default',\n links,\n buttons,\n analyticsEvents,\n urlTitle,\n controlPosition = 'content',\n list,\n } = props;\n\n const titleId = useUniqId();\n\n const theme = useTheme();\n const hasBackgroundColor = backgroundColor || cardTheme !== 'default';\n const borderType = hasBackgroundColor ? 'none' : border;\n const areControlsInFooter = !paddingBottom && controlPosition === 'footer';\n\n return (\n <CardBase\n className={b({padding: paddingBottom, theme: cardTheme})}\n contentClassName={b('content')}\n url={url}\n border={borderType}\n analyticsEvents={analyticsEvents}\n urlTitle={urlTitle}\n >\n <CardBase.Content>\n <BackgroundImage\n className={b('image')}\n {...getThemedValue(background, theme)}\n style={{backgroundColor}}\n />\n <Content\n titleId={titleId}\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n size=\"s\"\n theme={cardTheme}\n links={links}\n buttons={buttons}\n list={list}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BackgroundCard;\n"]}
1
+ {"version":3,"file":"BackgroundCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/BackgroundCard.tsx"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAE5C,0DAA4D;AAC5D,wDAA6C;AAE7C,gDAAkD;AAClD,4EAAyC;AAIzC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,iBAAiB,CAAC,CAAC;AAEnC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAClD,MAAM,EACF,GAAG,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,UAAU,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,KAAK,EACL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,eAAe,GAAG,SAAS,EAC3B,IAAI,EACJ,IAAI,GAAG,GAAG,GACb,GAAG,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE5B,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,MAAM,kBAAkB,GAAG,eAAe,IAAI,SAAS,KAAK,SAAS,CAAC;IACtE,MAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,mBAAmB,GAAG,CAAC,aAAa,IAAI,eAAe,KAAK,QAAQ,CAAC;IAE3E,OAAO,CACH,uBAAC,qBAAQ,IACL,SAAS,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,EACxD,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,EAC9B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,YAElB,wBAAC,qBAAQ,CAAC,OAAO,eACb,uBAAC,4BAAe,IACZ,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KACjB,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,CAAC,EACrC,KAAK,EAAE,EAAC,eAAe,EAAC,GAC1B,EACF,uBAAC,iBAAO,IACJ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,IACa,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {BackgroundImage, CardBase} from '../../components/';\nimport {useTheme} from '../../context/theme';\nimport {BackgroundCardProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BackgroundCard.scss';\n\nconst b = block('background-card');\n\nconst BackgroundCard = (props: BackgroundCardProps) => {\n const {\n url,\n title,\n text,\n border,\n background,\n paddingBottom,\n backgroundColor,\n additionalInfo,\n theme: cardTheme = 'default',\n links,\n buttons,\n analyticsEvents,\n urlTitle,\n controlPosition = 'content',\n list,\n size = 's',\n } = props;\n\n const titleId = useUniqId();\n\n const theme = useTheme();\n const hasBackgroundColor = backgroundColor || cardTheme !== 'default';\n const borderType = hasBackgroundColor ? 'none' : border;\n const areControlsInFooter = !paddingBottom && controlPosition === 'footer';\n\n return (\n <CardBase\n className={b({padding: paddingBottom, theme: cardTheme})}\n contentClassName={b('content')}\n url={url}\n border={borderType}\n analyticsEvents={analyticsEvents}\n urlTitle={urlTitle}\n >\n <CardBase.Content>\n <BackgroundImage\n className={b('image')}\n {...getThemedValue(background, theme)}\n style={{backgroundColor}}\n />\n <Content\n titleId={titleId}\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n size={size}\n theme={cardTheme}\n links={links}\n buttons={buttons}\n list={list}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BackgroundCard;\n"]}
@@ -10,13 +10,13 @@ const utils_1 = require("../../utils/index.js");
10
10
  const Content_1 = tslib_1.__importDefault(require("../Content/Content.js"));
11
11
  const b = (0, utils_1.block)('basic-card');
12
12
  const BasicCard = (props) => {
13
- const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content', ...cardParams } = props;
13
+ const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content', size = 's', ...cardParams } = props;
14
14
  const titleId = (0, uikit_1.useUniqId)();
15
15
  const descriptionId = (0, uikit_1.useUniqId)();
16
16
  const areControlsInFooter = controlPosition === 'footer';
17
17
  const theme = (0, theme_1.useTheme)();
18
18
  const themedIcon = (0, utils_1.getThemedValue)(icon, theme);
19
- return ((0, jsx_runtime_1.jsx)(components_1.CardBase, { className: b(), contentClassName: b('content'), ...cardParams, extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId }, children: (0, jsx_runtime_1.jsx)(components_1.CardBase.Content, { children: (0, jsx_runtime_1.jsx)(components_1.IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, className: b('wrapper'), children: (0, jsx_runtime_1.jsx)(Content_1.default, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' }) }) }) }));
19
+ return ((0, jsx_runtime_1.jsx)(components_1.CardBase, { className: b(), contentClassName: b('content'), ...cardParams, extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId }, children: (0, jsx_runtime_1.jsx)(components_1.CardBase.Content, { children: (0, jsx_runtime_1.jsx)(components_1.IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, className: b('wrapper'), size: size, children: (0, jsx_runtime_1.jsx)(Content_1.default, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: size, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' }) }) }) }));
20
20
  };
21
21
  exports.default = BasicCard;
22
22
  //# sourceMappingURL=BasicCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAE5C,0DAAuD;AACvD,wDAA6C;AAE7C,6EAAuE;AACvE,gDAAkD;AAClD,4EAAyC;AAIzC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,yBAAY,CAAC,GAAG,EAC/B,eAAe,GAAG,SAAS,EAC3B,GAAG,UAAU,EA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'../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{'aria-describedby': descriptionId, 'aria-labelledby': titleId}}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n className={b('wrapper')}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size=\"s\"\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
1
+ {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAE5C,0DAAuD;AACvD,wDAA6C;AAE7C,6EAAuE;AACvE,gDAAkD;AAClD,4EAAyC;AAIzC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,yBAAY,CAAC,GAAG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C,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {CardBase, IconWrapper} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n size = 's',\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{'aria-describedby': descriptionId, 'aria-labelledby': titleId}}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n className={b('wrapper')}\n size={size}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size={size}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
@@ -20,7 +20,7 @@ const LayoutItem = ({ content: { links, ...content }, contentMargin = 'm', metaI
20
20
  controlPosition: areControlsInFooter ? 'bottom' : 'default',
21
21
  ...content,
22
22
  links: normalizedLinks,
23
- size: 's',
23
+ size: content.size || 's',
24
24
  colSizes: { all: 12, md: 12 },
25
25
  };
26
26
  const titleId = (0, uikit_1.useUniqId)();
@@ -36,7 +36,7 @@ const LayoutItem = ({ content: { links, ...content }, contentMargin = 'm', metaI
36
36
  });
37
37
  return fullscreen && (0, utils_2.hasFullscreen)(themedMedia) ? ((0, jsx_runtime_1.jsx)(components_1.FullscreenMedia, { showFullscreenIcon: (0, utils_2.showFullscreenIcon)(themedMedia), children: ({ className: mediaClassName, fullscreen: _fullscreen, ...fullscreenMediaProps } = {}) => ((0, jsx_runtime_1.jsx)(components_1.Media, { ...mediaWithMicrodata, ...fullscreenMediaProps, className: b('media', { border }, mediaClassName), analyticsEvents: analyticsEvents })) })) : ((0, jsx_runtime_1.jsx)(components_1.Media, { ...themedMedia, className: b('media', { border }), analyticsEvents: analyticsEvents }));
38
38
  };
39
- return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), children: [renderMedia(), metaInfo && (0, jsx_runtime_1.jsx)(components_1.MetaInfo, { items: metaInfo, className: b('meta-info') }), (0, jsx_runtime_1.jsx)("div", { className: b('content', { 'no-media': !media, margin: contentMargin }), children: (0, jsx_runtime_1.jsx)(components_1.IconWrapper, { icon: themedIcon, className: b('wrapper'), children: (0, jsx_runtime_1.jsx)(Content_1.default, { ...contentProps, titleId: titleId }) }) })] }));
39
+ return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), children: [renderMedia(), metaInfo && (0, jsx_runtime_1.jsx)(components_1.MetaInfo, { items: metaInfo, className: b('meta-info') }), (0, jsx_runtime_1.jsx)("div", { className: b('content', { 'no-media': !media, margin: contentMargin }), children: (0, jsx_runtime_1.jsx)(components_1.IconWrapper, { icon: themedIcon, className: b('wrapper'), size: contentProps.size, children: (0, jsx_runtime_1.jsx)(Content_1.default, { ...contentProps, titleId: titleId }) }) })] }));
40
40
  };
41
41
  exports.default = LayoutItem;
42
42
  //# sourceMappingURL=LayoutItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutItem.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/LayoutItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,6CAA4C;AAE5C,0DAA+E;AAC/E,wDAA6C;AAE7C,gDAAkD;AAClD,wDAA0D;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,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenMedia, IconWrapper, Media, MetaInfo} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {ContentBlockProps, LayoutItemProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\nimport Content from '../Content/Content';\n\nimport {getLayoutItemLinks, hasFullscreen, showFullscreenIcon} from './utils';\n\nimport './LayoutItem.scss';\n\nconst b = block('layout-item');\n\nconst LayoutItem = ({\n content: {links, ...content},\n contentMargin = 'm',\n metaInfo,\n media,\n border,\n fullscreen,\n icon,\n className,\n analyticsEvents,\n controlPosition = 'content',\n}: LayoutItemProps) => {\n const normalizedLinks = React.useMemo(() => getLayoutItemLinks(links), [links]);\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n const contentProps: ContentBlockProps = {\n controlPosition: areControlsInFooter ? 'bottom' : 'default',\n ...content,\n links: normalizedLinks,\n size: 's',\n colSizes: {all: 12, md: 12},\n };\n const titleId = useUniqId();\n const renderMedia = () => {\n if (!media) {\n return null;\n }\n const themedMedia = getThemedValue(media, theme);\n const {title} = content;\n const mediaWithMicrodata = mergeVideoMicrodata(themedMedia, {\n name: typeof title === 'string' ? title : title?.text,\n description: content.text,\n });\n\n return fullscreen && hasFullscreen(themedMedia) ? (\n <FullscreenMedia showFullscreenIcon={showFullscreenIcon(themedMedia)}>\n {({\n className: mediaClassName,\n fullscreen: _fullscreen,\n ...fullscreenMediaProps\n } = {}) => (\n <Media\n {...mediaWithMicrodata}\n {...fullscreenMediaProps}\n className={b('media', {border}, mediaClassName)}\n analyticsEvents={analyticsEvents}\n />\n )}\n </FullscreenMedia>\n ) : (\n <Media\n {...themedMedia}\n className={b('media', {border})}\n analyticsEvents={analyticsEvents}\n />\n );\n };\n return (\n <div className={b(null, className)}>\n {renderMedia()}\n {metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}\n <div className={b('content', {'no-media': !media, margin: contentMargin})}>\n <IconWrapper icon={themedIcon} className={b('wrapper')}>\n <Content {...contentProps} titleId={titleId} />\n </IconWrapper>\n </div>\n </div>\n );\n};\n\nexport default LayoutItem;\n"]}
1
+ {"version":3,"file":"LayoutItem.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/LayoutItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,6CAA4C;AAE5C,0DAA+E;AAC/E,wDAA6C;AAE7C,gDAAkD;AAClD,wDAA0D;AAC1D,4EAAyC;AAEzC,sCAA8E;AAI9E,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,aAAa,CAAC,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,EAChB,OAAO,EAAE,EAAC,KAAK,EAAE,GAAG,OAAO,EAAC,EAC5B,aAAa,GAAG,GAAG,EACnB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,SAAS,EACT,eAAe,EACf,eAAe,GAAG,SAAS,GACb,EAAE,EAAE;IAClB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,MAAM,mBAAmB,GAAG,eAAe,KAAK,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE/C,MAAM,YAAY,GAAsB;QACpC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAC3D,GAAG,OAAO;QACV,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI,IA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AE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,aAC7B,WAAW,EAAE,EACb,QAAQ,IAAI,uBAAC,qBAAQ,IAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,GAAI,EACrE,gCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAC,CAAC,YACrE,uBAAC,wBAAW,IAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,YAC3E,uBAAC,iBAAO,OAAK,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,GACrC,GACZ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenMedia, IconWrapper, Media, MetaInfo} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {ContentBlockProps, LayoutItemProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\nimport Content from '../Content/Content';\n\nimport {getLayoutItemLinks, hasFullscreen, showFullscreenIcon} from './utils';\n\nimport './LayoutItem.scss';\n\nconst b = block('layout-item');\n\nconst LayoutItem = ({\n content: {links, ...content},\n contentMargin = 'm',\n metaInfo,\n media,\n border,\n fullscreen,\n icon,\n className,\n analyticsEvents,\n controlPosition = 'content',\n}: LayoutItemProps) => {\n const normalizedLinks = React.useMemo(() => getLayoutItemLinks(links), [links]);\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n const contentProps: ContentBlockProps = {\n controlPosition: areControlsInFooter ? 'bottom' : 'default',\n ...content,\n links: normalizedLinks,\n size: content.size || 's',\n colSizes: {all: 12, md: 12},\n };\n const titleId = useUniqId();\n const renderMedia = () => {\n if (!media) {\n return null;\n }\n const themedMedia = getThemedValue(media, theme);\n const {title} = content;\n const mediaWithMicrodata = mergeVideoMicrodata(themedMedia, {\n name: typeof title === 'string' ? title : title?.text,\n description: content.text,\n });\n\n return fullscreen && hasFullscreen(themedMedia) ? (\n <FullscreenMedia showFullscreenIcon={showFullscreenIcon(themedMedia)}>\n {({\n className: mediaClassName,\n fullscreen: _fullscreen,\n ...fullscreenMediaProps\n } = {}) => (\n <Media\n {...mediaWithMicrodata}\n {...fullscreenMediaProps}\n className={b('media', {border}, mediaClassName)}\n analyticsEvents={analyticsEvents}\n />\n )}\n </FullscreenMedia>\n ) : (\n <Media\n {...themedMedia}\n className={b('media', {border})}\n analyticsEvents={analyticsEvents}\n />\n );\n };\n return (\n <div className={b(null, className)}>\n {renderMedia()}\n {metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}\n <div className={b('content', {'no-media': !media, margin: contentMargin})}>\n <IconWrapper icon={themedIcon} className={b('wrapper')} size={contentProps.size}>\n <Content {...contentProps} titleId={titleId} />\n </IconWrapper>\n </div>\n </div>\n );\n};\n\nexport default LayoutItem;\n"]}
@@ -20,7 +20,19 @@ unpredictable css rules order in build */
20
20
  .pc-icon-wrapper__icon_icon-position_left {
21
21
  height: 22px;
22
22
  width: 22px;
23
- margin: 1px 12px 1px 0px;
23
+ margin: 1px 12px 1px 0;
24
+ }
25
+ .pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_m {
26
+ height: 28px;
27
+ width: 28px;
28
+ margin-bottom: 4px;
29
+ margin-top: 4px;
30
+ }
31
+ .pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_l {
32
+ height: 30px;
33
+ width: 30px;
34
+ margin-bottom: 4px;
35
+ margin-top: 4px;
24
36
  }
25
37
  .pc-icon-wrapper__content {
26
38
  display: flex;
@@ -6,13 +6,13 @@ import { getMediaImage } from "../Media/Image/utils.js";
6
6
  import './IconWrapper.css';
7
7
  const b = block('icon-wrapper');
8
8
  const IconWrapper = (props) => {
9
- const { icon, children, className } = props;
9
+ const { icon, children, className, size } = props;
10
10
  if (!icon) {
11
11
  return _jsx(React.Fragment, { children: children });
12
12
  }
13
13
  const iconProps = getMediaImage(icon.value);
14
14
  const iconPosition = icon?.position;
15
- return (_jsxs("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && (_jsx(Image, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition }) })), _jsx("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
15
+ return (_jsxs("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && (_jsx(Image, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition, size }) })), _jsx("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
16
16
  };
17
17
  export default IconWrapper;
18
18
  //# sourceMappingURL=IconWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,KAAK,0BAAuB;AACnC,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAEnD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAC,GAAG,KAAK,CAAC;IAC1C,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,EAAE,SAAS,CAAC,aAC1D,SAAS,IAAI,CACV,KAAC,KAAK,OACE,SAAS,EACb,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,GACzD,CACL,EACD,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC/E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './IconWrapper.scss';\n\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className} = props;\n if (!icon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconProps = getMediaImage(icon.value);\n const iconPosition = icon?.position;\n\n return (\n <div className={b({['icon-position']: iconPosition}, className)}>\n {iconProps && (\n <Image\n {...iconProps}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: iconPosition})}\n />\n )}\n <div className={b('content', {['icon-position']: iconPosition})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
1
+ {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,KAAK,0BAAuB;AACnC,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAEnD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,EAAE,SAAS,CAAC,aAC1D,SAAS,IAAI,CACV,KAAC,KAAK,OACE,SAAS,EACb,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC,GAC/D,CACL,EACD,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC/E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './IconWrapper.scss';\n\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className, size} = props;\n if (!icon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconProps = getMediaImage(icon.value);\n const iconPosition = icon?.position;\n\n return (\n <div className={b({['icon-position']: iconPosition}, className)}>\n {iconProps && (\n <Image\n {...iconProps}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: iconPosition, size})}\n />\n )}\n <div className={b('content', {['icon-position']: iconPosition})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
@@ -35,6 +35,7 @@ export interface PositionedIcon {
35
35
  }
36
36
  export interface IconWrapperProps {
37
37
  icon?: PositionedIcon;
38
+ size?: 's' | 'm' | 'l';
38
39
  }
39
40
  export declare enum ImageCardDirection {
40
41
  Direct = "direct",
@@ -104,7 +105,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
104
105
  paddingBottom?: 's' | 'm' | 'l' | 'xl';
105
106
  backgroundColor?: string;
106
107
  }
107
- export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {
108
+ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {
108
109
  url: string;
109
110
  urlTitle?: string;
110
111
  icon?: ThemeSupporting<ImageProps>;
@@ -136,7 +137,7 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
136
137
  list?: string[];
137
138
  }
138
139
  export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
139
- content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
140
+ content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;
140
141
  contentMargin?: LayoutItemContentMargin;
141
142
  media?: ThemeSupporting<MediaProps>;
142
143
  metaInfo?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAWD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
1
+ {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAYD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
@@ -7,13 +7,13 @@ import Content from "../Content/Content.js";
7
7
  import './BackgroundCard.css';
8
8
  const b = block('background-card');
9
9
  const BackgroundCard = (props) => {
10
- const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, } = props;
10
+ const { url, title, text, border, background, paddingBottom, backgroundColor, additionalInfo, theme: cardTheme = 'default', links, buttons, analyticsEvents, urlTitle, controlPosition = 'content', list, size = 's', } = props;
11
11
  const titleId = useUniqId();
12
12
  const theme = useTheme();
13
13
  const hasBackgroundColor = backgroundColor || cardTheme !== 'default';
14
14
  const borderType = hasBackgroundColor ? 'none' : border;
15
15
  const areControlsInFooter = !paddingBottom && controlPosition === 'footer';
16
- return (_jsx(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: _jsxs(CardBase.Content, { children: [_jsx(BackgroundImage, { className: b('image'), ...getThemedValue(background, theme), style: { backgroundColor } }), _jsx(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: "s", theme: cardTheme, links: links, buttons: buttons, list: list, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' })] }) }));
16
+ return (_jsx(CardBase, { className: b({ padding: paddingBottom, theme: cardTheme }), contentClassName: b('content'), url: url, border: borderType, analyticsEvents: analyticsEvents, urlTitle: urlTitle, children: _jsxs(CardBase.Content, { children: [_jsx(BackgroundImage, { className: b('image'), ...getThemedValue(background, theme), style: { backgroundColor } }), _jsx(Content, { titleId: titleId, title: title, text: text, additionalInfo: additionalInfo, size: size, theme: cardTheme, links: links, buttons: buttons, list: list, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' })] }) }));
17
17
  };
18
18
  export default BackgroundCard;
19
19
  //# sourceMappingURL=BackgroundCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/BackgroundCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,kCAA0B;AAC5D,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,OAAO,8BAA2B;AAEzC,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAEnC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAClD,MAAM,EACF,GAAG,EACH,KAAK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,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,IACa,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {BackgroundImage, CardBase} from '../../components/';\nimport {useTheme} from '../../context/theme';\nimport {BackgroundCardProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BackgroundCard.scss';\n\nconst b = block('background-card');\n\nconst BackgroundCard = (props: BackgroundCardProps) => {\n const {\n url,\n title,\n text,\n border,\n background,\n paddingBottom,\n backgroundColor,\n additionalInfo,\n theme: cardTheme = 'default',\n links,\n buttons,\n analyticsEvents,\n urlTitle,\n controlPosition = 'content',\n list,\n } = props;\n\n const titleId = useUniqId();\n\n const theme = useTheme();\n const hasBackgroundColor = backgroundColor || cardTheme !== 'default';\n const borderType = hasBackgroundColor ? 'none' : border;\n const areControlsInFooter = !paddingBottom && controlPosition === 'footer';\n\n return (\n <CardBase\n className={b({padding: paddingBottom, theme: cardTheme})}\n contentClassName={b('content')}\n url={url}\n border={borderType}\n analyticsEvents={analyticsEvents}\n urlTitle={urlTitle}\n >\n <CardBase.Content>\n <BackgroundImage\n className={b('image')}\n {...getThemedValue(background, theme)}\n style={{backgroundColor}}\n />\n <Content\n titleId={titleId}\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n size=\"s\"\n theme={cardTheme}\n links={links}\n buttons={buttons}\n list={list}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BackgroundCard;\n"]}
1
+ {"version":3,"file":"BackgroundCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/BackgroundCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAA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AAC,OAAO,CAAC,KACjB,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,EACrC,KAAK,EAAE,EAAC,eAAe,EAAC,GAC1B,EACF,KAAC,OAAO,IACJ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,IACa,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {BackgroundImage, CardBase} from '../../components/';\nimport {useTheme} from '../../context/theme';\nimport {BackgroundCardProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BackgroundCard.scss';\n\nconst b = block('background-card');\n\nconst BackgroundCard = (props: BackgroundCardProps) => {\n const {\n url,\n title,\n text,\n border,\n background,\n paddingBottom,\n backgroundColor,\n additionalInfo,\n theme: cardTheme = 'default',\n links,\n buttons,\n analyticsEvents,\n urlTitle,\n controlPosition = 'content',\n list,\n size = 's',\n } = props;\n\n const titleId = useUniqId();\n\n const theme = useTheme();\n const hasBackgroundColor = backgroundColor || cardTheme !== 'default';\n const borderType = hasBackgroundColor ? 'none' : border;\n const areControlsInFooter = !paddingBottom && controlPosition === 'footer';\n\n return (\n <CardBase\n className={b({padding: paddingBottom, theme: cardTheme})}\n contentClassName={b('content')}\n url={url}\n border={borderType}\n analyticsEvents={analyticsEvents}\n urlTitle={urlTitle}\n >\n <CardBase.Content>\n <BackgroundImage\n className={b('image')}\n {...getThemedValue(background, theme)}\n style={{backgroundColor}}\n />\n <Content\n titleId={titleId}\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n size={size}\n theme={cardTheme}\n links={links}\n buttons={buttons}\n list={list}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BackgroundCard;\n"]}
@@ -8,13 +8,13 @@ import Content from "../Content/Content.js";
8
8
  import './BasicCard.css';
9
9
  const b = block('basic-card');
10
10
  const BasicCard = (props) => {
11
- const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = IconPosition.Top, controlPosition = 'content', ...cardParams } = props;
11
+ const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = IconPosition.Top, controlPosition = 'content', size = 's', ...cardParams } = props;
12
12
  const titleId = useUniqId();
13
13
  const descriptionId = useUniqId();
14
14
  const areControlsInFooter = controlPosition === 'footer';
15
15
  const theme = useTheme();
16
16
  const themedIcon = getThemedValue(icon, theme);
17
- return (_jsx(CardBase, { className: b(), contentClassName: b('content'), ...cardParams, extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId }, children: _jsx(CardBase.Content, { children: _jsx(IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, className: b('wrapper'), children: _jsx(Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: "s", colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' }) }) }) }));
17
+ return (_jsx(CardBase, { className: b(), contentClassName: b('content'), ...cardParams, extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId }, children: _jsx(CardBase.Content, { children: _jsx(IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, className: b('wrapper'), size: size, children: _jsx(Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: size, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' }) }) }) }));
18
18
  };
19
19
  export default BasicCard;
20
20
  //# sourceMappingURL=BasicCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,kCAAyB;AACvD,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,YAAY,EAAC,qDAAkD;AACvE,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,OAAO,8BAA2B;AAEzC,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,YAAY,CAAC,GAAG,EAC/B,eAAe,GAAG,SAAS,EAC3B,GAAG,UAAU,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,eAAe,KAAK,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE/C,OAAO,CACH,KAAC,QAAQ,IACL,SAAS,EAAE,CAAC,EAAE,EACd,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,KAC1B,UAAU,EACd,UAAU,EAAE,EAAC,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAC,YAE3E,KAAC,QAAQ,CAAC,OAAO,cACb,KAAC,WAAW,IACR,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAC,CAAC,CAAC,SAAS,EAC1E,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAEvB,KAAC,OAAO,IACJ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,GAAG,EACR,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,GACQ,GACC,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {CardBase, IconWrapper} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{'aria-describedby': descriptionId, 'aria-labelledby': titleId}}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n className={b('wrapper')}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size=\"s\"\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
1
+ {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,kCAAyB;AACvD,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,YAAY,EAAC,qDAAkD;AACvE,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,OAAO,8BAA2B;AAEzC,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,YAAY,CAAC,GAAG,EAC/B,eAAe,GAAG,SAAS,EAC3B,IAAI,GAAG,GAAG,EACV,GAAG,UAAU,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,eAAe,KAAK,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE/C,OAAO,CACH,KAAC,QAAQ,IACL,SAAS,EAAE,CAAC,EAAE,EACd,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,KAC1B,UAAU,EACd,UAAU,EAAE,EAAC,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAC,YAE3E,KAAC,QAAQ,CAAC,OAAO,cACb,KAAC,WAAW,IACR,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAC,CAAC,CAAC,SAAS,EAC1E,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EACvB,IAAI,EAAE,IAAI,YAEV,KAAC,OAAO,IACJ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,GACQ,GACC,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {CardBase, IconWrapper} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n size = 's',\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{'aria-describedby': descriptionId, 'aria-labelledby': titleId}}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n className={b('wrapper')}\n size={size}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size={size}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
@@ -18,7 +18,7 @@ const LayoutItem = ({ content: { links, ...content }, contentMargin = 'm', metaI
18
18
  controlPosition: areControlsInFooter ? 'bottom' : 'default',
19
19
  ...content,
20
20
  links: normalizedLinks,
21
- size: 's',
21
+ size: content.size || 's',
22
22
  colSizes: { all: 12, md: 12 },
23
23
  };
24
24
  const titleId = useUniqId();
@@ -34,7 +34,7 @@ const LayoutItem = ({ content: { links, ...content }, contentMargin = 'm', metaI
34
34
  });
35
35
  return fullscreen && hasFullscreen(themedMedia) ? (_jsx(FullscreenMedia, { showFullscreenIcon: showFullscreenIcon(themedMedia), children: ({ className: mediaClassName, fullscreen: _fullscreen, ...fullscreenMediaProps } = {}) => (_jsx(Media, { ...mediaWithMicrodata, ...fullscreenMediaProps, className: b('media', { border }, mediaClassName), analyticsEvents: analyticsEvents })) })) : (_jsx(Media, { ...themedMedia, className: b('media', { border }), analyticsEvents: analyticsEvents }));
36
36
  };
37
- return (_jsxs("div", { className: b(null, className), children: [renderMedia(), metaInfo && _jsx(MetaInfo, { items: metaInfo, className: b('meta-info') }), _jsx("div", { className: b('content', { 'no-media': !media, margin: contentMargin }), children: _jsx(IconWrapper, { icon: themedIcon, className: b('wrapper'), children: _jsx(Content, { ...contentProps, titleId: titleId }) }) })] }));
37
+ return (_jsxs("div", { className: b(null, className), children: [renderMedia(), metaInfo && _jsx(MetaInfo, { items: metaInfo, className: b('meta-info') }), _jsx("div", { className: b('content', { 'no-media': !media, margin: contentMargin }), children: _jsx(IconWrapper, { icon: themedIcon, className: b('wrapper'), size: contentProps.size, children: _jsx(Content, { ...contentProps, titleId: titleId }) }) })] }));
38
38
  };
39
39
  export default LayoutItem;
40
40
  //# sourceMappingURL=LayoutItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutItem.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/LayoutItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAC,kCAAyB;AAC/E,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAC1D,OAAO,OAAO,8BAA2B;AAEzC,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAE,kBAAkB,EAAC,mBAAgB;AAE9E,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,EAChB,OAAO,EAAE,EAAC,KAAK,EAAE,GAAG,OAAO,EAAC,EAC5B,aAAa,GAAG,GAAG,EACnB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,SAAS,EACT,eAAe,EACf,eAAe,GAAG,SAAS,GACb,EAAE,EA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B,EAC1B,GAAG,EAAE,EAAE,EAAE,CAAC,CACP,KAAC,KAAK,OACE,kBAAkB,KAClB,oBAAoB,EACxB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,EAAE,cAAc,CAAC,EAC/C,eAAe,EAAE,eAAe,GAClC,CACL,GACa,CACrB,CAAC,CAAC,CAAC,CACA,KAAC,KAAK,OACE,WAAW,EACf,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,CAAC,EAC/B,eAAe,EAAE,eAAe,GAClC,CACL,CAAC;IACN,CAAC,CAAC;IACF,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,aAC7B,WAAW,EAAE,EACb,QAAQ,IAAI,KAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,GAAI,EACrE,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAC,CAAC,YACrE,KAAC,WAAW,IAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAClD,KAAC,OAAO,OAAK,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,GACrC,GACZ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenMedia, IconWrapper, Media, MetaInfo} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {ContentBlockProps, LayoutItemProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\nimport Content from '../Content/Content';\n\nimport {getLayoutItemLinks, hasFullscreen, showFullscreenIcon} from './utils';\n\nimport './LayoutItem.scss';\n\nconst b = block('layout-item');\n\nconst LayoutItem = ({\n content: {links, ...content},\n contentMargin = 'm',\n metaInfo,\n media,\n border,\n fullscreen,\n icon,\n className,\n analyticsEvents,\n controlPosition = 'content',\n}: LayoutItemProps) => {\n const normalizedLinks = React.useMemo(() => getLayoutItemLinks(links), [links]);\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n const contentProps: ContentBlockProps = {\n controlPosition: areControlsInFooter ? 'bottom' : 'default',\n ...content,\n links: normalizedLinks,\n size: 's',\n colSizes: {all: 12, md: 12},\n };\n const titleId = useUniqId();\n const renderMedia = () => {\n if (!media) {\n return null;\n }\n const themedMedia = getThemedValue(media, theme);\n const {title} = content;\n const mediaWithMicrodata = mergeVideoMicrodata(themedMedia, {\n name: typeof title === 'string' ? title : title?.text,\n description: content.text,\n });\n\n return fullscreen && hasFullscreen(themedMedia) ? (\n <FullscreenMedia showFullscreenIcon={showFullscreenIcon(themedMedia)}>\n {({\n className: mediaClassName,\n fullscreen: _fullscreen,\n ...fullscreenMediaProps\n } = {}) => (\n <Media\n {...mediaWithMicrodata}\n {...fullscreenMediaProps}\n className={b('media', {border}, mediaClassName)}\n analyticsEvents={analyticsEvents}\n />\n )}\n </FullscreenMedia>\n ) : (\n <Media\n {...themedMedia}\n className={b('media', {border})}\n analyticsEvents={analyticsEvents}\n />\n );\n };\n return (\n <div className={b(null, className)}>\n {renderMedia()}\n {metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}\n <div className={b('content', {'no-media': !media, margin: contentMargin})}>\n <IconWrapper icon={themedIcon} className={b('wrapper')}>\n <Content {...contentProps} titleId={titleId} />\n </IconWrapper>\n </div>\n </div>\n );\n};\n\nexport default LayoutItem;\n"]}
1
+ {"version":3,"file":"LayoutItem.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/LayoutItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EA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GAAI,EACrE,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAC,CAAC,YACrE,KAAC,WAAW,IAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,YAC3E,KAAC,OAAO,OAAK,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,GACrC,GACZ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {FullscreenMedia, IconWrapper, Media, MetaInfo} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {ContentBlockProps, LayoutItemProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\nimport Content from '../Content/Content';\n\nimport {getLayoutItemLinks, hasFullscreen, showFullscreenIcon} from './utils';\n\nimport './LayoutItem.scss';\n\nconst b = block('layout-item');\n\nconst LayoutItem = ({\n content: {links, ...content},\n contentMargin = 'm',\n metaInfo,\n media,\n border,\n fullscreen,\n icon,\n className,\n analyticsEvents,\n controlPosition = 'content',\n}: LayoutItemProps) => {\n const normalizedLinks = React.useMemo(() => getLayoutItemLinks(links), [links]);\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n\n const contentProps: ContentBlockProps = {\n controlPosition: areControlsInFooter ? 'bottom' : 'default',\n ...content,\n links: normalizedLinks,\n size: content.size || 's',\n colSizes: {all: 12, md: 12},\n };\n const titleId = useUniqId();\n const renderMedia = () => {\n if (!media) {\n return null;\n }\n const themedMedia = getThemedValue(media, theme);\n const {title} = content;\n const mediaWithMicrodata = mergeVideoMicrodata(themedMedia, {\n name: typeof title === 'string' ? title : title?.text,\n description: content.text,\n });\n\n return fullscreen && hasFullscreen(themedMedia) ? (\n <FullscreenMedia showFullscreenIcon={showFullscreenIcon(themedMedia)}>\n {({\n className: mediaClassName,\n fullscreen: _fullscreen,\n ...fullscreenMediaProps\n } = {}) => (\n <Media\n {...mediaWithMicrodata}\n {...fullscreenMediaProps}\n className={b('media', {border}, mediaClassName)}\n analyticsEvents={analyticsEvents}\n />\n )}\n </FullscreenMedia>\n ) : (\n <Media\n {...themedMedia}\n className={b('media', {border})}\n analyticsEvents={analyticsEvents}\n />\n );\n };\n return (\n <div className={b(null, className)}>\n {renderMedia()}\n {metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}\n <div className={b('content', {'no-media': !media, margin: contentMargin})}>\n <IconWrapper icon={themedIcon} className={b('wrapper')} size={contentProps.size}>\n <Content {...contentProps} titleId={titleId} />\n </IconWrapper>\n </div>\n </div>\n );\n};\n\nexport default LayoutItem;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -35,6 +35,7 @@ export interface PositionedIcon {
35
35
  }
36
36
  export interface IconWrapperProps {
37
37
  icon?: PositionedIcon;
38
+ size?: 's' | 'm' | 'l';
38
39
  }
39
40
  export declare enum ImageCardDirection {
40
41
  Direct = "direct",
@@ -104,7 +105,7 @@ export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase,
104
105
  paddingBottom?: 's' | 'm' | 'l' | 'xl';
105
106
  backgroundColor?: string;
106
107
  }
107
- export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {
108
+ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, CardLayoutProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {
108
109
  url: string;
109
110
  urlTitle?: string;
110
111
  icon?: ThemeSupporting<ImageProps>;
@@ -136,7 +137,7 @@ export interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, '
136
137
  list?: string[];
137
138
  }
138
139
  export interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {
139
- content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
140
+ content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;
140
141
  contentMargin?: LayoutItemContentMargin;
141
142
  media?: ThemeSupporting<MediaProps>;
142
143
  metaInfo?: string[];
package/widget/index.js CHANGED
@@ -1 +1 @@
1
- export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[6007],{56007:function(_,t,e){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),Y={name:\"zh\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"周日_周一_周二_周三_周四_周五_周六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"周\":_+\"日\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日Ah点mm分\",LLLL:\"YYYY年M月D日ddddAh点mm分\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s后\",past:\"%s前\",s:\"几秒\",m:\"1 分钟\",mm:\"%d 分钟\",h:\"1 小时\",hh:\"%d 小时\",d:\"1 天\",dd:\"%d 天\",M:\"1 个月\",MM:\"%d 个月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var e=100*_+t;return e<600?\"凌晨\":e<900?\"早上\":e<1100?\"上午\":e<1300?\"中午\":e<1800?\"下午\":\"晚上\"}};return e.default.locale(Y,null,!0),Y}(e(74353))}}]);";
1
+ export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[1349],{31349:function(_,t,Y){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var Y=t(_),e={name:\"zh-tw\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"週日_週一_週二_週三_週四_週五_週六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"週\":_+\"日\"},formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日 HH:mm\",LLLL:\"YYYY年M月D日dddd HH:mm\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s內\",past:\"%s前\",s:\"幾秒\",m:\"1 分鐘\",mm:\"%d 分鐘\",h:\"1 小時\",hh:\"%d 小時\",d:\"1 天\",dd:\"%d 天\",M:\"1 個月\",MM:\"%d 個月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var Y=100*_+t;return Y<600?\"凌晨\":Y<900?\"早上\":Y<1100?\"上午\":Y<1300?\"中午\":Y<1800?\"下午\":\"晚上\"}};return Y.default.locale(e,null,!0),e}(Y(74353))}}]);";