@meduza/ui-kit-2 1.4.7-b → 1.4.8

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.
@@ -21,4 +21,5 @@ export interface CoverProps {
21
21
  };
22
22
  };
23
23
  styleContext?: string[] | string;
24
+ titleStyle?: Record<string, string>;
24
25
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export type TagSizes = 'small' | 'large';
3
- export type TagThemes = 'dark' | 'gold' | 'gray' | 'light' | 'inherit' | 'custom';
3
+ export type TagThemes = 'dark' | 'gold' | 'gray' | 'light' | 'inherit' | 'overlay' | 'custom';
4
4
  export type TagStyleContexts = 'isInToolbar' | 'isInSpoiler' | 'isInDropdown';
5
5
  export interface TagProps {
6
6
  children: React.ReactNode | JSX.Element[] | JSX.Element;
@@ -745,7 +745,7 @@ const DotsOnImage = ({
745
745
  })))))));
746
746
  };
747
747
 
748
- var styles$B = {"root":"Tag-module_root__sGbnM","small":"Tag-module_small__hcPrf","large":"Tag-module_large__EKMu6","dark":"Tag-module_dark__9SHCb","light":"Tag-module_light__qlfy3","gold":"Tag-module_gold__u0bzS","gray":"Tag-module_gray__eazPk","inherit":"Tag-module_inherit__z21c-","is1to1":"Tag-module_is1to1__V-fH5","is1to2":"Tag-module_is1to2__b9Obh","isInSuperBlock":"Tag-module_isInSuperBlock__wrFUY","is1to3":"Tag-module_is1to3__vZT-R","is1to4":"Tag-module_is1to4__MBh5V","slide":"Tag-module_slide__gzptP","game":"Tag-module_game__NmKec","podcastMaterial":"Tag-module_podcastMaterial__O-LBI","richRelated":"Tag-module_richRelated__Qs6Ei","isInBookRelated":"Tag-module_isInBookRelated__ikTaj","isInBlockMetaContainer":"Tag-module_isInBlockMetaContainer__bAmLh","card":"Tag-module_card__TX87-","live":"Tag-module_live__ykyR7","episode":"Tag-module_episode__3OHmN","podcast":"Tag-module_podcast__K6dHn","rich":"Tag-module_rich__vPnWd","isInDynamicBlock":"Tag-module_isInDynamicBlock__WNleF","isInPodcastPlayer":"Tag-module_isInPodcastPlayer__H4sK9","mobile":"Tag-module_mobile__19oMH","desktop":"Tag-module_desktop__cNyQs"};
748
+ var styles$B = {"root":"Tag-module_root__sGbnM","small":"Tag-module_small__hcPrf","large":"Tag-module_large__EKMu6","dark":"Tag-module_dark__9SHCb","light":"Tag-module_light__qlfy3","gold":"Tag-module_gold__u0bzS","gray":"Tag-module_gray__eazPk","inherit":"Tag-module_inherit__z21c-","overlay":"Tag-module_overlay__Xw8fF","is1to1":"Tag-module_is1to1__V-fH5","is1to2":"Tag-module_is1to2__b9Obh","isInSuperBlock":"Tag-module_isInSuperBlock__wrFUY","is1to3":"Tag-module_is1to3__vZT-R","is1to4":"Tag-module_is1to4__MBh5V","slide":"Tag-module_slide__gzptP","game":"Tag-module_game__NmKec","podcastMaterial":"Tag-module_podcastMaterial__O-LBI","richRelated":"Tag-module_richRelated__Qs6Ei","isInBookRelated":"Tag-module_isInBookRelated__ikTaj","isInBlockMetaContainer":"Tag-module_isInBlockMetaContainer__bAmLh","card":"Tag-module_card__TX87-","live":"Tag-module_live__ykyR7","episode":"Tag-module_episode__3OHmN","podcast":"Tag-module_podcast__K6dHn","rich":"Tag-module_rich__vPnWd","isInDynamicBlock":"Tag-module_isInDynamicBlock__WNleF","isInPodcastPlayer":"Tag-module_isInPodcastPlayer__H4sK9","mobile":"Tag-module_mobile__19oMH","desktop":"Tag-module_desktop__cNyQs"};
749
749
 
750
750
  const Tag = ({
751
751
  children,
@@ -944,7 +944,7 @@ const Toolbar = ({
944
944
  }, children));
945
945
  };
