@meduza/ui-kit-2 0.1.40 → 0.1.42

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.
@@ -282,6 +282,15 @@ var Switcher = function Switcher(_ref) {
282
282
  }, children));
283
283
  };
284
284
 
285
+ var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
286
+ var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
287
+ return styles[ctx];
288
+ }).map(function (ctx) {
289
+ return [[styles[ctx]], true];
290
+ }) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
291
+ return classNames.concat(context);
292
+ };
293
+
285
294
  var BlockContext = /*#__PURE__*/React.createContext({
286
295
  lightBox: null
287
296
  });
@@ -424,7 +433,7 @@ var RenderPicture = function RenderPicture(_ref) {
424
433
  }));
425
434
  };
426
435
 
427
- var styles$4 = {"root":"Image-module_root__1vsA_","isLoaded":"Image-module_isLoaded__3XhU5","wrapper":"Image-module_wrapper__3fLjs","fullscreen":"Image-module_fullscreen__29apx"};
436
+ var styles$4 = {"root":"Image-module_root__1vsA_","isLoaded":"Image-module_isLoaded__3XhU5","wrapper":"Image-module_wrapper__3fLjs","fullscreen":"Image-module_fullscreen__29apx","dark":"Image-module_dark__3o0nU"};
428
437
 
429
438
  var Image = function Image(_ref) {
430
439
  var alt = _ref.alt,
@@ -435,7 +444,8 @@ var Image = function Image(_ref) {
435
444
  source = _ref.source,
436
445
  lazy = _ref.lazy,
437
446
  fullscreen = _ref.fullscreen,
438
- ratio = _ref.ratio;
447
+ ratio = _ref.ratio,
448
+ styleContext = _ref.styleContext;
439
449
 
440
450
  var _useContext = useContext(BlockContext),
441
451
  lightBox = _useContext.lightBox;
@@ -472,8 +482,14 @@ var Image = function Image(_ref) {
472
482
  /* fallback w325 url until w6 was released */
473
483
 
474
484
  var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
485
+ var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && fullscreen.desktop]];
486
+
487
+ if (styleContext) {
488
+ classNames = makeStyleContext(classNames, styleContext, styles$4);
489
+ }
490
+
475
491
  return React.createElement("div", {
476
- className: makeClassName([[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && fullscreen.desktop]]),
492
+ className: makeClassName(classNames),
477
493
  style: blockStyles,
478
494
  "data-testid": "image"
479
495
  }, React.createElement("div", {
@@ -535,9 +551,11 @@ var Popover = function Popover(_ref) {
535
551
  };
536
552
 
537
553
  useEffect(function () {
554
+ document.body.dataset.popover = 'true';
538
555
  window.addEventListener('keydown', escFunction, false);
539
556
  window.addEventListener('scroll', handleScroll, false);
540
557
  return function () {
558
+ document.body.removeAttribute('data-popover');
541
559
  window.removeEventListener('keydown', escFunction, false);
542
560
  window.removeEventListener('scroll', handleScroll, false);
543
561
  };
@@ -791,15 +809,6 @@ var DotsOnImage = function DotsOnImage(_ref) {
791
809
  })))));
792
810
  };
793
811
 
794
- var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
795
- var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
796
- return styles[ctx];
797
- }).map(function (ctx) {
798
- return [[styles[ctx]], true];
799
- }) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
800
- return classNames.concat(context);
801
- };
802
-
803
812
  var styles$8 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","richRelated":"Tag-module_richRelated__2vbQQ","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
804
813
 
805
814
  var Tag = function Tag(_ref) {
@@ -1273,7 +1282,8 @@ var EmbedBlock = function EmbedBlock(_ref) {
1273
1282
  height: block.data.height,
1274
1283
  alt: block.data.caption,
1275
1284
  display: block.data.display,
1276
- lazy: block.data.lazy
1285
+ lazy: block.data.lazy,
1286
+ styleContext: styleContext
1277
1287
  }));
1278
1288
  }
1279
1289