@meduza/ui-kit-2 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RichTitle/RichTitle.types.d.ts +2 -0
- package/dist/ui-kit-2.cjs.development.js +13 -8
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +13 -8
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1103 -1038
- package/package.json +1 -1
- package/src/Meta/Meta.module.css +1 -1
- package/src/RelatedBlock/index.tsx +1 -1
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +79 -18
- package/src/RelatedRichBlock/RelatedRichBlock.stories.tsx +0 -1
- package/src/RelatedRichBlock/index.tsx +7 -4
- package/src/RelatedRichBlock/mock.json +5 -5
- package/src/RichTitle/RichTitle.module.css +3 -5
- package/src/RichTitle/RichTitle.types.ts +1 -0
- package/src/RichTitle/index.tsx +3 -3
- package/src/Tag/Tag.module.css +7 -0
- package/src/_storybook/PreviewWrapper/PreviewWrapper.module.css +12 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface RichTitleProps {
|
|
2
3
|
block: {
|
|
3
4
|
only_on?: string;
|
|
@@ -5,6 +6,7 @@ export interface RichTitleProps {
|
|
|
5
6
|
featured?: boolean;
|
|
6
7
|
first: string;
|
|
7
8
|
second?: string;
|
|
9
|
+
as?: keyof JSX.IntrinsicElements;
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
styleContext?: string[] | string;
|
|
@@ -797,7 +797,7 @@ var makeStyleContext = function makeStyleContext(classNames, styleContext, style
|
|
|
797
797
|
return classNames.concat(context);
|
|
798
798
|
};
|
|
799
799
|
|
|
800
|
-
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","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"};
|
|
800
|
+
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"};
|
|
801
801
|
|
|
802
802
|
var Tag = function Tag(_ref) {
|
|
803
803
|
var children = _ref.children,
|
|
@@ -1510,6 +1510,8 @@ var RichTitle = function RichTitle(_ref) {
|
|
|
1510
1510
|
featured = _ref$block$data.featured,
|
|
1511
1511
|
first = _ref$block$data.first,
|
|
1512
1512
|
second = _ref$block$data.second,
|
|
1513
|
+
_ref$block$data$as = _ref$block$data.as,
|
|
1514
|
+
TagName = _ref$block$data$as === void 0 ? 'h1' : _ref$block$data$as,
|
|
1513
1515
|
styleContext = _ref.styleContext;
|
|
1514
1516
|
var classNames = [[styles$n.root, true], [styles$n[onlyOn], true], [styles$n.featured, !!featured]];
|
|
1515
1517
|
|
|
@@ -1517,7 +1519,7 @@ var RichTitle = function RichTitle(_ref) {
|
|
|
1517
1519
|
classNames = makeStyleContext(classNames, styleContext, styles$n);
|
|
1518
1520
|
}
|
|
1519
1521
|
|
|
1520
|
-
return React__default.createElement(
|
|
1522
|
+
return React__default.createElement(TagName, {
|
|
1521
1523
|
"data-testid": "rich-title",
|
|
1522
1524
|
className: makeClassName(classNames)
|
|
1523
1525
|
}, first, second && React__default.createElement("span", null, " ", second));
|
|
@@ -1612,7 +1614,7 @@ var RelatedBlock = function RelatedBlock(_ref) {
|
|
|
1612
1614
|
|
|
1613
1615
|
var handleClick = function handleClick(url) {
|
|
1614
1616
|
if (trackClick) {
|
|
1615
|
-
postMessage('simpleRelated', 'click'
|
|
1617
|
+
postMessage('simpleRelated', url, 'click');
|
|
1616
1618
|
}
|
|
1617
1619
|
};
|
|
1618
1620
|
|
|
@@ -1677,7 +1679,7 @@ var SourceBlock = function SourceBlock(_ref) {
|
|
|
1677
1679
|
}, origin))));
|
|
1678
1680
|
};
|
|
1679
1681
|
|
|
1680
|
-
var styles$s = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","isRich":"RelatedRichBlock-module_isRich__1LnA4","body":"RelatedRichBlock-module_body__1ZHZS","
|
|
1682
|
+
var styles$s = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","isRich":"RelatedRichBlock-module_isRich__1LnA4","body":"RelatedRichBlock-module_body__1ZHZS","hasGradient":"RelatedRichBlock-module_hasGradient__27LOk","isCard":"RelatedRichBlock-module_isCard__2naDz","cover":"RelatedRichBlock-module_cover__3yygp","picture":"RelatedRichBlock-module_picture__128HJ","tag":"RelatedRichBlock-module_tag__3OLyG","dark":"RelatedRichBlock-module_dark__3Y1fE","light":"RelatedRichBlock-module_light__2mUxL","mobile":"RelatedRichBlock-module_mobile__JpCS4","desktop":"RelatedRichBlock-module_desktop__trL0D"};
|
|
1681
1683
|
|
|
1682
1684
|
/* eslint-disable react/jsx-no-target-blank */
|
|
1683
1685
|
var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
@@ -1703,7 +1705,8 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1703
1705
|
|
|
1704
1706
|
var cardType = "is" + toCapitalize(layout);
|
|
1705
1707
|
React.useEffect(function () {
|
|
1706
|
-
setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
1708
|
+
// setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated')
|
|
1709
|
+
setType('richRelated');
|
|
1707
1710
|
}, []);
|
|
1708
1711
|
|
|
1709
1712
|
var _useInView = reactIntersectionObserver.useInView({
|
|
@@ -1759,7 +1762,7 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1759
1762
|
return React__default.createElement("a", {
|
|
1760
1763
|
"data-testid": "related-rich-block",
|
|
1761
1764
|
className: makeClassName(classNames),
|
|
1762
|
-
href: url,
|
|
1765
|
+
href: "/" + url,
|
|
1763
1766
|
target: "_blank",
|
|
1764
1767
|
onClick: function onClick() {
|
|
1765
1768
|
return handleClick();
|
|
@@ -1776,14 +1779,16 @@ var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
|
1776
1779
|
}, React__default.createElement(Tag, {
|
|
1777
1780
|
size: "small",
|
|
1778
1781
|
theme: "inherit",
|
|
1779
|
-
styleContext: "
|
|
1782
|
+
styleContext: "richRelated"
|
|
1780
1783
|
}, tag)), React__default.createElement("div", {
|
|
1781
1784
|
className: styles$s.cover
|
|
1785
|
+
}, React__default.createElement("div", {
|
|
1786
|
+
className: styles$s.picture
|
|
1782
1787
|
}, React__default.createElement(Image, {
|
|
1783
1788
|
optimized: urls,
|
|
1784
1789
|
ratio: ratio,
|
|
1785
1790
|
display: "narrow"
|
|
1786
|
-
})), React__default.createElement("div", {
|
|
1791
|
+
}))), React__default.createElement("div", {
|
|
1787
1792
|
className: styles$s.body
|
|
1788
1793
|
}, blocks.map(function (item) {
|
|
1789
1794
|
return React__default.createElement(RenderBlocks, {
|