946
946
 
947
- var styles$u = {"root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
947
+ var styles$u = {"root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","overlay":"Meta-module_overlay__ZRKZy","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","richRelated":"Meta-module_richRelated__fIo0x","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
948
948
 
949
949
  const Meta = ({
950
950
  hasSource,
@@ -1437,7 +1437,7 @@ const SimpleTitle = ({
1437
1437
  }, first);
1438
1438
  };
1439
1439
 
1440
- var styles$n = {"root":"RichTitle-module_root__U5XQu","slide":"RichTitle-module_slide__eU9Ob","game":"RichTitle-module_game__S1csb","podcastMaterial":"RichTitle-module_podcastMaterial__AulVF","half":"RichTitle-module_half__yBMby","featured":"RichTitle-module_featured__ULNQn","isInFeaturedBlock":"RichTitle-module_isInFeaturedBlock__3vYu9","isInMediaBlock":"RichTitle-module_isInMediaBlock__2h6rl","isInBookRelated":"RichTitle-module_isInBookRelated__LcCPV","isInDynamicBlock":"RichTitle-module_isInDynamicBlock__J-gM6","isInPodcastPlayer":"RichTitle-module_isInPodcastPlayer__kvEPH","large":"RichTitle-module_large__n2URP","medium":"RichTitle-module_medium__KkBLJ","mobile":"RichTitle-module_mobile__W5L9E","desktop":"RichTitle-module_desktop__k0PkC"};
1440
+ var styles$n = {"root":"RichTitle-module_root__U5XQu","slide":"RichTitle-module_slide__eU9Ob","game":"RichTitle-module_game__S1csb","podcastMaterial":"RichTitle-module_podcastMaterial__AulVF","half":"RichTitle-module_half__yBMby","featured":"RichTitle-module_featured__ULNQn","isInFeaturedBlock":"RichTitle-module_isInFeaturedBlock__3vYu9","isInMediaBlock":"RichTitle-module_isInMediaBlock__2h6rl","richRelated":"RichTitle-module_richRelated__cvt3o","isInBookRelated":"RichTitle-module_isInBookRelated__LcCPV","isInDynamicBlock":"RichTitle-module_isInDynamicBlock__J-gM6","isInPodcastPlayer":"RichTitle-module_isInPodcastPlayer__kvEPH","large":"RichTitle-module_large__n2URP","medium":"RichTitle-module_medium__KkBLJ","mobile":"RichTitle-module_mobile__W5L9E","desktop":"RichTitle-module_desktop__k0PkC"};
1441
1441
 
1442
1442
  const RichTitle = ({
1443
1443
  block: {
@@ -2196,7 +2196,7 @@ const RenderBlocks = ({
2196
2196
  }
2197
2197
  };
2198
2198
 
2199
- var styles$a = {"root":"Cover-module_root__3pscq","body":"Cover-module_body__eJpUI","image":"Cover-module_image__frrrH","rich":"Cover-module_rich__YcxWa","dark":"Cover-module_dark__cRucL","light":"Cover-module_light__la-sk","control":"Cover-module_control__WP0G3","isInDynamicBlock":"Cover-module_isInDynamicBlock__qO-yt","mobile":"Cover-module_mobile__aotep","desktop":"Cover-module_desktop__dfbC-"};
2199
+ var styles$a = {"root":"Cover-module_root__3pscq","body":"Cover-module_body__eJpUI","image":"Cover-module_image__frrrH","rich":"Cover-module_rich__YcxWa","dark":"Cover-module_dark__cRucL","light":"Cover-module_light__la-sk","isOnImage":"Cover-module_isOnImage__J296p","control":"Cover-module_control__WP0G3","isInDynamicBlock":"Cover-module_isInDynamicBlock__qO-yt","mobile":"Cover-module_mobile__aotep","desktop":"Cover-module_desktop__dfbC-"};
2200
2200
 
2201
2201
  const Cover = ({
2202
2202
  block: {
@@ -2213,15 +2213,19 @@ const Cover = ({
2213
2213
  }
2214
2214
  }
2215
2215
  },
2216
- styleContext
2216
+ styleContext,
2217
+ titleStyle
2217
2218
  }) => {
2218
2219
  const [isPopoverShown, setIsPopoverShown] = React.useState(false);
2219
2220
  const style = {};
2220
- let classNames = [[styles$a.root, true], [styles$a[onlyOn], !!onlyOn && !!styles$a[onlyOn]]];
2221
+ const isOnImage = !!titleStyle;
2222
+ const contexts = Array.isArray(styleContext) ? styleContext : [styleContext].filter(Boolean);
2223
+ const blockStyleContext = isOnImage ? [...contexts, 'overlay'] : styleContext;
2224
+ let classNames = [[styles$a.root, true], [styles$a[onlyOn], !!onlyOn && !!styles$a[onlyOn]], [styles$a.isOnImage, isOnImage]];
2221
2225
  if (styleContext) {
2222
2226
  classNames = makeStyleContext(classNames, styleContext, styles$a);
2223
2227
  }
2224
- if (gradients) {
2228
+ if (gradients && !isOnImage) {
2225
2229
  const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2226
2230
  classNames = makeStyleContext(classNames, theme, styles$a);
2227
2231
  style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
@@ -2233,7 +2237,8 @@ const Cover = ({
2233
2237
  }));
2234
2238
  return /*#__PURE__*/React.createElement("div", {
2235
2239
  "data-testid": "cover",
2236
- className: makeClassName(classNames)
2240
+ className: makeClassName(classNames),
2241
+ style: titleStyle
2237
2242
  }, /*#__PURE__*/React.createElement("div", {
2238
2243
  className: styles$a.image
2239
2244
  }, /*#__PURE__*/React.createElement(Image, {
@@ -2246,7 +2251,7 @@ const Cover = ({
2246
2251
  }, blocks.map(item => (/*#__PURE__*/React.createElement(RenderBlocks, {
2247
2252
  key: item.id,
2248
2253
  block: item,
2249
- styleContext: styleContext
2254
+ styleContext: blockStyleContext
2250
2255
  })))), cc === 'button' && (/*#__PURE__*/React.createElement("button", {
2251
2256
  className: styles$a.control,
2252
2257
  type: "button",
@@ -2392,7 +2397,7 @@ const Spoiler = ({
2392
2397
  }))));
2393
2398
  };
2394
2399
 
2395
- var styles$6 = {"root":"RelatedRichBlock-module_root__-SEe7","content":"RelatedRichBlock-module_content__iyMrN","cover":"RelatedRichBlock-module_cover__3gnIx","body":"RelatedRichBlock-module_body__XhS0U","isCard":"RelatedRichBlock-module_isCard__wkMw-","tag":"RelatedRichBlock-module_tag__c18sv","center":"RelatedRichBlock-module_center__KANd-","mobile":"RelatedRichBlock-module_mobile__N-G4U","desktop":"RelatedRichBlock-module_desktop__EaPOr"};
2400
+ var styles$6 = {"root":"RelatedRichBlock-module_root__-SEe7","isInCard":"RelatedRichBlock-module_isInCard__F3ip3","content":"RelatedRichBlock-module_content__iyMrN","cover":"RelatedRichBlock-module_cover__3gnIx","body":"RelatedRichBlock-module_body__XhS0U","isCard":"RelatedRichBlock-module_isCard__wkMw-","tag":"RelatedRichBlock-module_tag__c18sv","center":"RelatedRichBlock-module_center__KANd-","mobile":"RelatedRichBlock-module_mobile__N-G4U","desktop":"RelatedRichBlock-module_desktop__EaPOr"};
2396
2401
 
2397
2402
  const RelatedRichBlock = ({
2398
2403
  block: {
@@ -2413,10 +2418,10 @@ const RelatedRichBlock = ({
2413
2418
  }) => {
2414
2419
  const cardType = `is${toCapitalize(layout)}`;
2415
2420
  let classNames = [[styles$6.root, true], [styles$6[cardType], !!layout && !!styles$6[cardType]], [styles$6.hasGradient, !!gradients], [styles$6[onlyOn], !!onlyOn && !!styles$6[onlyOn]]];
2416
- let context = ['isInMediaBlock'];
2421
+ let context = ['isInMediaBlock', 'richRelated'];
2417
2422
  if (styleContext) {
2418
2423
  classNames = makeStyleContext(classNames, styleContext, styles$6);
2419
- context = [...styleContext, 'isInMediaBlock'];
2424
+ context = [...styleContext, 'isInMediaBlock', 'richRelated'];
2420
2425
  }
2421
2426
  return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
2422
2427
  "data-testid": "related-rich-block",